From 47cc776a0c331a985902776a4e2622423f1851c0 Mon Sep 17 00:00:00 2001 From: Beldine-Moturi Date: Thu, 2 Apr 2026 17:22:03 +0300 Subject: [PATCH] add populate buckets option to deployment scripts --- deploy_studio_k8s.sh | 25 +++++++++++++++++ deploy_studio_lima.sh | 28 +++++++++++++++++++ deploy_studio_ocp.sh | 24 ++++++++++++++++ .../template/populate-buckets-minio-pvc.yaml | 2 +- .../geospatial-studio-pipelines/values.yaml | 2 +- geospatial-studio/values.yaml | 2 +- 6 files changed, 80 insertions(+), 3 deletions(-) diff --git a/deploy_studio_k8s.sh b/deploy_studio_k8s.sh index d2f9e31e..7b43a0fa 100755 --- a/deploy_studio_k8s.sh +++ b/deploy_studio_k8s.sh @@ -20,6 +20,7 @@ export GEOSERVER_PASSWORD="geoserver" export DEPLOYMENT_ENV=k8s export OC_PROJECT=default export IMAGE_REGISTRY=geospatial-studio +export ENVIRONMENT=local # Component selection for deployment/redeployment echo "----------------------------------------------------------------------" @@ -166,6 +167,30 @@ if [[ "$DEPLOY_MINIO" == "Deploy" ]]; then sed -i -e "s|endpoint=.*|endpoint=https://minio.$OC_PROJECT.svc.cluster.local:9000|g" workspace/${DEPLOYMENT_ENV}/env/.env source workspace/${DEPLOYMENT_ENV}/env/env.sh + + # populate buckets + if [[ "${NON_INTERACTIVE:-false}" == "true" ]]; then + echo "Skipping auxiliary data download." + else + populate_data_options="Yes No" + typeset populate_data_choice + + # Call the function + get_menu_selection \ + "Do you want to download auxiliary data to populate buckets?" \ + populate_data_choice \ + "$populate_data_options" + + if [[ "$populate_data_choice" == "Yes" ]]; then + echo "Downloading auxiliary data..." + sed -i -e "s/export LULC_TILE_ROOT=.*/export LULC_TILE_ROOT=https:\/\/lulctimeseries.blob.core.windows.net\/lulctimeseriesv003\/lc2024\/lulc2024.zip/g" workspace/${DEPLOYMENT_ENV}/env/env.sh + source workspace/${DEPLOYMENT_ENV}/env/env.sh + + ./deployment-scripts/populate-buckets-with-auxiliary-data.sh + else + echo "Skipping auxiliary data download." + fi + fi else echo "----------------------------------------------------------------------" echo "------------------- Skipping Minio Deployment ----------------------" diff --git a/deploy_studio_lima.sh b/deploy_studio_lima.sh index b19027a4..9ac9ec75 100755 --- a/deploy_studio_lima.sh +++ b/deploy_studio_lima.sh @@ -20,6 +20,7 @@ export KUBECONFIG="$HOME/.lima/studio/copied-from-guest/kubeconfig.yaml" # Set environment variables export DEPLOYMENT_ENV=lima +export ENVIRONMENT=local export OC_PROJECT=default export IMAGE_REGISTRY=geospatial-studio @@ -138,6 +139,33 @@ if [[ "$DEPLOY_MINIO" == "Deploy" ]]; then sed -i -e "s|endpoint=.*|endpoint=https://minio.$OC_PROJECT.svc.cluster.local:9000|g" workspace/${DEPLOYMENT_ENV}/env/.env source workspace/${DEPLOYMENT_ENV}/env/env.sh + + # populate buckets + if [[ "${NON_INTERACTIVE:-false}" == "true" ]]; then + echo "Skipping auxiliary data download." + else + populate_data_options="Yes No" + typeset populate_data_choice + + # Call the function + get_menu_selection \ + "Do you want to download auxiliary data to populate buckets?" \ + populate_data_choice \ + "$populate_data_options" + + if [[ "$populate_data_choice" == "Yes" ]]; then + echo "Downloading auxiliary data..." + sed -i -e "s/export LULC_TILE_ROOT=.*/export LULC_TILE_ROOT=https:\/\/lulctimeseries.blob.core.windows.net\/lulctimeseriesv003\/lc2024\/lulc2024.zip/g" workspace/${DEPLOYMENT_ENV}/env/env.sh + source workspace/${DEPLOYMENT_ENV}/env/env.sh + + ./deployment-scripts/populate-buckets-with-auxiliary-data.sh + else + echo "Skipping auxiliary data download." + fi + fi + + + else echo "----------------------------------------------------------------------" echo "------------------- Skipping Minio Deployment ----------------------" diff --git a/deploy_studio_ocp.sh b/deploy_studio_ocp.sh index 33f933f8..d37fe50b 100755 --- a/deploy_studio_ocp.sh +++ b/deploy_studio_ocp.sh @@ -448,6 +448,30 @@ if [[ "$DEPLOY_MINIO" == "Deploy" ]]; then if [[ "$DEPLOYMENT_ENV" == "crc" ]]; then sed -i -e "s|endpoint=.*|endpoint=https://minio.$OC_PROJECT.svc.cluster.local:9000|g" workspace/${DEPLOYMENT_ENV}/env/.env fi + + # populate buckets + if [[ "${NON_INTERACTIVE:-false}" == "true" ]]; then + echo "Skipping auxiliary data download." + else + populate_data_options="Yes No" + typeset populate_data_choice + + # Call the function + get_menu_selection \ + "Do you want to download auxiliary data to populate buckets?" \ + populate_data_choice \ + "$populate_data_options" + + if [[ "$populate_data_choice" == "Yes" ]]; then + echo "Downloading auxiliary data..." + sed -i -e "s/export LULC_TILE_ROOT=.*/export LULC_TILE_ROOT=https:\/\/lulctimeseries.blob.core.windows.net\/lulctimeseriesv003\/lc2024\/lulc2024.zip/g" workspace/${DEPLOYMENT_ENV}/env/env.sh + source workspace/${DEPLOYMENT_ENV}/env/env.sh + + ./deployment-scripts/populate-buckets-with-auxiliary-data.sh + else + echo "Skipping auxiliary data download." + fi + fi else echo "----------------------------------------------------------------------" echo "------------------- Skipping Minio Deployment ----------------------" diff --git a/deployment-scripts/template/populate-buckets-minio-pvc.yaml b/deployment-scripts/template/populate-buckets-minio-pvc.yaml index 06b4f5c4..81f2a09b 100644 --- a/deployment-scripts/template/populate-buckets-minio-pvc.yaml +++ b/deployment-scripts/template/populate-buckets-minio-pvc.yaml @@ -34,4 +34,4 @@ spec: - ReadWriteOnce resources: requests: - storage: 20Gi + storage: 70Gi diff --git a/geospatial-studio/charts/geospatial-studio-pipelines/values.yaml b/geospatial-studio/charts/geospatial-studio-pipelines/values.yaml index e286f225..c6bae890 100644 --- a/geospatial-studio/charts/geospatial-studio-pipelines/values.yaml +++ b/geospatial-studio/charts/geospatial-studio-pipelines/values.yaml @@ -203,7 +203,7 @@ processors: process_exec: 'python postprocess-generic-single.py' extra_envs: - name: LULC_TILE_ROOT - value: /auxdata/lulc/lc2021/ + value: /auxdata/lulc/ - name: LULC_TILE_SHAPEFILE value: /auxdata/lulc/tiles.shp - name: LAND_POLYGON_PATH diff --git a/geospatial-studio/values.yaml b/geospatial-studio/values.yaml index 4944bbdf..50a7a3c9 100644 --- a/geospatial-studio/values.yaml +++ b/geospatial-studio/values.yaml @@ -513,7 +513,7 @@ geospatial-studio-pipelines: process_exec: 'python postprocess-generic-single.py' extra_envs: - name: LULC_TILE_ROOT - value: /auxdata/lulc/lc2021/ + value: /auxdata/lulc/ - name: LULC_TILE_SHAPEFILE value: /auxdata/lulc/tiles.shp - name: LAND_POLYGON_PATH