|
7 | 7 | use OpenRuntimes\Executor\Runner\Repository\Runtimes; |
8 | 8 | use OpenRuntimes\Executor\Runner\Adapter; |
9 | 9 | use Utopia\DI\Container; |
| 10 | +use Utopia\DI\Dependency; |
10 | 11 | use Utopia\Orchestration\Adapter\DockerAPI; |
11 | 12 | use Utopia\Orchestration\Orchestration; |
12 | 13 | use Utopia\System\System; |
|
23 | 24 |
|
24 | 25 | $registry->set('runtimes', fn (): \OpenRuntimes\Executor\Runner\Repository\Runtimes => new Runtimes()); |
25 | 26 |
|
26 | | -$container->setResource('runtimes', fn () => $registry->get('runtimes')); |
| 27 | +$container->set('runtimes', new Dependency([], fn (): Runtimes => $registry->get('runtimes'))); |
27 | 28 |
|
28 | | -$container->setResource('orchestration', fn (): Orchestration => new Orchestration(new DockerAPI( |
| 29 | +$container->set('orchestration', new Dependency([], fn (): Orchestration => new Orchestration(new DockerAPI( |
29 | 30 | System::getEnv('OPR_EXECUTOR_DOCKER_HUB_USERNAME', ''), |
30 | 31 | System::getEnv('OPR_EXECUTOR_DOCKER_HUB_PASSWORD', '') |
31 | | -))); |
| 32 | +)))); |
32 | 33 |
|
33 | | -$container->setResource('network', fn (Orchestration $orchestration): Network => new Network($orchestration), ['orchestration']); |
| 34 | +$container->set('network', new Dependency(['orchestration'], fn (Orchestration $orchestration): Network => new Network($orchestration))); |
34 | 35 |
|
35 | | -$container->setResource('imagePuller', fn (Orchestration $orchestration): ImagePuller => new ImagePuller($orchestration), ['orchestration']); |
| 36 | +$container->set('imagePuller', new Dependency(['orchestration'], fn (Orchestration $orchestration): ImagePuller => new ImagePuller($orchestration))); |
36 | 37 |
|
37 | | -$container->setResource('maintenance', fn (Orchestration $orchestration, Runtimes $runtimes): Maintenance => new Maintenance($orchestration, $runtimes), ['orchestration', 'runtimes']); |
| 38 | +$container->set('maintenance', new Dependency(['orchestration', 'runtimes'], fn (Orchestration $orchestration, Runtimes $runtimes): Maintenance => new Maintenance($orchestration, $runtimes))); |
38 | 39 |
|
39 | | -$container->setResource('runner', fn (Orchestration $orchestration, Runtimes $runtimes, array $networks): Adapter => new Docker($orchestration, $runtimes, $networks), ['orchestration', 'runtimes', 'networks']); |
| 40 | +$container->set('runner', new Dependency(['orchestration', 'runtimes', 'networks'], fn (Orchestration $orchestration, Runtimes $runtimes, array $networks): Adapter => new Docker($orchestration, $runtimes, $networks))); |
0 commit comments