Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"utopia-php/dsn": "0.2.*",
"utopia-php/http": "2.0.0-rc18@RC",
"utopia-php/orchestration": "^0.19.2",
"utopia-php/storage": "^3.1",
"utopia-php/storage": "^4.0",
"utopia-php/system": "0.10.*"
},
"require-dev": {
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions src/Executor/Runner/Docker.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public function createRuntime(
/**
* Copy code files from source to a temporary location on the executor
*/
if ($source !== '' && $source !== '0' && !$sourceDevice->transfer($source, $tmpSource, $localDevice)) {
if ($source !== '' && $source !== '0' && !$sourceDevice->copy($source, $tmpSource, $localDevice)) {
throw new \Exception('Failed to copy source code to temporary directory');
;
}
Expand Down Expand Up @@ -448,7 +448,7 @@ public function createRuntime(
$destinationDevice = StorageFactory::getDevice($destination, System::getEnv('OPR_EXECUTOR_CONNECTION_STORAGE'));
$path = $destinationDevice->getPath(\uniqid() . '.' . \pathinfo($tmpBuild, PATHINFO_EXTENSION));

if (!$localDevice->transfer($tmpBuild, $path, $destinationDevice)) {
if (!$localDevice->copy($tmpBuild, $path, $destinationDevice)) {
throw new \Exception('Failed to move built code to storage');
};

Expand Down Expand Up @@ -612,7 +612,7 @@ private function restoreBuildCacheArtifact(string $cacheKey, string $tmpCache, L
return;
}

if (!$cacheDevice->transfer($artifact, $tmpCache . '/stores.sqfs', $localDevice)) {
if (!$cacheDevice->copy($artifact, $tmpCache . '/stores.sqfs', $localDevice)) {
throw new \Exception('Failed to restore build cache artifact');
}
}
Expand All @@ -628,7 +628,7 @@ private function storeBuildCacheArtifact(string $cacheKey, string $tmpCache, Loc
$cacheDevice = $this->getBuildCacheDevice();
$destinationArtifact = $this->getBuildCacheArtifactPath($cacheDevice, $cacheKey);

if (!$localDevice->transfer($artifact, $destinationArtifact, $cacheDevice)) {
if (!$localDevice->copy($artifact, $destinationArtifact, $cacheDevice)) {
throw new \Exception('Failed to store build cache artifact');
}
}
Expand Down Expand Up @@ -991,10 +991,10 @@ public function createExecution(
if ($logDevice->exists($logFile)) {
if ($logDevice->getFileSize($logFile) > MAX_LOG_SIZE) {
$maxToRead = MAX_LOG_SIZE;
$logs = $logDevice->read($logFile, 0, $maxToRead);
$logs = (string) $logDevice->read($logFile, 0, $maxToRead);
$logs .= "\nLog file has been truncated to " . number_format(MAX_LOG_SIZE / 1048576, 2) . "MB.";
} else {
$logs = $logDevice->read($logFile);
$logs = (string) $logDevice->read($logFile);
}

$logDevice->delete($logFile);
Expand All @@ -1003,10 +1003,10 @@ public function createExecution(
if ($logDevice->exists($errorFile)) {
if ($logDevice->getFileSize($errorFile) > MAX_LOG_SIZE) {
$maxToRead = MAX_LOG_SIZE;
$errors = $logDevice->read($errorFile, 0, $maxToRead);
$errors = (string) $logDevice->read($errorFile, 0, $maxToRead);
$errors .= "\nError file has been truncated to " . number_format(MAX_LOG_SIZE / 1048576, 2) . "MB.";
} else {
$errors = $logDevice->read($errorFile);
$errors = (string) $logDevice->read($errorFile);
}

$logDevice->delete($errorFile);
Expand Down