Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e25a8ba
fix(migration): roll back when a migration step exits through EE::err…
mrrobot47 Oct 23, 2026
6746442
fix(migration): recreate global services one at a time behind a readi…
mrrobot47 Oct 23, 2026
5b935df
fix(migration): pull only images that something uses
mrrobot47 Oct 23, 2026
b204545
fix(migration): install docker-compose only when missing or too old, …
mrrobot47 Oct 23, 2026
026461f
fix(db): create the schema of an empty EasyEngine database
mrrobot47 Oct 23, 2026
ee37124
fix(migration): never restore a docker-compose backup from an earlier…
mrrobot47 Oct 23, 2026
a935f0a
fix(migration): accept a password-protected redis and fractional time…
mrrobot47 Oct 23, 2026
498d20e
fix(migration): report a missing migration file instead of a class-no…
mrrobot47 Oct 23, 2026
40e6464
fix(migration): revert only the docker-compose replacement of the ima…
mrrobot47 Oct 23, 2026
8634458
fix(ee): let a migration step capture exits from EE::runcommand()
mrrobot47 Oct 23, 2026
019901b
fix(migration): update docker-compose before recreating global services
mrrobot47 Oct 23, 2026
7b7e265
fix(migration): check the running proxy config first, bound the compo…
mrrobot47 Oct 23, 2026
e495dcf
fix(migration): check the running proxy config before any global serv…
mrrobot47 Oct 23, 2026
853379a
fix(migration): stop and remove first only the global services docker…
mrrobot47 Oct 23, 2026
95b8944
fix(migration): bound the retries of the docker-compose download
mrrobot47 Oct 23, 2026
2b6a4c7
fix(migration): keep the global compose snapshot of an upgrade that d…
mrrobot47 Oct 23, 2026
8aaa57c
fix(migration): roll back the global services an interrupted attempt …
mrrobot47 Oct 23, 2026
73d60d4
fix(migration): read the global compose snapshot with Spyc, which the…
mrrobot47 Oct 23, 2026
ef097e1
fix(migration): recheck global services an interrupted upgrade recreated
mrrobot47 Oct 23, 2026
b0f1190
fix(migration): record the new tag of a stopped global service only o…
mrrobot47 Oct 23, 2026
e49c44a
fix(migration): keep the networks of stopped containers and the globa…
mrrobot47 Oct 23, 2026
e8b6c7a
fix(migration): move disabled sites' compose files to the new images
mrrobot47 Oct 23, 2026
c9d7b35
fix(migration): neither pull nor redo the upgrade for images only sto…
mrrobot47 Oct 23, 2026
8d5107b
fix(migration): keep a disabled site's failed compose update best-eff…
mrrobot47 Oct 23, 2026
6281803
fix(migration): update stale disabled sites on every run, pin the rol…
mrrobot47 Oct 23, 2026
bd7eb47
fix(migration): clear a finished rollback snapshot when no image changed
mrrobot47 Oct 23, 2026
625d170
fix(migration): bound every readiness probe with a timeout inside the…
mrrobot47 Oct 26, 2026
27fc32f
Merge branch 'fix/upgrade-robustness' into fix/migrate-stopped-and-di…
mrrobot47 Oct 26, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

use EE;
use EE\Migration\Base;
use Symfony\Component\Filesystem\Filesystem;

class CheckAndUpdateDockerOne extends Base {

public function __construct() {

parent::__construct();
if ( $this->is_first_execution ) {
$this->skip_this_migration = true;
}
Expand Down Expand Up @@ -48,32 +48,14 @@ public function up() {
}

EE::debug( 'Checking docker-compose version' );
$docker_compose_version = trim( EE::launch( 'docker-compose version --short' )->stdout );
$docker_compose_path = EE::launch( 'command -v docker-compose' )->stdout;
$docker_compose_path = trim( $docker_compose_path );
$docker_compose_backup_path = EE_BACKUP_DIR . '/docker-compose.backup';
$docker_compose_new_path = EE_BACKUP_DIR . '/docker-compose';
$fs = new Filesystem();
if ( ! $fs->exists( EE_BACKUP_DIR ) ) {
$fs->mkdir( EE_BACKUP_DIR );
}
$fs->copy( $docker_compose_path, $docker_compose_backup_path );

if ( version_compare( '1.29.2', $docker_compose_version, '!=' ) ) {
EE::exec( "curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m) -o $docker_compose_new_path && chmod +x $docker_compose_new_path" );
EE::exec( "mv $docker_compose_new_path $docker_compose_path" );
}
// Installs only when docker-compose is missing or too old; it never downgrades.
Containers::update_docker_compose();

// Check the version again post update.
$docker_version = trim( EE::launch( 'docker version --format "{{.Server.Version}}"' )->stdout );
if ( version_compare( $docker_version, '20.10.10', '<' ) ) {
EE::error( 'Docker version should be 20.10.10 or above. Please update Docker and try again.' );
}

$docker_compose_version = trim( EE::launch( 'docker-compose version --short' )->stdout );
if ( version_compare( '1.29.2', $docker_compose_version, '!=' ) ) {
EE::error( 'Docker-compose version should be 1.29.2. Please update Docker-compose and try again.' );
}
}

/**
Expand Down
339 changes: 281 additions & 58 deletions php/EE/Migration/Containers.php

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions php/EE/Migration/CustomContainerMigrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public static function execute_migrations() {
self::execute_migration_stack( $migrations );
} catch ( \Throwable $e ) {
Utils\delem_log( 'ee migration ended abruptly' );
exit( 1 );
// Rethrown, not exit(1): the migration step processor reports it and rolls back.
throw $e;
}

EE::debug( 'Successfully migrated EasyEngine' );
Expand Down Expand Up @@ -160,7 +161,7 @@ private static function execute_migration_stack( $migrations ) {

if ( ! file_exists( $migration_path ) ) {
EE::error( "Unable to find migration file at $migration_path", false );
throw new Exception();
throw new \Exception( "Unable to find migration file at $migration_path" );
}

require( $migration_path );
Expand Down
5 changes: 3 additions & 2 deletions php/EE/Migration/Executor.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public static function execute_migrations() {
self::execute_migration_stack( $migrations );
} catch ( \Throwable $e ) {
Utils\delem_log( 'ee migration ended abruptly' );
exit( 1 );
// Rethrown, not exit(1): the migration step processor reports it and rolls back.
throw $e;
}

EE::debug( 'Successfully migrated EasyEngine' );
Expand Down Expand Up @@ -100,7 +101,7 @@ private static function execute_migration_stack( $migrations ) {

if ( ! file_exists( $migration_path ) ) {
EE::error( "Unable to find migration file at $migration_path", false );
throw new Exception();
throw new \Exception( "Unable to find migration file at $migration_path" );
}

require( $migration_path );
Expand Down
Loading
Loading