Skip to content

Commit

Permalink
Merge pull request #76 from unibonn/add-starter-environment-configura…
Browse files Browse the repository at this point in the history
…tion

Add starter environment configuration
  • Loading branch information
kreczko authored Sep 21, 2017
2 parents bc77089 + 3a7df5e commit 46f498f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@ force_singularity_jobs => true,
singularity_image_expr => "/images/myimage.img",
singularity_bind_paths => ['/some_shared_filesystem', '/pool', '/usr/libexec/condor/'],
singularity_target_dir => '/srv',
starter_job_environment => { 'SINGULARITY_HOME' => '/srv' },
mount_under_scratch_dirs => ['/tmp','/var/tmp'],
```
This forces all jobs to run inside Singularity containers, while offering `tmp` space inside the container, and binding a shared filesystem mount point and HTCondor-specific directories inside.
The binding of the two HTCondor specific directories is a workaround to allow interactive jobs to run, this will hopefully be fixed in a future HTCondor release.
The same holds for setting `SINGULARITY_HOME`: This ensures non-interactive jobs start in the job's working directory instead of the user's home directory which might not even be accessible from the worker.

The Image may also be an expression to allow for user configuration, more details on that are provided in the [HTCondor documentation](https://research.cs.wisc.edu/htcondor/manual/latest/3_17Singularity_Support.html).

Expand Down
1 change: 1 addition & 0 deletions manifests/config/worker.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
$memory_overcommit = $htcondor::memory_overcommit
$number_of_cpus = $htcondor::number_of_cpus
$partitionable_slots = $htcondor::partitionable_slots
$starter_job_environment = $htcondor::starter_job_environment
$pool_create = $htcondor::pool_create
$pool_home = $htcondor::pool_home
$use_pid_namespaces = $htcondor::use_pid_namespaces
Expand Down
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
$request_memory = $htcondor::params::request_memory,
$certificate_mapfile = $htcondor::params::certificate_mapfile,
$kerberos_mapfile = $htcondor::params::kerberos_mapfile,
$starter_job_environment = $htcondor::params::starter_job_environment,
$pool_home = $htcondor::params::pool_home,
$pool_create = $htcondor::params::pool_create,
$mount_under_scratch_dirs = $htcondor::params::mount_under_scratch_dirs,
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
$memory_overcommit = hiera('memory_overcommit', 1.5)
$request_memory = hiera('request_memory', true)

$starter_job_environment = hiera_hash('starter_job_environment', {})
$pool_home = hiera('pool_home', '/pool')
$pool_create = hiera('pool_create', true)
$mount_under_scratch_dirs = hiera_array('mount_under_scratch_dirs', ['/tmp', '/var/tmp'])
Expand Down
3 changes: 3 additions & 0 deletions templates/20_workernode.config.erb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ MAXJOBRETIREMENTTIME = $(HOUR) * 24 * 3
UPDATE_INTERVAL = $RANDOM_INTEGER(230, 370)
MASTER_UPDATE_INTERVAL = $RANDOM_INTEGER(230, 370)

## Special environment setup
STARTER_JOB_ENVIRONMENT = "<%= @starter_job_environment.map{|e| e.join('=')}.join(" ") %>"

## Location of scratch directories
EXECUTE = <%= @pool_home %>/condor

Expand Down

0 comments on commit 46f498f

Please sign in to comment.