Fix tests
This commit is contained in:
parent
80b49452f4
commit
d275fa0111
16
.env
16
.env
|
@ -74,17 +74,17 @@ _APP_USAGE_STATS=enabled
|
|||
_APP_LOGGING_PROVIDER=
|
||||
_APP_LOGGING_CONFIG=
|
||||
_APP_EXECUTOR_SECRET=your-secret-key
|
||||
_APP_EXECUTOR_HOST=http://proxy1/v1
|
||||
_APP_FUNCTIONS_RUNTIMES=php-8.0
|
||||
_APP_EXECUTOR_HOST=http://exc1/v1
|
||||
_APP_FUNCTIONS_RUNTIMES=
|
||||
|
||||
OPR_EXECUTOR_CONNECTION_STORAGE=file://localhost
|
||||
OPR_EXECUTOR_INACTIVE_TRESHOLD=60
|
||||
OPR_EXECUTOR_INACTIVE_TRESHOLD=600
|
||||
OPR_EXECUTOR_NETWORK=openruntimes-runtimes
|
||||
OPR_EXECUTOR_DOCKER_HUB_USERNAME=
|
||||
OPR_EXECUTOR_DOCKER_HUB_PASSWORD=
|
||||
|
||||
OPR_PROXY_ALGORITHM=round-robin
|
||||
OPR_PROXY_EXECUTORS=exc1
|
||||
OPR_PROXY_HEALTHCHECK=enabled
|
||||
OPR_PROXY_HEALTHCHECK_INTERVAL=5000
|
||||
OPR_PROXY_EXECUTOR_SECRET=executor-secret-key
|
||||
# OPR_PROXY_ALGORITHM=round-robin
|
||||
# OPR_PROXY_EXECUTORS=exc1
|
||||
# OPR_PROXY_HEALTHCHECK=enabled
|
||||
# OPR_PROXY_HEALTHCHECK_INTERVAL=5000
|
||||
# OPR_PROXY_EXECUTOR_SECRET=your-secret-key
|
|
@ -1153,7 +1153,6 @@ App::post('/v1/functions/:functionId/executions')
|
|||
payload: $data,
|
||||
variables: $vars,
|
||||
timeout: $function->getAttribute('timeout', 0),
|
||||
|
||||
image: $runtime['image'],
|
||||
source: $build->getAttribute('outputPath', ''),
|
||||
entrypoint: $deployment->getAttribute('entrypoint', ''),
|
||||
|
|
|
@ -159,7 +159,6 @@ class BuildsV1 extends Worker
|
|||
source: $source,
|
||||
image: $runtime['image'],
|
||||
remove: true,
|
||||
|
||||
entrypoint: $deployment->getAttribute('entrypoint'),
|
||||
workdir: '/usr/code',
|
||||
destination: APP_STORAGE_BUILDS . "/app-{$project->getId()}",
|
||||
|
|
|
@ -292,7 +292,6 @@ class FunctionsV1 extends Worker
|
|||
payload: $vars['APPWRITE_FUNCTION_DATA'] ?? '',
|
||||
variables: $vars,
|
||||
timeout: $function->getAttribute('timeout', 0),
|
||||
|
||||
image: $runtime['image'],
|
||||
source: $build->getAttribute('outputPath', ''),
|
||||
entrypoint: $deployment->getAttribute('entrypoint', ''),
|
||||
|
|
|
@ -633,8 +633,9 @@ services:
|
|||
stop_signal: SIGINT
|
||||
image: openruntimes/executor:0.1.0
|
||||
networks:
|
||||
- appwrite # Remove this when using OPR Proxy
|
||||
# - openruntimes-executors
|
||||
- openruntimes-runtimes
|
||||
- openruntimes-executors
|
||||
ports:
|
||||
- 9900:80
|
||||
volumes:
|
||||
|
@ -650,28 +651,28 @@ services:
|
|||
- OPR_EXECUTOR_DOCKER_HUB_PASSWORD
|
||||
- OPR_EXECUTOR_ENV=$_APP_ENV
|
||||
- OPR_EXECUTOR_RUNTIMES=$_APP_FUNCTIONS_RUNTIMES
|
||||
- OPR_EXECUTOR_SECRET=$OPR_PROXY_EXECUTOR_SECRET
|
||||
- OPR_EXECUTOR_SECRET=$_APP_EXECUTOR_SECRET # If using OPR proxy, use OPR_PROXY_EXECUTOR_SECRET instead
|
||||
- OPR_EXECUTOR_LOGGING_PROVIDER=$_APP_LOGGING_PROVIDER
|
||||
- OPR_EXECUTOR_LOGGING_CONFIG=$_APP_LOGGING_CONFIG
|
||||
|
||||
openruntimes-proxy:
|
||||
container_name: openruntimes-proxy
|
||||
hostname: proxy1
|
||||
<<: *x-logging
|
||||
image: openruntimes/proxy:0.3.0
|
||||
networks:
|
||||
- appwrite
|
||||
- openruntimes-executors
|
||||
environment:
|
||||
- OPR_PROXY_ALGORITHM
|
||||
- OPR_PROXY_EXECUTORS
|
||||
- OPR_PROXY_HEALTHCHECK
|
||||
- OPR_PROXY_HEALTHCHECK_INTERVAL
|
||||
- OPR_PROXY_EXECUTOR_SECRET
|
||||
- OPR_PROXY_ENV=$_APP_ENV
|
||||
- OPR_PROXY_SECRET=$_APP_EXECUTOR_SECRET
|
||||
- OPR_PROXY_LOGGING_PROVIDER=$_APP_LOGGING_PROVIDER
|
||||
- OPR_PROXY_LOGGING_CONFIG=$_APP_LOGGING_CONFIG
|
||||
# openruntimes-proxy:
|
||||
# container_name: openruntimes-proxy
|
||||
# hostname: proxy1
|
||||
# <<: *x-logging
|
||||
# image: openruntimes/proxy:0.3.0
|
||||
# networks:
|
||||
# - appwrite
|
||||
# - openruntimes-executors
|
||||
# environment:
|
||||
# - OPR_PROXY_ALGORITHM
|
||||
# - OPR_PROXY_EXECUTORS
|
||||
# - OPR_PROXY_HEALTHCHECK
|
||||
# - OPR_PROXY_HEALTHCHECK_INTERVAL
|
||||
# - OPR_PROXY_EXECUTOR_SECRET
|
||||
# - OPR_PROXY_ENV=$_APP_ENV
|
||||
# - OPR_PROXY_SECRET=$_APP_EXECUTOR_SECRET
|
||||
# - OPR_PROXY_LOGGING_PROVIDER=$_APP_LOGGING_PROVIDER
|
||||
# - OPR_PROXY_LOGGING_CONFIG=$_APP_LOGGING_CONFIG
|
||||
|
||||
mariadb:
|
||||
image: mariadb:10.7 # fix issues when upgrading using: mysql_upgrade -u root -p
|
||||
|
|
|
@ -26,6 +26,10 @@ class Executor
|
|||
'content-type' => '',
|
||||
];
|
||||
|
||||
protected int $cpus = 2;
|
||||
|
||||
protected int $memory = 512;
|
||||
|
||||
public function __construct(string $endpoint)
|
||||
{
|
||||
if (!filter_var($endpoint, FILTER_VALIDATE_URL)) {
|
||||
|
@ -77,9 +81,8 @@ class Executor
|
|||
'variables' => $variables,
|
||||
'remove' => $remove,
|
||||
'commands' => $commands,
|
||||
'timeout' => 600,
|
||||
'cpus' => 1,
|
||||
'memory' => 128,
|
||||
'cpus' => $this->cpus,
|
||||
'memory' => $this->memory,
|
||||
];
|
||||
|
||||
$timeout = (int) App::getEnv('_APP_FUNCTIONS_BUILD_TIMEOUT', 900);
|
||||
|
@ -114,7 +117,6 @@ class Executor
|
|||
string $payload,
|
||||
array $variables,
|
||||
int $timeout,
|
||||
|
||||
string $image,
|
||||
string $source,
|
||||
string $entrypoint,
|
||||
|
@ -134,8 +136,8 @@ class Executor
|
|||
'image' => $image,
|
||||
'source' => $source,
|
||||
'entrypoint' => $entrypoint,
|
||||
'cpus' => 1,
|
||||
'memory' => 128,
|
||||
'cpus' => $this->cpus,
|
||||
'memory' => $this->memory,
|
||||
];
|
||||
|
||||
$timeout = (int) App::getEnv('_APP_FUNCTIONS_BUILD_TIMEOUT', 900);
|
||||
|
|
Loading…
Reference in a new issue