Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jdl_creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rene Caspart
jdl_creator
Commits
06de4606
Commit
06de4606
authored
8 years ago
by
Frank Fischer
Browse files
Options
Downloads
Patches
Plain Diff
Expand example usage with more comments
parent
76b8f0b3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
classes/JDLCreator.py
+2
-4
2 additions, 4 deletions
classes/JDLCreator.py
create_jdl.py
+24
-16
24 additions, 16 deletions
create_jdl.py
job.sh
+0
-3
0 additions, 3 deletions
job.sh
with
26 additions
and
23 deletions
classes/JDLCreator.py
+
2
−
4
View file @
06de4606
...
...
@@ -48,7 +48,6 @@ class CloudSite(object):
class
JDLCreator
(
object
):
"""
Class to create JDL files for EKP HTCondor system.
"""
"""
Lines for output, log and errors.
"""
LINE_OUTPUT
=
'
output = out/$(Process).out
'
LINE_ERROR
=
'
error = error/$(Process).err
'
...
...
@@ -57,6 +56,7 @@ class JDLCreator(object):
def
__init__
(
self
,
site_name
=
''
,
executable
=
''
,
wall_time
=
0
,
job_folder
=
'
.
'
,
extra_lines
=
''
,
output_files
=
''
,
arguments
=
''
):
# types (str, str, int, str, list, str, list) -> None
"""
Class to create JDL files for EKP HTCondor system.
"""
###
# public attributes - user is allowed to change these values
...
...
@@ -371,9 +371,7 @@ class JDLCreator(object):
[
print
(
line
)
for
line
in
self
.
__get_JDL_content
()]
def
WriteJDL
(
self
,
exe
=
''
,
arguments
=
''
):
"""
Create folder (if set) and write JDLFile, argument list file,
copy job in the folder
"""
"""
Create job_folder (if set) and write JDLFile & argument list file; also copies job in the folder
"""
if
len
(
exe
)
>
0
:
self
.
executable
=
exe
if
len
(
arguments
)
>
0
:
...
...
This diff is collapsed.
Click to expand it.
create_jdl.py
+
24
−
16
View file @
06de4606
#!/usr/bin/env python
from
classes.JDLCreator
import
JDLCreator
# import the class to create and submit JDL files
import
numpy
from
classes.JDLCreator
import
JDLCreator
# import the class to create and submit JDL files
def
main
():
jobs
=
JDLCreator
()
#run jobs on condocker cloude site
##################################
# submit job
##################################
jobs
.
SetExecutable
(
"
job.sh
"
)
# set job script
"""
Submit a simple example job
"""
jobs
=
JDLCreator
()
# Default (no Cloud Site supplied): Docker with SLC6 image
# Some example sites:
# site_name='condocker' Exclusively run the job on our desktop cluster
# site_name='bwforcluster' Freiburg
# site_name='ekpsupermachines' "Super Machines" in floor 9 server room
# site_name='gridka' gridKa School Training VMs
jobs
.
executable
=
"
job.sh
"
# name of the job script
jobs
.
wall_time
=
3
# job will finish in 3 seconds, it's just some "echo"s
jobs
.
memory
=
64
# We're running a simple bash script. 64 MB memory are more than enough
#build list of arguments
arguments
=
[]
for
i
in
numpy
.
arange
(
0
,
5
,
1
):
arguments
.
append
(
i
)
# build list of arguments: 1,2,3,4,5
arguments
=
[
x
for
x
in
range
(
0
,
5
)]
# you can also build a regular list via arg = []; arg.append(value)
jobs
.
SetArguments
(
arguments
)
# set arguments
jobs
.
arguments
=
arguments
# set arguments for condor job
# Our job requires lots of CPU resources and needs access to the local EKP resources
jobs
.
requirements
=
"
(Target.PROVIDES_CPU ==True) && (TARGET.PROVIDES_EKP_RESOURCES == True)
"
jobs
.
job_folder
=
'
condor_jobs
'
# set name of the folder, where files and information are stored
jobs
.
WriteJDL
()
# write an JDL file and create folder for log files
jobs
.
requirements
=
"
(Target.PROVIDES_CPU ==True) && (TARGET.PROVIDES_EKP_RESOURCES == True)
"
jobs
.
SetFolder
(
'
condor_jobs/
'
)
# set folder !!! you have to copy your job file into the folder
jobs
.
WriteJDL
()
# write an JDL file and create folder for log files
if
__name__
==
"
__main__
"
:
main
()
This diff is collapsed.
Click to expand it.
job.sh
+
0
−
3
View file @
06de4606
...
...
@@ -5,6 +5,3 @@ echo "hostname: " hostname
echo
"how am I? "
whoami
pwd
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment