1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00

Rollback to Docker CLI

This commit is contained in:
Bradley Schofield 2021-11-22 09:27:08 +00:00
parent 40d1d1b445
commit a0c841d13f
3 changed files with 14 additions and 8 deletions

View file

@ -19,7 +19,7 @@ ENV DEBUG=$DEBUG
ENV PHP_REDIS_VERSION=5.3.4 \
PHP_MONGODB_VERSION=1.9.1 \
PHP_SWOOLE_VERSION=v4.8.1 \
PHP_SWOOLE_VERSION=v4.8.2 \
PHP_IMAGICK_VERSION=3.5.1 \
PHP_YAML_VERSION=2.2.1 \
PHP_MAXMINDDB_VERSION=v1.10.1

View file

@ -30,14 +30,14 @@ use Utopia\Storage\Storage;
use Swoole\Coroutine as Co;
use Utopia\Cache\Cache;
use Utopia\Database\Query;
use Utopia\Orchestration\Adapter\DockerAPI;
use Utopia\Orchestration\Adapter\DockerCLI;
require_once __DIR__ . '/init.php';
$dockerUser = App::getEnv('DOCKERHUB_PULL_USERNAME', null);
$dockerPass = App::getEnv('DOCKERHUB_PULL_PASSWORD', null);
$dockerEmail = App::getEnv('DOCKERHUB_PULL_EMAIL', null);
$orchestration = new Orchestration(new DockerAPI($dockerUser, $dockerPass));
$orchestration = new Orchestration(new DockerCLI($dockerUser, $dockerPass));
$runtimes = Config::getParam('runtimes');
@ -392,6 +392,10 @@ function runBuildStage(string $tagID, Document $function, string $projectID, Dat
]
);
if (empty($id)) {
throw new Exception('Failed to start build container');
}
// Extract user code into build container
$untarStdout = '';
$untarStderr = '';
@ -519,8 +523,6 @@ function runBuildStage(string $tagID, Document $function, string $projectID, Dat
// also remove the container if it exists
if ($id) {
$orchestration->remove($id, true);
} else {
$id = ''
}
}
@ -655,6 +657,10 @@ function createRuntimeServer(string $functionId, string $projectId, Document $ta
mountFolder: $tagPathTargetDir,
);
if (empty($id)) {
throw new Exception('Failed to create container');
}
// Add to network
$orchestration->networkConnect($container, 'appwrite_runtimes');
@ -861,7 +867,7 @@ function execute(string $trigger, string $projectId, string $executionId, string
'Content-Type: application/json',
'Content-Length: ' . \strlen($body),
'x-internal-challenge: ' . $key,
'host: ' . null
'host: null'
]);
$executorResponse = \curl_exec($ch);

View file

@ -39,7 +39,7 @@ services:
build:
context: .
args:
- DEBUG=true
- DEBUG=false
- TESTING=true
- VERSION=dev
ports:
@ -352,7 +352,7 @@ services:
build:
context: .
args:
- DEBUG=true
- DEBUG=false
- TESTING=true
- VERSION=dev
networks: