diff --git a/bin/cml-runner.js b/bin/cml-runner.js index c73adc772..c11901491 100755 --- a/bin/cml-runner.js +++ b/bin/cml-runner.js @@ -114,7 +114,7 @@ const shutdown = async (opts) => { }; const runCloud = async (opts) => { - const { cloud_ssh_private_visible: cloudSshPrivateVisible } = opts; + const { cloudSshPrivateVisible } = opts; const runTerraform = async (opts) => { console.log('Terraform apply...'); @@ -122,18 +122,18 @@ const runCloud = async (opts) => { const { token, repo, driver } = cml; const { labels, - idle_timeout: idleTimeout, + idleTimeout, name, single, cloud, - cloud_region: region, - cloud_type: type, - cloud_gpu: gpu, - cloud_hdd_size: hddSize, - cloud_ssh_private: sshPrivate, - cloud_spot: spot, - cloud_spot_price: spotPrice, - cloud_startup_script: startupScript, + cloudRegion: region, + cloudType: type, + cloudGpu: gpu, + cloudHddSize: hddSize, + cloudSshPrivate: sshPrivate, + cloudSpot: spot, + cloudSpotPrice: spotPrice, + cloudStartupScript: startupScript, tfFile, workdir } = opts; @@ -203,14 +203,14 @@ const runCloud = async (opts) => { const runLocal = async (opts) => { console.log(`Launching ${cml.driver} runner`); - const { workdir, name, labels, single, idle_timeout: idleTimeout } = opts; + const { workdir, name, labels, single, idleTimeout } = opts; const proc = await cml.startRunner({ workdir, name, labels, single, - idle_timeout: idleTimeout + idleTimeout }); const dataHandler = (data) => { @@ -259,7 +259,7 @@ const run = async (opts) => { labels, name, reuse, - tf_resource: tfResource + tfResource } = opts; cml = new CML({ driver, repo, token }); diff --git a/bin/cml-tensorboard-dev.js b/bin/cml-tensorboard-dev.js index f04b76cf8..236b6df5f 100755 --- a/bin/cml-tensorboard-dev.js +++ b/bin/cml-tensorboard-dev.js @@ -30,7 +30,7 @@ const run = async (opts) => { name, description, title, - rm_watermark: rmWatermark + rmWatermark } = opts; // set credentials diff --git a/src/cml.js b/src/cml.js index a965aa2fe..1bd4609f6 100644 --- a/src/cml.js +++ b/src/cml.js @@ -92,8 +92,8 @@ class CML { async commentCreate(opts = {}) { const { report: userReport, - commit_sha: commitSha = await this.headSha(), - rm_watermark: rmWatermark + commitSha = await this.headSha(), + rmWatermark } = opts; const watermark = rmWatermark ? '' @@ -108,19 +108,13 @@ class CML { } async checkCreate(opts = {}) { - const { head_sha: headSha = await this.headSha() } = opts; + const { headSha = await this.headSha() } = opts; return await getDriver(this).checkCreate({ ...opts, headSha }); } async publish(opts = {}) { - const { - title = '', - md, - native, - gitlab_uploads: gitlabUploads, - rm_watermark: rmWatermark - } = opts; + const { title = '', md, native, gitlabUploads, rmWatermark } = opts; let mime, uri; if (native || gitlabUploads) { @@ -239,8 +233,8 @@ class CML { const driver = getDriver(this); const { remote = GIT_REMOTE, - user_email: userEmail = GIT_USER_EMAIL, - user_name: userName = GIT_USER_NAME, + userEmail = GIT_USER_EMAIL, + userName = GIT_USER_NAME, globs = ['dvc.lock', '.gitignore'], md } = opts; diff --git a/src/cml.test.js b/src/cml.test.js index 9dd104b07..b307b4923 100644 --- a/src/cml.test.js +++ b/src/cml.test.js @@ -60,7 +60,7 @@ describe('Github tests', () => { test('Comment should succeed with a valid sha', async () => { const report = '## Test comment'; - await new CML({ repo: REPO }).commentCreate({ report, commit_sha: SHA }); + await new CML({ repo: REPO }).commentCreate({ report, commitSha: SHA }); }); test('Comment should fail with a invalid sha', async () => { @@ -69,10 +69,7 @@ describe('Github tests', () => { const report = '## Test comment'; const commitSha = 'invalid_sha'; - await new CML({ repo: REPO }).commentCreate({ - report, - commit_sha: commitSha - }); + await new CML({ repo: REPO }).commentCreate({ report, commitSha }); } catch (err) { caughtErr = err.message; } @@ -184,7 +181,7 @@ describe('Gitlab tests', () => { test('Comment should succeed with a valid sha', async () => { const report = '## Test comment'; - await new CML({ repo: REPO }).commentCreate({ report, commit_sha: SHA }); + await new CML({ repo: REPO }).commentCreate({ report, commitSha: SHA }); }); test('Comment should fail with a invalid sha', async () => { @@ -193,10 +190,7 @@ describe('Gitlab tests', () => { const report = '## Test comment'; const commitSha = 'invalid_sha'; - await new CML({ repo: REPO }).commentCreate({ - report, - commit_sha: commitSha - }); + await new CML({ repo: REPO }).commentCreate({ report, commitSha }); } catch (err) { caughtErr = err.message; } diff --git a/src/drivers/gitlab.js b/src/drivers/gitlab.js index 2340aa8ae..4ecc921c4 100644 --- a/src/drivers/gitlab.js +++ b/src/drivers/gitlab.js @@ -129,7 +129,7 @@ class Gitlab { } async startRunner(opts) { - const { workdir, idle_timeout: idleTimeout, single, labels, name } = opts; + const { workdir, idleTimeout, single, labels, name } = opts; let gpu = true; try { diff --git a/src/utils.js b/src/utils.js index 8310e4cb5..55ee2a04c 100644 --- a/src/utils.js +++ b/src/utils.js @@ -42,7 +42,7 @@ const mimeType = async (opts) => { }; const fetchUploadData = async (opts) => { - const { path, buffer, mime_type: mimeTypeIn } = opts; + const { path, buffer, mimeType: mimeTypeIn } = opts; const size = path ? (await fs.promises.stat(path)).size : buffer.length; const data = path ? fs.createReadStream(path) : buffer;