Skip to content

Commit f92e51b

Browse files
committed
changes
1 parent 499eea0 commit f92e51b

3 files changed

Lines changed: 37 additions & 20 deletions

File tree

app/http.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Swoole\Runtime;
1111
use Utopia\Console;
1212
use Utopia\DI\Container;
13+
use Utopia\DI\Dependency;
1314
use Utopia\Http\Http;
1415
use Utopia\Http\Response;
1516
use Utopia\Http\Adapter\Swoole\Server;
@@ -46,7 +47,7 @@
4647
explode(',', System::getEnv('OPR_EXECUTOR_NETWORK') ?: 'openruntimes-runtimes'),
4748
$selfContainer->getName()
4849
);
49-
$container->setResource('networks', fn (): array => $network->getAvailable());
50+
$container->set('networks', new Dependency([], fn (): array => $network->getAvailable()));
5051

5152
/* Pull images */
5253
$imagePuller->pull(explode(',', System::getEnv('OPR_EXECUTOR_IMAGES') ?: ''));

app/init.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use OpenRuntimes\Executor\Runner\Repository\Runtimes;
88
use OpenRuntimes\Executor\Runner\Adapter;
99
use Utopia\DI\Container;
10+
use Utopia\DI\Dependency;
1011
use Utopia\Orchestration\Adapter\DockerAPI;
1112
use Utopia\Orchestration\Orchestration;
1213
use Utopia\System\System;
@@ -23,17 +24,17 @@
2324

2425
$registry->set('runtimes', fn (): \OpenRuntimes\Executor\Runner\Repository\Runtimes => new Runtimes());
2526

26-
$container->setResource('runtimes', fn () => $registry->get('runtimes'));
27+
$container->set('runtimes', new Dependency([], fn (): Runtimes => $registry->get('runtimes')));
2728

28-
$container->setResource('orchestration', fn (): Orchestration => new Orchestration(new DockerAPI(
29+
$container->set('orchestration', new Dependency([], fn (): Orchestration => new Orchestration(new DockerAPI(
2930
System::getEnv('OPR_EXECUTOR_DOCKER_HUB_USERNAME', ''),
3031
System::getEnv('OPR_EXECUTOR_DOCKER_HUB_PASSWORD', '')
31-
)));
32+
))));
3233

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)));
3435

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)));
3637

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)));
3839

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)));

composer.lock

Lines changed: 27 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)