1
0
Fork 0
mirror of synced 2024-10-02 10:16:27 +13:00

Fix executor missing runtime

This commit is contained in:
Matej Bačo 2023-06-06 15:47:25 +02:00
parent 084c50fc97
commit 5f87ef3074
3 changed files with 5 additions and 5 deletions

View file

@ -1402,7 +1402,7 @@ App::post('/v1/functions/:functionId/executions')
/** Execute function */
$executor = new Executor(App::getEnv('_APP_EXECUTOR_HOST'));
try {
$command = 'npm start';
$command = 'npm start'; // TODO: Custom for each runtime
$executionResponse = $executor->createExecution(
projectId: $project->getId(),
deploymentId: $deployment->getId(),
@ -1416,7 +1416,7 @@ App::post('/v1/functions/:functionId/executions')
path: $path,
method: $method,
headers: $headers,
commands: [
startCommands: [
'sh', '-c',
'cp /tmp/code.tar.gz /mnt/code/code.tar.gz && nohup helpers/start.sh "' . $command . '" &>/dev/null &'
]

View file

@ -276,7 +276,7 @@ class BuildsV1 extends Worker
entrypoint: $deployment->getAttribute('entrypoint'),
destination: APP_STORAGE_BUILDS . "/app-{$project->getId()}",
variables: $vars,
commands: [
startCommands: [
'sh', '-c',
'tar -zxf /tmp/code.tar.gz -C /mnt/code && helpers/build.sh "' . $command . '"'
],

View file

@ -167,7 +167,7 @@ Server::setResource('execute', function () {
/** Execute function */
try {
$command = 'npm start';
$command = 'npm start'; // TODO: Custom for each runtime
$client = new Executor(App::getEnv('_APP_EXECUTOR_HOST'));
$executionResponse = $client->createExecution(
projectId: $project->getId(),
@ -182,7 +182,7 @@ Server::setResource('execute', function () {
path: $path,
method: $method,
headers: $headers,
commands: [
startCommands: [
'sh', '-c',
'cp /tmp/code.tar.gz /mnt/code/code.tar.gz && nohup helpers/start.sh "' . $command . '" &>/dev/null &'
]