Move network env var to executor container
This commit is contained in:
parent
06458bccf3
commit
320d4518b7
2 changed files with 2 additions and 8 deletions
|
@ -141,7 +141,6 @@ App::post('/v1/runtimes')
|
|||
->param('vars', [], new Assoc(), 'Environment Variables required for the build')
|
||||
->param('commands', [], new ArrayList(new Text(0)), 'Commands required to build the container')
|
||||
->param('runtime', '', new Text(128), 'Runtime for the cloud function')
|
||||
->param('network', '', new Text(128), 'Network to attach the container to')
|
||||
->param('baseImage', '', new Text(128), 'Base image name of the runtime')
|
||||
->param('entrypoint', '', new Text(256), 'Entrypoint of the code file', true)
|
||||
->param('remove', false, new Boolean(), 'Remove a runtime after execution')
|
||||
|
@ -149,8 +148,7 @@ App::post('/v1/runtimes')
|
|||
->inject('orchestrationPool')
|
||||
->inject('activeRuntimes')
|
||||
->inject('response')
|
||||
->action(function (string $runtimeId, string $source, string $destination, array $vars, array $commands, string $runtime, string $network, string $baseImage, string $entrypoint, bool $remove, string $workdir, $orchestrationPool, $activeRuntimes, Response $response) {
|
||||
|
||||
->action(function (string $runtimeId, string $source, string $destination, array $vars, array $commands, string $runtime, string $baseImage, string $entrypoint, bool $remove, string $workdir, $orchestrationPool, $activeRuntimes, Response $response) {
|
||||
if ($activeRuntimes->exists($runtimeId)) {
|
||||
throw new Exception('Runtime already exists.', 409);
|
||||
}
|
||||
|
@ -235,9 +233,7 @@ App::post('/v1/runtimes')
|
|||
throw new Exception('Failed to create build container', 500);
|
||||
}
|
||||
|
||||
if (!empty($network)) {
|
||||
$orchestration->networkConnect($runtimeId, $network);
|
||||
}
|
||||
$orchestration->networkConnect($runtimeId, App::getEnv('_APP_EXECUTOR_RUNTIME_NETWORK', 'appwrite_runtimes'));
|
||||
|
||||
/**
|
||||
* Execute any commands if they were provided
|
||||
|
|
|
@ -59,7 +59,6 @@ class Executor
|
|||
string $entrypoint = '',
|
||||
string $workdir = '',
|
||||
string $destination = '',
|
||||
string $network = '',
|
||||
array $vars = [],
|
||||
array $commands = []
|
||||
) {
|
||||
|
@ -76,7 +75,6 @@ class Executor
|
|||
'baseImage' => $baseImage,
|
||||
'entrypoint' => $entrypoint,
|
||||
'workdir' => $workdir,
|
||||
'network' => empty($network) ? App::getEnv('_APP_EXECUTOR_RUNTIME_NETWORK', 'appwrite_runtimes') : $network,
|
||||
'vars' => $vars,
|
||||
'remove' => $remove,
|
||||
'commands' => $commands
|
||||
|
|
Loading…
Reference in a new issue