Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

Commit d8a67d3

Browse files
committed
add support for preemptible flag
1 parent 881a14d commit d8a67d3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

paperspace/jobs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def logs(params, tail=False, no_logging=False):
7777
else:
7878
try:
7979
res = r.json()
80-
if 'error' in res:
80+
if res in ('error', 'preempted'):
8181
if no_logging:
8282
return res
8383
print_json_pretty(res)
@@ -136,6 +136,7 @@ def waitfor(params):
136136
or state == 'Error'
137137
or state == 'Stopped'
138138
or state == 'Failed'
139+
or state == 'Preempted'
139140
or state == 'Cancelled'):
140141
return job
141142
time.sleep(5)

paperspace/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def main():
7575
param = opt[2:]
7676
if param in ['script', 'python', 'conda', 'ignoreFiles', 'apiKey', 'container', 'machineType', 'name',
7777
'project', 'projectId', 'command', 'workspace', 'dataset', 'registryUsername', 'registryPassword',
78-
'workspaceUsername', 'workspacePassword', 'cluster', 'clusterId', 'ports']:
78+
'workspaceUsername', 'workspacePassword', 'cluster', 'clusterId', 'ports', 'isPreemptible']:
7979
if args and not args[0].startswith('--'):
8080
params[param] = args.pop(0)
8181
else:

0 commit comments

Comments
 (0)