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

Commit f75b803

Browse files
committed
release v0.1.12
1 parent 367fb6b commit f75b803

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

+179
-61
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.11)
1+
# Paperspace API (v0.1.12)
22

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

docs/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ <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-11-">Paperspace API (v0.1.11)</h1>
49+
<article><h1 id="paperspace-api-v0-1-12-">Paperspace API (v0.1.12)</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>
5353
<hr>
5454
<p>The <strong>Paperspace API</strong> is the official devkit for automating your <a href="https://www.paperspace.com">Paperspace</a> account. It is currently available in <a href="#programmatic-access-via-paperspace-node">JavaScript</a> and <a href="https://github.com/Paperspace/paperspace-python">Python</a>, and we plan to offer other languages and integrations in the future. Currently we are offering basic actions such as creating Paperspace machines and Gradient jobs. This repository includes:</p>
5555
<ul>
5656
<li><a href="#paperspace-cli">Paperspace CLI</a> (command line interface)</li>
57-
<li><a href="#programmatic-access-via-paperspace-node">JavaScript API client</a> (for Node.js and web browsers)</li>
57+
<li><a href="#programmatic-access-via-paperspace-node">JavaScript API client</a> (for Node.js)</li>
5858
<li><a href="https://paperspace.github.io/paperspace-node">API documentation</a></li>
5959
<li><a href="scripts.md">Script Guide</a> for creating and using startup scripts</li>
6060
</ul>
@@ -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 Fri Nov 09 2018 18:00:52 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 Jan 14 2019 10:51:10 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: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1788,6 +1788,39 @@ <h6>Properties</h6>
17881788

17891789

17901790

1791+
<tr>
1792+
1793+
<td class="name"><code>ignoreFiles</code></td>
1794+
1795+
1796+
<td class="type">
1797+
1798+
1799+
<span class="param-type">string</span>
1800+
1801+
1802+
1803+
</td>
1804+
1805+
1806+
<td class="attributes">
1807+
1808+
&lt;optional><br>
1809+
1810+
1811+
1812+
1813+
1814+
</td>
1815+
1816+
1817+
1818+
1819+
<td class="description last"><p>An optional reference to files or folders that should be excluded from workspace upload. Files/folders to be ignored, comma seperated if multiple.</p></td>
1820+
</tr>
1821+
1822+
1823+
17911824
<tr>
17921825

17931826
<td class="name"><code>codeCommit</code></td>
@@ -2150,6 +2183,39 @@ <h6>Properties</h6>
21502183
</tr>
21512184

21522185

2186+
2187+
<tr>
2188+
2189+
<td class="name"><code>isPreemptible</code></td>
2190+
2191+
2192+
<td class="type">
2193+
2194+
2195+
<span class="param-type">boolean</span>
2196+
2197+
2198+
2199+
</td>
2200+
2201+
2202+
<td class="attributes">
2203+
2204+
&lt;optional><br>
2205+
2206+
2207+
2208+
2209+
2210+
</td>
2211+
2212+
2213+
2214+
2215+
<td class="description last"><p>Optional; if included job will be sent to a preemptible VM only. Defaults to false.</p></td>
2216+
</tr>
2217+
2218+
21532219
</tbody>
21542220
</table>
21552221

@@ -4700,7 +4766,7 @@ <h5>Returns:</h5>
47004766
<br class="clear">
47014767

47024768
<footer>
4703-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 18:00:52 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
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.
47044770
</footer>
47054771

47064772
<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 Fri Nov 09 2018 18:00:52 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 Jan 14 2019 10:51:10 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 Fri Nov 09 2018 18:00:52 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 Jan 14 2019 10:51:10 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 Fri Nov 09 2018 18:00:52 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 Jan 14 2019 10:51:10 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 Fri Nov 09 2018 18:00:52 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 Jan 14 2019 10:51:10 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: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ <h1 class="page-title">jobs/create.js</h1>
6969
* @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.
7070
* @param {string} [params.command] - An optional command to run within the workspace or container.
7171
* @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 optionally prefix it with 'git+', e.g. 'https://github.com/MyProjects/MyRepo.git'. If the 'git+' prefix is not specified, it is added at the time of download to the job runner machine. S3 links are also supported using the schema 's3://bucketname/objectname'.
72+
* @param {string} [params.ignoreFiles] - An optional reference to files or folders that should be excluded from workspace upload. Files/folders to be ignored, comma seperated if multiple.
7273
* @param {string} [params.codeCommit] - An optional reference to git commit hash if local workspace is a git repository. Found at runtime.
7374
* @param {string} [params.dataset] - An optional reference to a dataset to be merged with the container.
7475
* @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.
@@ -80,6 +81,7 @@ <h1 class="page-title">jobs/create.js</h1>
8081
* @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.
8182
* @param {boolean} [params.tail] - Optional; defaults to true in command line mode only. Specify false to disable automatic tailing.
8283
* @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.
8385
* @param {function} cb - Node-style error-first callback function
8486
* @returns {object} job - The created job JSON object
8587
* @example
@@ -449,13 +451,41 @@ <h1 class="page-title">jobs/create.js</h1>
449451
throw err;
450452
}
451453
});
452-
454+
455+
//exclude git based files in archive.glob
456+
var ignoreGlob = ['**/.git/**', '**/.git', '**/.gitignore']
457+
458+
// exclude user supplied --ignoreFiles as well: folders or files
459+
if (params.ignoreFiles) {
460+
if (typeof params.ignoreFiles === 'string') {
461+
var ignoreFilesArray = params.ignoreFiles.split(',')
462+
var ignoreFilesArrayFormatted = ignoreFilesArray.map(function(value, index, array) {
463+
try {
464+
var val = value.trim()
465+
var stats = fs.lstatSync(params.workspace + '/' + val);
466+
}
467+
catch(err) {
468+
var err = new Error('Error: ignoreFiles argument not found');
469+
return ifCliPrintErrorOnly(err);
470+
}
471+
if (stats.isDirectory()) {
472+
val = '**/' + val + '/**'
473+
}
474+
return val
475+
})
476+
ignoreGlob = ignoreGlob.concat(ignoreFilesArrayFormatted)
477+
} else {
478+
var err = new Error('Error: ignoreFiles argument should be folder or file name in string format');
479+
return ifCliPrintErrorOnly(err);
480+
}
481+
}
482+
453483
archive.pipe(output);
454484
if (stat.isDirectory()) {
455485
// include . prefixed folders and files but exclude .git and .gitignore folders and files
456486
archive.glob('**/*', {
457487
cwd: params.workspace,
458-
ignore: ['**/.git/**', '**/.git', '**/.gitignore'],
488+
ignore: ignoreGlob,
459489
dot: true,
460490
}, false);
461491
} else {
@@ -538,7 +568,7 @@ <h1 class="page-title">jobs/create.js</h1>
538568
<br class="clear">
539569

540570
<footer>
541-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 18:00:52 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
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.
542572
</footer>
543573

544574
<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 Fri Nov 09 2018 18:00:52 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 Jan 14 2019 10:51:10 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 Fri Nov 09 2018 18:00:52 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 Jan 14 2019 10:51:10 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)