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

Commit 4d840f5

Browse files
committed
release_v0.1.13
1 parent b339932 commit 4d840f5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+302
-68
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Paperspace API (v0.1.12)
1+
# Paperspace API (v0.1.13)
22

33
![image](https://user-images.githubusercontent.com/585865/27562775-26b8acc6-5a9c-11e7-8270-2b80ca895bc5.png)
44

docs/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="jobs.h
4646

4747

4848
<section class="readme">
49-
<article><h1 id="paperspace-api-v0-1-12-">Paperspace API (v0.1.12)</h1>
49+
<article><h1 id="paperspace-api-v0-1-13-">Paperspace API (v0.1.13)</h1>
5050
<p><img src="https://user-images.githubusercontent.com/585865/27562775-26b8acc6-5a9c-11e7-8270-2b80ca895bc5.png" alt="image"></p>
5151
<hr>
5252
<p><strong>Heads up! This project is under construction!</strong> We welcome your bug reports and suggestions via GitHub Issues!</p>
@@ -163,7 +163,7 @@ <h2 id="copyright">Copyright</h2>
163163
<br class="clear">
164164

165165
<footer>
166-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jan 14 2019 10:51:10 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
166+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Feb 11 2019 13:09:54 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
167167
</footer>
168168

169169
<script>prettyPrint();</script>

docs/jobs.html

Lines changed: 201 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ <h6>Properties</h6>
15191519

15201520

15211521

1522-
<td class="description last"><p>A required reference to a docker image in a public or private docker registry, or a container name provided by Paperspace. Docker image repository references must be in lowercase and may include a tag and a hostname prefix followed by a slash; if ommitted the hostname defaults to that of the public Docker Hub registry. An example docker image reference: 'docker.io/mynamespace/myimage:mytag'. A container name may be mixed case. (Designated container names are currently only provided as part of various Gradient tutorials and samples.)</p></td>
1522+
<td class="description last"><p>A reference to a docker image in a public or private docker registry, or a container name provided by Paperspace. Docker image repository references must be in lowercase and may include a tag and a hostname prefix followed by a slash; if ommitted the hostname defaults to that of the public Docker Hub registry. An example docker image reference: 'docker.io/mynamespace/myimage:mytag'. A container name may be mixed case. (Designated container names are currently only provided as part of various Gradient tutorials and samples.)</p></td>
15231523
</tr>
15241524

15251525

@@ -2212,7 +2212,205 @@ <h6>Properties</h6>
22122212

22132213

22142214

2215-
<td class="description last"><p>Optional; if included job will be sent to a preemptible VM only. Defaults to false.</p></td>
2215+
<td class="description last"><p>Optional; if true job will be sent to a preemptible VM only. Defaults to false.</p></td>
2216+
</tr>
2217+
2218+
2219+
2220+
<tr>
2221+
2222+
<td class="name"><code>useDockerfile</code></td>
2223+
2224+
2225+
<td class="type">
2226+
2227+
2228+
<span class="param-type">boolean</span>
2229+
2230+
2231+
2232+
</td>
2233+
2234+
2235+
<td class="attributes">
2236+
2237+
&lt;optional><br>
2238+
2239+
2240+
2241+
2242+
2243+
</td>
2244+
2245+
2246+
2247+
2248+
<td class="description last"><p>Optional; if true the job will use the Dockerfile provided in the workspace to build a docker image and optionally run the resulting image as a container</p></td>
2249+
</tr>
2250+
2251+
2252+
2253+
<tr>
2254+
2255+
<td class="name"><code>buildOnly</code></td>
2256+
2257+
2258+
<td class="type">
2259+
2260+
2261+
<span class="param-type">boolean</span>
2262+
2263+
2264+
2265+
</td>
2266+
2267+
2268+
<td class="attributes">
2269+
2270+
&lt;optional><br>
2271+
2272+
2273+
2274+
2275+
2276+
</td>
2277+
2278+
2279+
2280+
2281+
<td class="description last"><p>Optional; if this option is selected the job will build the Dockerfile and push to a selected remote registry only, without actually running the container. A registry target must be provided.</p></td>
2282+
</tr>
2283+
2284+
2285+
2286+
<tr>
2287+
2288+
<td class="name"><code>registryTarget</code></td>
2289+
2290+
2291+
<td class="type">
2292+
2293+
2294+
<span class="param-type">string</span>
2295+
2296+
2297+
2298+
</td>
2299+
2300+
2301+
<td class="attributes">
2302+
2303+
&lt;optional><br>
2304+
2305+
2306+
2307+
2308+
2309+
</td>
2310+
2311+
2312+
2313+
2314+
<td class="description last"><p>Optional; a location to push docker images built from a Dockerfile. Must be included with a buildOnly flag. If useDockerfile is true and registryTarget is false the built container will be run but not pushed to a remote registry.</p></td>
2315+
</tr>
2316+
2317+
2318+
2319+
<tr>
2320+
2321+
<td class="name"><code>registryTargetUsername</code></td>
2322+
2323+
2324+
<td class="type">
2325+
2326+
2327+
<span class="param-type">string</span>
2328+
2329+
2330+
2331+
</td>
2332+
2333+
2334+
<td class="attributes">
2335+
2336+
&lt;optional><br>
2337+
2338+
2339+
2340+
2341+
2342+
</td>
2343+
2344+
2345+
2346+
2347+
<td class="description last"><p>Optional; username credential for remote registry target</p></td>
2348+
</tr>
2349+
2350+
2351+
2352+
<tr>
2353+
2354+
<td class="name"><code>registryTargetPassword</code></td>
2355+
2356+
2357+
<td class="type">
2358+
2359+
2360+
<span class="param-type">string</span>
2361+
2362+
2363+
2364+
</td>
2365+
2366+
2367+
<td class="attributes">
2368+
2369+
&lt;optional><br>
2370+
2371+
2372+
2373+
2374+
2375+
</td>
2376+
2377+
2378+
2379+
2380+
<td class="description last"><p>Optional; password credential for remote registry target</p></td>
2381+
</tr>
2382+
2383+
2384+
2385+
<tr>
2386+
2387+
<td class="name"><code>relDockerfilePath</code></td>
2388+
2389+
2390+
<td class="type">
2391+
2392+
2393+
<span class="param-type">string</span>
2394+
2395+
2396+
2397+
</td>
2398+
2399+
2400+
<td class="attributes">
2401+
2402+
&lt;optional><br>
2403+
2404+
2405+
2406+
2407+
2408+
</td>
2409+
2410+
2411+
2412+
2413+
<td class="description last"><p>Optional; relative location of Dockefile in the workspace. Defaults to the top level &quot;./Dockerfile&quot; if not specified.</p></td>
22162414
</tr>
22172415

22182416

@@ -4766,7 +4964,7 @@ <h5>Returns:</h5>
47664964
<br class="clear">
47674965

47684966
<footer>
4769-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jan 14 2019 10:51:10 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
4967+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Feb 11 2019 13:09:54 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
47704968
</footer>
47714969

47724970
<script>prettyPrint();</script>

docs/jobs_artifactsDestroy.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ <h1 class="page-title">jobs/artifactsDestroy.js</h1>
102102
<br class="clear">
103103

104104
<footer>
105-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jan 14 2019 10:51:10 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
105+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Feb 11 2019 13:09:54 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
106106
</footer>
107107

108108
<script>prettyPrint();</script>

docs/jobs_artifactsGet.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ <h1 class="page-title">jobs/artifactsGet.js</h1>
280280
<br class="clear">
281281

282282
<footer>
283-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jan 14 2019 10:51:10 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
283+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Feb 11 2019 13:09:54 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
284284
</footer>
285285

286286
<script>prettyPrint();</script>

docs/jobs_artifactsList.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ <h1 class="page-title">jobs/artifactsList.js</h1>
133133
<br class="clear">
134134

135135
<footer>
136-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jan 14 2019 10:51:10 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
136+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Feb 11 2019 13:09:54 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
137137
</footer>
138138

139139
<script>prettyPrint();</script>

docs/jobs_clone.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ <h1 class="page-title">jobs/clone.js</h1>
130130
<br class="clear">
131131

132132
<footer>
133-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jan 14 2019 10:51:10 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
133+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Feb 11 2019 13:09:54 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
134134
</footer>
135135

136136
<script>prettyPrint();</script>

docs/jobs_create.js.html

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ <h1 class="page-title">jobs/create.js</h1>
6060
* @method create
6161
* @description Create a new Paperspace job, and tail its log output if run at the command line. To disable the tailing behavior specify '--tail false'. Note: if a project is not defined for the current working directory, and you are running in command line mode, a project configuration settings file will be created. Use '--init false' or specify '--project [projectname]' to override this behavior.
6262
* @param {object} params - Job creation parameters
63-
* @param {string} params.container - A required reference to a docker image in a public or private docker registry, or a container name provided by Paperspace. Docker image repository references must be in lowercase and may include a tag and a hostname prefix followed by a slash; if ommitted the hostname defaults to that of the public Docker Hub registry. An example docker image reference: 'docker.io/mynamespace/myimage:mytag'. A container name may be mixed case. (Designated container names are currently only provided as part of various Gradient tutorials and samples.)
63+
* @param {string} params.container - A reference to a docker image in a public or private docker registry, or a container name provided by Paperspace. Docker image repository references must be in lowercase and may include a tag and a hostname prefix followed by a slash; if ommitted the hostname defaults to that of the public Docker Hub registry. An example docker image reference: 'docker.io/mynamespace/myimage:mytag'. A container name may be mixed case. (Designated container names are currently only provided as part of various Gradient tutorials and samples.)
6464
* @param {string} [params.cluster] - An optional cluster name of a cluster to run the job on. Only one of cluster or clusterId may be specified.
6565
* @param {string} [params.clusterId] - An optional cluster id of a cluster to run the job on. Only one of cluster or clusterId may be specified.
6666
* @param {string} [params.machineType] - An optional machine type to run the job on: either 'GPU+', 'P4000', 'P5000', 'P6000', 'V100', 'K80', 'P100', 'TPU', or 'GradientNode'.&lt;p>Defaults to 'K80'. &lt;P>Note: the 'K80', 'P100', and 'TPU' machineTypes run on Google Cloud Platform (GCP). The other machineTypes run on the Paperspace Cloud. Google Cloud platform and Paperspace Cloud have distict Job Storage spaces; Job storage is not currently shared between these two cloud environments.
@@ -81,7 +81,13 @@ <h1 class="page-title">jobs/create.js</h1>
8181
* @param {number} [params.nodeAttrs] - Optional; a JSON expression describing the node attributes for a compatible GradientNode machine to run this job. See the Gradient-Node documentation for more info.
8282
* @param {boolean} [params.tail] - Optional; defaults to true in command line mode only. Specify false to disable automatic tailing.
8383
* @param {boolean} [params.json] - Optional; if true, do not write progress to standard out. '--json' with no value is equivalent to true.
84-
* @param {boolean} [params.isPreemptible] - Optional; if included job will be sent to a preemptible VM only. Defaults to false.
84+
* @param {boolean} [params.isPreemptible] - Optional; if true job will be sent to a preemptible VM only. Defaults to false.
85+
* @param {boolean} [params.useDockerfile] - Optional; if true the job will use the Dockerfile provided in the workspace to build a docker image and optionally run the resulting image as a container
86+
* @param {boolean} [params.buildOnly] - Optional; if this option is selected the job will build the Dockerfile and push to a selected remote registry only, without actually running the container. A registry target must be provided.
87+
* @param {string} [params.registryTarget] - Optional; a location to push docker images built from a Dockerfile. Must be included with a buildOnly flag. If useDockerfile is true and registryTarget is false the built container will be run but not pushed to a remote registry.
88+
* @param {string} [params.registryTargetUsername] - Optional; username credential for remote registry target
89+
* @param {string} [params.registryTargetPassword] - Optional; password credential for remote registry target
90+
* @param {string} [params.relDockerfilePath] - Optional; relative location of Dockefile in the workspace. Defaults to the top level "./Dockerfile" if not specified.
8591
* @param {function} cb - Node-style error-first callback function
8692
* @returns {object} job - The created job JSON object
8793
* @example
@@ -229,11 +235,20 @@ <h1 class="page-title">jobs/create.js</h1>
229235
delete params.tail;
230236
}
231237

238+
if (params.useDockerfile &amp;&amp; !params.buildOnly &amp;&amp; !params.command) {
239+
return ifCliPrintErrorOnly(new Error('Missing required parameter: --command. Use the buildOnly flag or pass a command to execute against the container.'));
240+
} else if (params.useDockerfile &amp;&amp; params.buildOnly) {
241+
params.command = null
242+
} else if (params.command) {
243+
params.command = Buffer.from(params.command).toString('base64');
244+
} else {
245+
return ifCliPrintErrorOnly(new Error('Missing required parameter: --command'));
246+
}
247+
232248
// XXX TODO trim leading/trailing spaces from input paths
233249
// XXX TODO whitelist git services
234250
// XXX TODO convert to gzip
235251
// XXX TODO stream compress
236-
237252
var cwd = process.cwd();
238253
if (!params.project &amp;&amp; !params.projectId) {
239254
// default to name of project in .ps_project/config.json or name of current directory
@@ -271,7 +286,7 @@ <h1 class="page-title">jobs/create.js</h1>
271286

272287
projectConfig.setMachineType(params.project, params.machineType);
273288

274-
projectConfig.setContainer(params.project, params.container);
289+
projectConfig.setContainer(params.project, params.container, params.useDockerfile);
275290

276291
projectConfig.setCommand(params.project, params.command);
277292

@@ -281,7 +296,7 @@ <h1 class="page-title">jobs/create.js</h1>
281296

282297
projectConfig.setCluster(params.project, params.cluster);
283298

284-
if (!params.container) return ifCliPrintErrorOnly(new Error('Missing required parameter `container`'));
299+
if (!params.container &amp;&amp; !params.useDockerfile) return ifCliPrintErrorOnly(new Error('Missing required parameter `container`'));
285300

286301
if (!params.workspace) params.workspace = cwd;
287302

@@ -548,9 +563,6 @@ <h1 class="page-title">jobs/create.js</h1>
548563
name: 'create',
549564
method: 'post',
550565
route: '/jobs/createJob',
551-
requires: {
552-
container: 'string',
553-
},
554566
file: 'workspace',
555567
returns: {},
556568
});
@@ -568,7 +580,7 @@ <h1 class="page-title">jobs/create.js</h1>
568580
<br class="clear">
569581

570582
<footer>
571-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jan 14 2019 10:51:10 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
583+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Feb 11 2019 13:09:54 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
572584
</footer>
573585

574586
<script>prettyPrint();</script>

docs/jobs_destroy.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ <h1 class="page-title">jobs/destroy.js</h1>
103103
<br class="clear">
104104

105105
<footer>
106-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jan 14 2019 10:51:10 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
106+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Feb 11 2019 13:09:54 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
107107
</footer>
108108

109109
<script>prettyPrint();</script>

docs/jobs_index.js.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ <h1 class="page-title">jobs/index.js</h1>
6969
<br class="clear">
7070

7171
<footer>
72-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jan 14 2019 10:51:10 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
72+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Feb 11 2019 13:09:54 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
7373
</footer>
7474

7575
<script>prettyPrint();</script>

0 commit comments

Comments
 (0)