Skip to content
This repository was archived by the owner on Jun 6, 2023. It is now read-only.

Commit f549988

Browse files
committed
add port mapping param to job create; doc updates
1 parent a627507 commit f549988

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/jobs/create.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@ var jobs_show = require('./../jobs/show.js');
2525
* @param {string} [params.project] - The name of the project for this job. If not provided, this is taken from the .ps_project/config.json file, or the current directory name.
2626
* @param {string} [params.projectId] - The poject id of an existing project for this job. Note: if projectId is specified, the project parameter cannot be specified.
2727
* @param {string} [params.command] - An optional command to run within the workspace or container.
28-
* @param {string} [params.workspace] - An optional path to a workspace, or link to a git repository to upload and merge with the container. If a zip file name is provided it is uploaded instead. If no workspace is provided the current directory is zipped up and transferred. If the workspace is 'none', no workspace is merged and the container is run as-is.
28+
* @param {string} [params.workspace] - An optional path to a workspace, or link to a git repository to upload and merge with the container. If a zip file name is provided it is uploaded instead. If no workspace is provided the current directory is zipped up and transferred. If the workspace is 'none', no workspace is merged and the container is run as-is. To download a git repository provide an https repository link and prefix it with 'git+', e.g. 'git+https://github.com/MyProjects/MyRepo.git'. S3 links are also supported using the schema 's3://bucketname/objectname'.
2929
* @param {string} [params.dataset] - An optional reference to a dataset to be merged with the container.
3030
* @param {string} [params.registryUsername] - An optional username for accessing an image hosted on a private container registry. Note: you must specify this option every time a private image is specified for the container.
3131
* @param {string} [params.registryPassword] - An optional password for accessing an image hosted on a private container registry. Note: you must specify this option every time a private image is specified for the container.
3232
* @param {string} [params.workspaceUsername] - An optional username for accessing a private git repository. Note: you must specify this option every time a private git repository is specified for the workspace.
3333
* @param {string} [params.workspacePassword] - An optional password for accessing a private git repository. We recommned using an OAuth token (GitHub instructions can be found <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">here</a>). Note: you must specify this option every time a private git repository is specified for the workspace.
34+
* @param {string} [params.ports] - An optional list of port mappings to open on the job cluster machine while the job is running. The port mappings are specified as 'XXXX:YYYY' where XXXX is an external port number and YYYY is an internal port number. Mulitple port mappings can be provided as a comma separated list. Port numbers must be greater than 1023. Note: only /tcp protocol usage is supported.
3435
* @param {boolean} [params.tail] - Optional; defaults to true in command line mode only. Specify false to disable automatic tailing.
3536
* @param {boolean} [params.json] - Optional; if true, do not write progress to standard out. '--json' with no value is equivalent to true.
3637
* @param {function} cb - Node-style error-first callback function
@@ -81,6 +82,10 @@ var jobs_show = require('./../jobs/show.js');
8182
* "dtTeardownFinished": null,
8283
* "dtDeleted": null,
8384
* "exitCode": null
85+
* "storageRegion": "East Coast (NY2)",
86+
* "clusterMachine": "psABCD123",
87+
* "ipAddress": "10.100.0.10",
88+
* "ports": "6006:6006",
8489
* }
8590
*/
8691

@@ -238,6 +243,8 @@ function create(params, cb) {
238243
if (state === 'Error' || res.jobError) console.log('Error: ' + res.jobError);
239244
return cb();
240245
}
246+
if (res.storageRegion) console.log('Storage Region: ' + res.storageRegion);
247+
if (res.ports && res.ipAddress) console.log('IP Address: ' + res.ipAddress);
241248
console.log('Awaiting logs...');
242249
return jobs_logs({ jobId: jobId, tail: true }, function _logsCb(err) {
243250
if (err) return cb(err);

0 commit comments

Comments
 (0)