commit/galaxy-central: jmchilton: Modify Docker set_user option to allow setting a remote user.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/0134276d67f7/ Changeset: 0134276d67f7 User: jmchilton Date: 2014-11-17 17:16:12+00:00 Summary: Modify Docker set_user option to allow setting a remote user. Now is disabled by setting this to the empty string instead of false. Add flexibility allows working around the fact that it is not evaluated properly for Pulsar by setting this to be the remote pulsar user :(. Longer term the default option should be the remote user on the worker node instead of the Galaxy user. I don't believe this feature has been in stable so I am not preserving backward compatiblity. Affected #: 3 files diff -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 -r 0134276d67f7a70d5e7afb7e876362c557044f86 config/job_conf.xml.sample_advanced --- a/config/job_conf.xml.sample_advanced +++ b/config/job_conf.xml.sample_advanced @@ -199,7 +199,11 @@ will be removed automatically after the program is complete. --><!-- <param id="docker_auto_rm">true</param> --> - <!-- <param id="docker_set_user">true</param> --> + <!-- Override which user to launch Docker container as - defaults to + Galaxy's user id. For remote job execution (e.g. Pulsar) set to + remote job user. Leave empty to not use the -u argument with + Docker. --> + <!-- <param id="docker_set_user">$UID</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 diff -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 -r 0134276d67f7a70d5e7afb7e876362c557044f86 lib/galaxy/tools/deps/containers.py --- a/lib/galaxy/tools/deps/containers.py +++ b/lib/galaxy/tools/deps/containers.py @@ -244,7 +244,7 @@ working_directory=working_directory, net=prop("net", "none"), # By default, docker instance has networking disabled auto_rm=asbool(prop("auto_rm", docker_util.DEFAULT_AUTO_REMOVE)), - set_user=asbool(prop("set_user", docker_util.DEFAULT_SET_USER)), + set_user=prop("set_user", docker_util.DEFAULT_SET_USER), **docker_host_props ) return "%s\n%s" % (cache_command, run_command) diff -r a1aa1dbc8cb6249b4ca39f0e4cda500abcafae82 -r 0134276d67f7a70d5e7afb7e876362c557044f86 lib/galaxy/tools/deps/docker_util.py --- a/lib/galaxy/tools/deps/docker_util.py +++ b/lib/galaxy/tools/deps/docker_util.py @@ -10,7 +10,7 @@ DEFAULT_MEMORY = None DEFAULT_VOLUMES_FROM = None DEFAULT_AUTO_REMOVE = True -DEFAULT_SET_USER = True +DEFAULT_SET_USER = "$UID" class DockerVolume(object): @@ -149,7 +149,10 @@ if auto_rm: command_parts.append("--rm") if set_user: - command_parts.extend(["-u", str(os.geteuid())]) + user = set_user + if set_user == DEFAULT_SET_USER: + user = str(os.geteuid()) + command_parts.extend(["-u", user]) 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.
participants (1)
-
commits-noreply@bitbucket.org