Skip to content

Commit

Permalink
chore: remove initialize terraservice in fl (#80)
Browse files Browse the repository at this point in the history
Remove the 'initialize' terraservice in the Federated Learning use case
because the core platform 'initialize' terraservice takes care of
configuring backends for use cases after #71 is merged.

The only task implemented in the use case 'initialize' terraservice was
to initialize backend configuration, so we don't need it anymore.

Also, simplify provisioning and teardown scripts because we don't need
two different terraform init commands anymore because now all the
terraservices in the use case work with a remote backend.
  • Loading branch information
ferrarimarco authored Dec 20, 2024
1 parent 76db58b commit 5edbfc9
Show file tree
Hide file tree
Showing 13 changed files with 1 addition and 195 deletions.
26 changes: 1 addition & 25 deletions platforms/gke/base/use-cases/federated-learning/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,13 @@ FEDERATED_LEARNING_USE_CASE_TERRAFORM_DIR="${FEDERATED_LEARNING_USE_CASE_DIR}/te
# shellcheck disable=SC2034 # Variable is used in other scripts
FEDERATED_LEARNING_SHARED_CONFIG_DIR="${FEDERATED_LEARNING_USE_CASE_TERRAFORM_DIR}/_shared_config"

# shellcheck disable=SC2034 # Variable is used in other scripts
FEDERATED_LEARNING_USE_CASE_INITIALIZE_SERVICE_DIR="${FEDERATED_LEARNING_USE_CASE_TERRAFORM_DIR}/initialize"

# shellcheck disable=SC2034 # Variable is used in other scripts
federated_learning_terraservices=(
"initialize"
"container_image_repository"
"private_google_access"
)

TERRAFORM_INIT_COMMAND=(
terraform init
)

# shellcheck disable=SC2034 # Variable is used in other scripts
TERRAFORM_INIT_BACKEND_CONFIG_COMMAND=(
"${TERRAFORM_INIT_COMMAND[@]}"
-backend-config="backend.config"
)

# shellcheck disable=SC2034 # Variable is used in other scripts
TERRAFORM_CLUSTER_CONFIGURATION=(
)
Expand All @@ -62,19 +49,8 @@ apply_or_destroy_terraservice() {
local operation_mode
operation_mode="${2:-"not set"}"

local -a TERRASERVICE_TERRAFORM_INIT_COMMAND
TERRASERVICE_TERRAFORM_INIT_COMMAND=(
"${TERRAFORM_INIT_BACKEND_CONFIG_COMMAND[@]}"
)
if [ "${terraservice:-}" == "initialize" ]; then
TERRASERVICE_TERRAFORM_INIT_COMMAND=(
"${TERRAFORM_INIT_COMMAND[@]}"
)
fi
echo "Terraform init command for ${terraservice}: ${TERRASERVICE_TERRAFORM_INIT_COMMAND[*]}"

cd "${FEDERATED_LEARNING_USE_CASE_TERRAFORM_DIR}/${terraservice}" &&
"${TERRASERVICE_TERRAFORM_INIT_COMMAND[@]}"
terraform init

echo "Current working directory: $(pwd)"

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 5edbfc9

Please sign in to comment.