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

Using both swarm and docker #74

Open
podviaznikov opened this issue Apr 25, 2016 · 1 comment
Open

Using both swarm and docker #74

podviaznikov opened this issue Apr 25, 2016 · 1 comment
Labels

Comments

@podviaznikov
Copy link
Member

podviaznikov commented Apr 25, 2016

I'm looking into container.remove and container.delete tasks (https://github.com/CodeNow/khronos/blob/master/lib/tasks/containers/remove.js#L37).
They bot have following logic:

  1. Check if dock exists in Swarm
  2. Talk directly to docker daemon using dockerHost to perform operation.

I'm wondering if we can just talk to Swarm all the time and also skip dockExist check. In the current scenario we make 2 calls: 1 to swarm and 1 to docker daemon. In the new scenario we will have 1 call to swarm.

Benefits:

  1. Less calls (1 < 2)
  2. Jobs become more lightweight since they will not have job.dockerHost property
  3. Jobs can be reused by other systems. E.x. API would be able to enqueue a job for container removal/deletion without specifying dockerHost.

Context:

I'm thinking about removing this piece of code from API (https://github.com/CodeNow/api/blob/master/lib/workers/instance.container.delete.js#L68).
Theoretically API can either enqueue khronos.container.remove job or emit a new even that khronos can pick it up (I think I like second option better but open for your comments)

@anandkumarpatel
Copy link
Contributor

+1 for moving to swarm. Info is a much more heavy option then delete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants