-
Notifications
You must be signed in to change notification settings - Fork 4
refactor: network manager #210
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
Conversation
ac7a95f to
17f156a
Compare
17f156a to
9427aad
Compare
| export COMPOSE_INTERACTIVE_NO_CLI | ||
| export DOCKER_BUILDKIT=1 | ||
| export COMPOSE_DOCKER_CLI_BUILD=1 | ||
| export BUILDKIT_PROGRESS=plain |
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.
These are modern defaults, can remove
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.
nicee
| ); | ||
|
|
||
| Http::get('/v1/health') | ||
| ->groups(['api']) |
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.
remove auth
| /* Create desired networks if they don't exist */ | ||
| $networks = explode(',', System::getEnv('OPR_EXECUTOR_NETWORK') ?: 'openruntimes-runtimes'); | ||
| $runner = new Docker($orchestration, new Runtimes(), $networks); | ||
| $networkManager = new NetworkManager($orchestration, $networks); |
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.
Key change: create networks and connect executor container outside of the 'Docker' runner. This achieves two things:
- Simplifies the Docker god class
- Prepares us for Coroutines, where each coroutine needs it's own instance of Docker class. If we don't we will attempt to create networks every request
| try { | ||
| $this->orchestration->networkConnect($container->getName(), $network); | ||
| } catch (\Throwable) { | ||
| // TODO: Orchestration library should throw a distinct exception for "already connected" |
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.
:(
we need better exceptions here on orchestration library. not much else i could do
| * Remove residual runtimes and networks | ||
| */ | ||
| Console::info('Removing orphan runtimes and networks...'); | ||
| $this->cleanUp(); |
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.
I don't think we need to cleanup on restart, sounds dangerous. We should do what k8s runner does instead: resume managing anything labeled with right tag
| Process::signal(SIGINT, fn () => $this->cleanUp()); | ||
| Process::signal(SIGQUIT, fn () => $this->cleanUp()); | ||
| Process::signal(SIGKILL, fn () => $this->cleanUp()); | ||
| Process::signal(SIGTERM, fn () => $this->cleanUp()); |
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.
need to revisit this, not sure we need to handle all of these
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 we add a comment here to not forget about the revisit?
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true |
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 is nice, should we have it for other repos too?
No description provided.