Skip to content

Commit

Permalink
Simplify container
Browse files Browse the repository at this point in the history
  • Loading branch information
0x2b3bfa0 authored Sep 28, 2022
1 parent 1a373a4 commit fd486dd
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions bin/cml.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ const setupTelemetry = async (opts, { parsed: { defaulted } }) => {
for (const [name, option] of Object.entries(opts.options)) {
if (opts[name] && !defaulted[name]) {
switch (option.telemetry) {
case 'presence':
case 'name':
options[name] = null;
break;
case 'full':
case 'name+value':
options[name] = opts[name];
break;
}
Expand Down
2 changes: 1 addition & 1 deletion bin/cml/asset/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ exports.options = kebabcaseKeys({
rmWatermark: {
type: 'boolean',
description: 'Avoid CML watermark.',
telemetry: 'presence'
telemetry: 'name'
},
mimeType: {
type: 'string',
Expand Down
6 changes: 3 additions & 3 deletions bin/cml/comment/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ exports.options = kebabcaseKeys({
type: 'string',
default: 'https://asset.cml.dev',
description: 'Self-hosted image server URL',
telemetry: 'presence'
telemetry: 'name'
},
watch: {
type: 'boolean',
Expand All @@ -49,7 +49,7 @@ exports.options = kebabcaseKeys({
type: 'boolean',
description:
"Uses driver's native capabilities to upload assets instead of CML's storage; not available on GitHub",
telemetry: 'presence'
telemetry: 'name'
},
update: {
type: 'boolean',
Expand All @@ -61,6 +61,6 @@ exports.options = kebabcaseKeys({
type: 'boolean',
description:
'Avoid watermark; CML needs a watermark to be able to distinguish CML comments from others',
telemetry: 'presence'
telemetry: 'name'
}
});
10 changes: 5 additions & 5 deletions bin/cml/runner/launch.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,14 +467,14 @@ exports.options = kebabcaseKeys({
conflicts: ['single', 'reuseIdle'],
description:
"Don't launch a new runner if an existing one has the same name or overlapping labels",
telemetry: 'presence'
telemetry: 'name'
},
reuseIdle: {
type: 'boolean',
conflicts: ['reuse', 'single'],
description:
"Creates a new runner only if the matching labels don't exist or are already busy",
telemetry: 'presence'
telemetry: 'name'
},
workdir: {
type: 'string',
Expand All @@ -491,7 +491,7 @@ exports.options = kebabcaseKeys({
type: 'string',
choices: ['aws', 'azure', 'gcp', 'kubernetes'],
description: 'Cloud to deploy the runner',
telemetry: 'full'
telemetry: 'name+value'
},
cloudRegion: {
type: 'string',
Expand Down Expand Up @@ -545,13 +545,13 @@ exports.options = kebabcaseKeys({
default: -1,
description:
'Maximum spot instance bidding price in USD. Defaults to the current spot bidding price',
telemetry: 'presence'
telemetry: 'name'
},
cloudStartupScript: {
type: 'string',
description:
'Run the provided Base64-encoded Linux shell script during the instance initialization',
telemetry: 'presence'
telemetry: 'name'
},
cloudAwsSecurityGroup: {
type: 'string',
Expand Down
2 changes: 1 addition & 1 deletion bin/cml/tensorboard/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,6 @@ exports.options = kebabcaseKeys({
rmWatermark: {
type: 'boolean',
description: 'Avoid CML watermark',
telemetry: 'presence'
telemetry: 'name'
}
});
2 changes: 1 addition & 1 deletion bin/cml/tensorboard/connect.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('tbLink', () => {
error = err;
}

expect(error.message).toBe(`Tensorboard took too long. ${message}`);
expect(error.message).toBe(`Tensorboard took too long`);
});

test('valid url is returned', async () => {
Expand Down
3 changes: 2 additions & 1 deletion src/analytics.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ describe('analytics tests', () => {
const cml = new CML({ repo: REPO, token: TOKEN });
const action = 'test';
const cloud = 'azure';
const container = 'cml';
const more = { one: 1, two: 2 };
const extra = { cloud, ...more };
const extra = { cloud, container, ...more };
const error = 'Ouch!';
const regex = /\d+\.\d+\.\d+/;

Expand Down

2 comments on commit fd486dd

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test Comment

CML watermark

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test Comment

CML watermark

Please sign in to comment.