From 1dd287464824428a9d868eea8ceadc99948e9987 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Wed, 1 May 2024 12:48:23 +0530 Subject: [PATCH] Remove support containers from global migration Signed-off-by: Riddhesh Sanghvi --- php/EE/Migration/Containers.php | 22 -------------------- php/EE/Migration/GlobalContainers.php | 30 --------------------------- 2 files changed, 52 deletions(-) diff --git a/php/EE/Migration/Containers.php b/php/EE/Migration/Containers.php index f7b4ba458..5ca611da5 100644 --- a/php/EE/Migration/Containers.php +++ b/php/EE/Migration/Containers.php @@ -200,17 +200,6 @@ private static function migrate_global_containers( $updated_images ) { [ $global_compose_file_backup_path, $global_compose_file_path, $updated_global_images ] ); - /** - * Create support containers. - */ - self::$rsp->add_step( - 'create-support-global-containers', - 'EE\Migration\GlobalContainers::enable_support_containers', - 'EE\Migration\GlobalContainers::disable_support_containers', - null, - null - ); - self::$rsp->add_step( 'stop-global-containers', 'EE\Migration\GlobalContainers::down_global_containers', @@ -240,17 +229,6 @@ private static function migrate_global_containers( $updated_images ) { [ $global_service_name ] ); } - - /** - * Remove support containers. - */ - self::$rsp->add_step( - 'remove-support-global-containers', - 'EE\Migration\GlobalContainers::disable_support_containers', - 'EE\Migration\GlobalContainers::enable_support_containers', - null, - null - ); } /** diff --git a/php/EE/Migration/GlobalContainers.php b/php/EE/Migration/GlobalContainers.php index 7c73e550f..ca762bf54 100644 --- a/php/EE/Migration/GlobalContainers.php +++ b/php/EE/Migration/GlobalContainers.php @@ -137,34 +137,4 @@ public static function get_all_global_images_with_service_name() { 'easyengine/newrelic-daemon' => GLOBAL_NEWRELIC_DAEMON_CONTAINER, ]; } - - /** - * Create support containers for global-db and global-redis service. - */ - public static function enable_support_containers() { - if ( ! chdir( EE_SERVICE_DIR ) ) { - throw new \Exception( sprintf( '%s path does not exist', EE_SERVICE_DIR ) ); - } - - $command = \EE_DOCKER::docker_compose_with_custom() . ' --project-name=ee up -d global-db global-redis'; - if ( ! EE::exec( $command ) ) { - throw new \Exception( 'Unable to create support container.' ); - } - } - - /** - * Remove support containers for global-db and global-redis service. - */ - public static function disable_support_containers() { - if ( ! chdir( EE_SERVICE_DIR ) ) { - throw new \Exception( sprintf( '%s path does not exist', EE_SERVICE_DIR ) ); - } - - $command = \EE_DOCKER::docker_compose_with_custom() . ' --project-name=ee down'; - /** - * Return code can be 1 due to error in removing network. This is expected. - * TODO: Get a fix for global network / make them external so that the return code is not 1. - */ - EE::exec( $command ); - } }