Skip to content

Conversation

@loks0n
Copy link
Member

@loks0n loks0n commented Dec 28, 2025

No description provided.

@loks0n loks0n force-pushed the refactor-network-manager branch 2 times, most recently from ac7a95f to 17f156a Compare December 28, 2025 18:54
@loks0n loks0n force-pushed the refactor-network-manager branch from 17f156a to 9427aad Compare December 28, 2025 19:03
@loks0n loks0n requested a review from ChiragAgg5k December 28, 2025 19:06
Comment on lines -36 to -39
export COMPOSE_INTERACTIVE_NO_CLI
export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1
export BUILDKIT_PROGRESS=plain
Copy link
Member Author

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

Copy link
Member

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'])
Copy link
Member Author

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);
Copy link
Member Author

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:

  1. Simplifies the Docker god class
  2. 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"
Copy link
Member Author

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();
Copy link
Member Author

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

Comment on lines +154 to +157
Process::signal(SIGINT, fn () => $this->cleanUp());
Process::signal(SIGQUIT, fn () => $this->cleanUp());
Process::signal(SIGKILL, fn () => $this->cleanUp());
Process::signal(SIGTERM, fn () => $this->cleanUp());
Copy link
Member Author

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

Copy link
Member

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
Copy link
Member

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?

@loks0n loks0n merged commit 53fc97f into main Dec 29, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants