Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
datascience
balsamDEPRECATED
Commits
e9572044
Commit
e9572044
authored
Oct 13, 2017
by
Thomas Uram
Browse files
Add example Python script for creating a job programmatically
parent
51ff12f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/create_job_api.py
0 → 100755
View file @
e9572044
#!/usr/bin/python
import
sys
import
django
django
.
setup
()
from
django.conf
import
settings
from
balsam
import
models
num
=
1
if
len
(
sys
.
argv
)
>
1
:
num
=
int
(
sys
.
argv
[
1
])
for
i
in
range
(
num
):
job
=
models
.
BalsamJob
()
job
.
job_id
=
models
.
BalsamJob
.
generate_job_id
()
job
.
working_directory
=
models
.
BalsamJob
.
create_working_path
(
job
.
job_id
)
#job.site = 'cooley'
#job.job_name = 'helloworld'
#job.job_description = 'helloworld'
#job.origin_id = options['origin_id']
#job.queue = 'default'
#job.project = 'visualization'
job
.
wall_time_minutes
=
30
job
.
num_nodes
=
1
#job.processes_per_node = 1
job
.
application
=
'helloworld'
job
.
config_file
=
'/home/turam/helloworld.sh'
#job.input_url = options['input_url']
#job.output_url = options['output_url']
job
.
save
()
print
'Created job'
,
job
.
id
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment