-
Notifications
You must be signed in to change notification settings - Fork 158
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
Show attached runs in emp ps. #911
Conversation
return instances, err | ||
} | ||
|
||
attachedInstances, err := s.dockerScheduler.InstancesFromAttachedRuns(ctx, app) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should get kicked off in a goroutine.
56688b0
to
82e128d
Compare
I haven't messed w/ docker swarm, but is there anyway we could run docker swarm's API on both empire hosts, and have them controlling the same docker instances? Then we could just point the Empire daemon at the local swarm, and still have a separate set of instances to do this on? |
@@ -1,6 +1,171 @@ | |||
// Package docker implements the Scheduler interface backed by the Docker API. | |||
// This implementation is not recommended for production use, but can be used in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be updated?
@phobologic yep, that would work well too. Although, I think our production recommendation should be to have emp run's be off of the host that Empire runs in for better security. |
I think probably the easiest thing to do for most people would be to run a single EC2 host dedicated to I think for now, we should make this feature experimental and only enable it with a flag. I'm sure for some people, the extra complexity in getting Docker over TCP securely isn't worth it. |
We should also implement the |
This should be good to go. I went ahead and feature flagged it with an |
containers, err := s.docker.ListContainers(docker.ListContainersOptions{ | ||
Filters: map[string][]string{ | ||
"label": []string{ | ||
fmt.Sprintf("%s", runLabel), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be fmt.Sprintf("%s=%s", runLabel, "attached")
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch! I'll update.
👍 |
Closes #905
This allows us to easily show attached runs in the output of emp ps:
This is implemented by using ListContainers to find any containers tagged with
attached-run
. Obviously this won't work consistently if you have more than 1 instance of Empire pointed at multiple Docker daemons.My suggestion is that we update the docs to encourage people to point Empire at a single Docker daemon (either a single physical Docker daemon, or a Docker swarm). There's other benefits to doing this:
docker pulls
's when deploying will generally be faster, since it will hit cache more frequently with a single Docker daemon.emp run
's have the same permissions as Empire to create infrastructure).emp run
's gives you more control to ensure that no runs are in progress.TODO