Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Docker Engine swarm mode for Interactive Environments #3666

Merged
merged 1 commit into from Mar 3, 2017

Conversation

Projects
None yet
3 participants
@natefoo
Copy link
Member

commented Feb 24, 2017

Assuming you have already set up a swarm, enabling swarm_mode in the GIE config will instruct Galaxy to run GIE containers as Docker services rather than with docker run. Note that these services are not cleaned up by Galaxy itself. Rather than creating a thread to clean them up in the background, I recommend we suggest users to set up a cron job e.g.:

for service_id in $(docker service ls -q); do docker service ps --no-trunc $service_id | tail -1 | awk '{print $5}' | grep -q '^Shutdown$' && docker service rm $service_id; done

Note this indiscriminately removes all stopped services on the swarm - perhaps not ideal if the swarm is shared with non-GIE jobs.

If this PR is meeting with approval I'll update the GIE admin documentation and other plugin samples accordingly.

xref original Docker swarm (predecessor to swarm mode) support: #2386

@natefoo natefoo added this to the 17.05 milestone Feb 24, 2017

@natefoo natefoo changed the title Support Docker Engine swarm mode Support Docker Engine swarm mode for Interactive Environments Feb 24, 2017

@bgruening
Copy link
Member

left a comment

@natefoo can you add an example cron job to ./cron as part of the documentation?

if not self.attr.swarm_mode:
command = command.format(docker_args='run {command_inject} {environment} -d -P {import_volume_str} {volume_str} {image}')
# --sig-proxy is not valid in the swarm mode context
if '--sig-proxy=' not in self.attr.command_inject:

This comment has been minimized.

Copy link
@bgruening

bgruening Feb 24, 2017

Member

You are not comparing here command_inject is this correct? In line 252 you not passing in command_inject. So I'm not sure this is used.

This comment has been minimized.

Copy link
@natefoo

natefoo Feb 27, 2017

Author Member

Good catch, thanks.

@natefoo

This comment has been minimized.

Copy link
Member Author

commented Feb 27, 2017

Okay, all done with updates.

@jmchilton

This comment has been minimized.

Copy link
Member

commented Mar 3, 2017

@natefoo I can merge this but I want to give you the option of rebasing it down to one commit before I do so you can apply it back to the usegalaxy branch as a clean single cherry-pick.

@natefoo natefoo force-pushed the natefoo:docker-swarm-mode branch from c9c61cf to 293726c Mar 3, 2017

@natefoo

This comment has been minimized.

Copy link
Member Author

commented Mar 3, 2017

Good idea, thanks!

@jmchilton jmchilton merged commit 4aec70c into galaxyproject:dev Mar 3, 2017

5 checks passed

api test Build finished. 263 tests run, 0 skipped, 0 failed.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
framework test Build finished. 140 tests run, 0 skipped, 0 failed.
Details
integration test Build finished. 24 tests run, 0 skipped, 0 failed.
Details
toolshed test Build finished. 580 tests run, 0 skipped, 0 failed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.