From abb7c049945bed21422f3da38d674fca82aeb9ba Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Wed, 15 Jul 2020 16:34:28 +0300 Subject: [PATCH] Switched to alpine images --- app/config/environments.php | 22 +++++++++++----------- app/workers/functions.php | 34 +++++++++++++++++++--------------- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/app/config/environments.php b/app/config/environments.php index 49e398a3da..b9ce74d6e0 100644 --- a/app/config/environments.php +++ b/app/config/environments.php @@ -3,32 +3,32 @@ return [ 'node-14' => [ 'name' => 'Node.js', - 'version' => '14.0', - 'image' => 'node:14', + 'version' => '14.5', + 'image' => 'node:14.5-alpine', 'logo' => 'node.png', ], 'php-7.4' => [ 'name' => 'PHP', 'version' => '7.4', - 'image' => 'php:7.4-cli', + 'image' => 'php:7.4-cli-alpine', 'logo' => 'php.png', ], 'ruby-2.7' => [ 'name' => 'Ruby', 'version' => '2.7', - 'image' => 'ruby:2.7', + 'image' => 'ruby:2.7-alpine', 'logo' => 'ruby.png', ], - 'dart-2.8' => [ - 'name' => 'Dart', - 'version' => '2.8', - 'image' => 'google/dart:2.8', - 'logo' => 'dart.png', - ], + // 'dart-2.8' => [ + // 'name' => 'Dart', + // 'version' => '2.8', + // 'image' => 'google/dart:2.8', + // 'logo' => 'dart.png', + // ], 'python-3.8' => [ 'name' => 'Python', 'version' => '3.8', - 'image' => 'python:3.8', + 'image' => 'python:3.8-alpine', 'logo' => 'python.png', ], ]; \ No newline at end of file diff --git a/app/workers/functions.php b/app/workers/functions.php index 412d9cd4bb..58e500c775 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -13,22 +13,26 @@ $environments = Config::getParam('environments'); $warmupStart = microtime(true); -foreach($environments as $environment) { // Warmup: make sure images are ready to run fast 🚀 - $stdout = ''; - $stderr = ''; - - Console::info('Warming up '.$environment['name'].' environment'); - - Console::execute('docker pull '.$environment['image'], null, $stdout, $stderr); - - if(!empty($stdout)) { - Console::log($stdout); +Co\run(function() use ($environments) { + foreach($environments as $environment) { // Warmup: make sure images are ready to run fast 🚀 + go(function() use ($environment) { + $stdout = ''; + $stderr = ''; + + Console::info('Warming up '.$environment['name'].' environment'); + + Console::execute('docker pull '.$environment['image'], null, $stdout, $stderr); + + if(!empty($stdout)) { + Console::log($stdout); + } + + if(!empty($stderr)) { + Console::error($stderr); + } + }); } - - if(!empty($stderr)) { - Console::error($stderr); - } -} +}); $warmupEnd = microtime(true); $warmupTime = $warmupEnd - $warmupStart;