2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/db93990f8def/ Changeset: db93990f8def Branch: docker-work User: kell...@gmail.com Date: 2014-10-05 23:23:55+00:00 Summary: Adding behavior that docker is called with '--rm' flag by default, so containers will automatically be removed. This can be disabled via job_config Affected #: 3 files diff -r 4aca849f229f538770376d091fac30e4a76854a8 -r db93990f8def9e20c979337dbca0ef1e7e06f400 config/job_conf.xml.sample_advanced --- a/config/job_conf.xml.sample_advanced +++ b/config/job_conf.xml.sample_advanced @@ -77,7 +77,7 @@ of old LWR job runner. If your Pulsar server is running on a Windows machine for instance this runner should still be used. - These destinations still needs to target a Pulsar server, + These destinations still needs to target a Pulsar server, older LWR plugins and destinations still work in Galaxy can target LWR servers, but this support should be considered deprecated and will disappear with a future release of Galaxy. @@ -110,7 +110,7 @@ <destination id="local" runner="local"/><destination id="multicore_local" runner="local"><param id="local_slots">4</param><!-- Specify GALAXY_SLOTS for local jobs. --> - <!-- Warning: Local slot count doesn't tie up additional worker threads, to prevent over + <!-- Warning: Local slot count doesn't tie up additional worker threads, to prevent over allocating machine define a second local runner with different name and fewer workers to run this destination. --><param id="embed_metadata_in_job">True</param> @@ -119,7 +119,7 @@ try it early - it will slightly speed up local jobs by embedding metadata calculation in job script itself. --> - <job_metrics /> + <job_metrics /><!-- Above element demonstrates embedded job metrics definition - see job_metrics_conf.xml.sample for full documentation on possible nested elements. This empty block will simply disable job metrics for the @@ -134,12 +134,12 @@ destination - but be sure to add any library paths or data incides that may be needed read-only. --> - <!-- + <!-- <param id="docker_volumes">$defaults,/mnt/galaxyData/libraries:ro,/mnt/galaxyData/indices:ro</param> --><!-- For a stock Galaxy instance and traditional job runner $defaults will expand out as: - + $galaxy_root:ro,$tool_directory:ro,$working_directory:rw,$default_file_path:rw This assumes most of what is needed is available under Galaxy's root directory, @@ -153,7 +153,7 @@ $galaxy_root:ro,$tool_directory:ro,$working_directory:rw,$default_file_path:ro - If using the Pulsar, defaults will be even further restricted because the + If using the Pulsar, defaults will be even further restricted because the Pulsar will (by default) stage all needed inputs into the job's job_directory (so there is not need to allow the docker container to read all the files - let alone write over them). Defaults in this case becomes: @@ -173,15 +173,15 @@ <!-- Control memory allocatable by docker container with following option: --><!-- <param id="docker_memory">24G</param> --> - <!-- By default Docker will need to runnable by Galaxy using + <!-- By default Docker will need to runnable by Galaxy using password-less sudo - this can be configured by adding the following line to the sudoers file of all compute nodes with docker enabled: - + galaxy ALL = (root) NOPASSWD: SETENV: /usr/bin/docker - The follow option is set to false to disable sudo (docker - must likewise be configured to allow this). + The follow option is set to false to disable sudo (docker + must likewise be configured to allow this). --><!-- <param id="docker_sudo">false</param> --><!-- Following option can be used to tweak sudo command used by @@ -192,6 +192,11 @@ http://docs.docker.io/reference/run/#network-settings --><!-- <param id="docker_net">bridge</param> --> + <!-- By default, a container will live on past its run. By + adding the '--rm' flag to the command line, the container + will be removed automatically after the program is complete. + --> + <!-- <param id="docker_auto_rm">false</param> --><!-- Following command can be used to tweak docker command. --><!-- <param id="docker_cmd">/usr/local/custom_docker/docker</param> --><!-- Following can be used to connect to docke server in different @@ -265,7 +270,7 @@ <!-- Burst out from static destination local_cluster_8_core to static destination shared_cluster_8_core when there are about 50 Galaxy jobs assigned to any of the local_cluster_XXX - destinations (either running or queued). If there are fewer + destinations (either running or queued). If there are fewer than 50 jobs, just use local_cluster_8_core destination. Uncomment job_state parameter to make this bursting happen when @@ -294,8 +299,8 @@ configuration. --><param id="private_token">123456789changeme</param><!-- Uncomment the following statement to disable file staging (e.g. - if there is a shared file system between Galaxy and the Pulsar - server). Alternatively action can be set to 'copy' - to replace + if there is a shared file system between Galaxy and the Pulsar + server). Alternatively action can be set to 'copy' - to replace http transfers with file system copies, 'remote_transfer' to cause the Pulsar to initiate HTTP transfers instead of Galaxy, or 'remote_copy' to cause Pulsar to initiate file system copies. @@ -337,7 +342,7 @@ instead. This may be required if remote host is Windows machine but probably not otherwise. --> - <!-- <param id="rewrite_parameters">false</params> --> + <!-- <param id="rewrite_parameters">false</params> --></destination><destination id="pulsar_mq_dest" runner="amqp_pulsar" ><!-- The RESTful Pulsar client sends a request to Pulsar diff -r 4aca849f229f538770376d091fac30e4a76854a8 -r db93990f8def9e20c979337dbca0ef1e7e06f400 lib/galaxy/tools/deps/containers.py --- a/lib/galaxy/tools/deps/containers.py +++ b/lib/galaxy/tools/deps/containers.py @@ -208,6 +208,7 @@ env_directives=env_directives, working_directory=working_directory, net=prop("net", "none"), # By default, docker instance has networking disabled + auto_rm=prop("auto_rm", docker_util.DEFAULT_AUTO_REMOVE), **docker_host_props ) return "%s\n%s" % (cache_command, run_command) diff -r 4aca849f229f538770376d091fac30e4a76854a8 -r db93990f8def9e20c979337dbca0ef1e7e06f400 lib/galaxy/tools/deps/docker_util.py --- a/lib/galaxy/tools/deps/docker_util.py +++ b/lib/galaxy/tools/deps/docker_util.py @@ -8,6 +8,7 @@ DEFAULT_NET = None DEFAULT_MEMORY = None DEFAULT_VOLUMES_FROM = None +DEFAULT_AUTO_REMOVE = True class DockerVolume(object): @@ -82,6 +83,7 @@ docker_cmd=DEFAULT_DOCKER_COMMAND, sudo=DEFAULT_SUDO, sudo_cmd=DEFAULT_SUDO_COMMAND, + auto_rm=DEFAULT_AUTO_REMOVE, host=DEFAULT_HOST, ): command_parts = __docker_prefix(docker_cmd, sudo, sudo_cmd, host) @@ -100,6 +102,8 @@ command_parts.extend(["-w", working_directory]) if net: command_parts.extend(["--net", net]) + if auto_rm: + command_parts.append("--rm") full_image = image if tag: full_image = "%s:%s" % (full_image, tag) https://bitbucket.org/galaxy/galaxy-central/commits/d252ac015734/ Changeset: d252ac015734 User: jmchilton Date: 2014-10-06 01:45:08+00:00 Summary: Merged in kellrott/galaxy-farm/docker-work (pull request #516) Running docker with 'auto-remove' be default Affected #: 3 files diff -r 37cf5505992bcccfc54f133d04b857076e7164ac -r d252ac015734d6e382ff07a0497a84ac575059e2 config/job_conf.xml.sample_advanced --- a/config/job_conf.xml.sample_advanced +++ b/config/job_conf.xml.sample_advanced @@ -77,7 +77,7 @@ of old LWR job runner. If your Pulsar server is running on a Windows machine for instance this runner should still be used. - These destinations still needs to target a Pulsar server, + These destinations still needs to target a Pulsar server, older LWR plugins and destinations still work in Galaxy can target LWR servers, but this support should be considered deprecated and will disappear with a future release of Galaxy. @@ -110,7 +110,7 @@ <destination id="local" runner="local"/><destination id="multicore_local" runner="local"><param id="local_slots">4</param><!-- Specify GALAXY_SLOTS for local jobs. --> - <!-- Warning: Local slot count doesn't tie up additional worker threads, to prevent over + <!-- Warning: Local slot count doesn't tie up additional worker threads, to prevent over allocating machine define a second local runner with different name and fewer workers to run this destination. --><param id="embed_metadata_in_job">True</param> @@ -119,7 +119,7 @@ try it early - it will slightly speed up local jobs by embedding metadata calculation in job script itself. --> - <job_metrics /> + <job_metrics /><!-- Above element demonstrates embedded job metrics definition - see job_metrics_conf.xml.sample for full documentation on possible nested elements. This empty block will simply disable job metrics for the @@ -134,12 +134,12 @@ destination - but be sure to add any library paths or data incides that may be needed read-only. --> - <!-- + <!-- <param id="docker_volumes">$defaults,/mnt/galaxyData/libraries:ro,/mnt/galaxyData/indices:ro</param> --><!-- For a stock Galaxy instance and traditional job runner $defaults will expand out as: - + $galaxy_root:ro,$tool_directory:ro,$working_directory:rw,$default_file_path:rw This assumes most of what is needed is available under Galaxy's root directory, @@ -153,7 +153,7 @@ $galaxy_root:ro,$tool_directory:ro,$working_directory:rw,$default_file_path:ro - If using the Pulsar, defaults will be even further restricted because the + If using the Pulsar, defaults will be even further restricted because the Pulsar will (by default) stage all needed inputs into the job's job_directory (so there is not need to allow the docker container to read all the files - let alone write over them). Defaults in this case becomes: @@ -173,15 +173,15 @@ <!-- Control memory allocatable by docker container with following option: --><!-- <param id="docker_memory">24G</param> --> - <!-- By default Docker will need to runnable by Galaxy using + <!-- By default Docker will need to runnable by Galaxy using password-less sudo - this can be configured by adding the following line to the sudoers file of all compute nodes with docker enabled: - + galaxy ALL = (root) NOPASSWD: SETENV: /usr/bin/docker - The follow option is set to false to disable sudo (docker - must likewise be configured to allow this). + The follow option is set to false to disable sudo (docker + must likewise be configured to allow this). --><!-- <param id="docker_sudo">false</param> --><!-- Following option can be used to tweak sudo command used by @@ -192,6 +192,11 @@ http://docs.docker.io/reference/run/#network-settings --><!-- <param id="docker_net">bridge</param> --> + <!-- By default, a container will live on past its run. By + adding the '--rm' flag to the command line, the container + will be removed automatically after the program is complete. + --> + <!-- <param id="docker_auto_rm">false</param> --><!-- Following command can be used to tweak docker command. --><!-- <param id="docker_cmd">/usr/local/custom_docker/docker</param> --><!-- Following can be used to connect to docke server in different @@ -265,7 +270,7 @@ <!-- Burst out from static destination local_cluster_8_core to static destination shared_cluster_8_core when there are about 50 Galaxy jobs assigned to any of the local_cluster_XXX - destinations (either running or queued). If there are fewer + destinations (either running or queued). If there are fewer than 50 jobs, just use local_cluster_8_core destination. Uncomment job_state parameter to make this bursting happen when @@ -294,8 +299,8 @@ configuration. --><param id="private_token">123456789changeme</param><!-- Uncomment the following statement to disable file staging (e.g. - if there is a shared file system between Galaxy and the Pulsar - server). Alternatively action can be set to 'copy' - to replace + if there is a shared file system between Galaxy and the Pulsar + server). Alternatively action can be set to 'copy' - to replace http transfers with file system copies, 'remote_transfer' to cause the Pulsar to initiate HTTP transfers instead of Galaxy, or 'remote_copy' to cause Pulsar to initiate file system copies. @@ -337,7 +342,7 @@ instead. This may be required if remote host is Windows machine but probably not otherwise. --> - <!-- <param id="rewrite_parameters">false</params> --> + <!-- <param id="rewrite_parameters">false</params> --></destination><destination id="pulsar_mq_dest" runner="amqp_pulsar" ><!-- The RESTful Pulsar client sends a request to Pulsar diff -r 37cf5505992bcccfc54f133d04b857076e7164ac -r d252ac015734d6e382ff07a0497a84ac575059e2 lib/galaxy/tools/deps/containers.py --- a/lib/galaxy/tools/deps/containers.py +++ b/lib/galaxy/tools/deps/containers.py @@ -208,6 +208,7 @@ env_directives=env_directives, working_directory=working_directory, net=prop("net", "none"), # By default, docker instance has networking disabled + auto_rm=prop("auto_rm", docker_util.DEFAULT_AUTO_REMOVE), **docker_host_props ) return "%s\n%s" % (cache_command, run_command) diff -r 37cf5505992bcccfc54f133d04b857076e7164ac -r d252ac015734d6e382ff07a0497a84ac575059e2 lib/galaxy/tools/deps/docker_util.py --- a/lib/galaxy/tools/deps/docker_util.py +++ b/lib/galaxy/tools/deps/docker_util.py @@ -8,6 +8,7 @@ DEFAULT_NET = None DEFAULT_MEMORY = None DEFAULT_VOLUMES_FROM = None +DEFAULT_AUTO_REMOVE = True class DockerVolume(object): @@ -82,6 +83,7 @@ docker_cmd=DEFAULT_DOCKER_COMMAND, sudo=DEFAULT_SUDO, sudo_cmd=DEFAULT_SUDO_COMMAND, + auto_rm=DEFAULT_AUTO_REMOVE, host=DEFAULT_HOST, ): command_parts = __docker_prefix(docker_cmd, sudo, sudo_cmd, host) @@ -100,6 +102,8 @@ command_parts.extend(["-w", working_directory]) if net: command_parts.extend(["--net", net]) + if auto_rm: + command_parts.append("--rm") full_image = image if tag: full_image = "%s:%s" % (full_image, tag) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.