diff --git a/.github/workflows/gcp-experiment-pipeline.yml b/.github/workflows/gcp-experiment-pipeline.yml index c487b919c..b534f4d1f 100644 --- a/.github/workflows/gcp-experiment-pipeline.yml +++ b/.github/workflows/gcp-experiment-pipeline.yml @@ -72,7 +72,7 @@ jobs: run: | gcloud compute instances create litmus-e2e-first-vm-${{ github.run_number }} litmus-e2e-second-vm-${{ github.run_number }} \ --machine-type=f1-micro \ - --zone=us-central1-a + --zone=${{ secrets.GCP_ZONE }} - name: Litmus Infra Setup if: always() @@ -86,7 +86,7 @@ jobs: env: GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} VM_INSTANCE_NAMES: "litmus-e2e-first-vm-${{ github.run_number }},litmus-e2e-second-vm-${{ github.run_number }}" - INSTANCE_ZONES: "us-central1-a,us-central1-a" + INSTANCE_ZONES: "${{ secrets.GCP_ZONE }},${{ secrets.GCP_ZONE }}" EXPERIMENT_IMAGE: "${{ github.event.inputs.experimentImage }}" EXPERIMENT_IMAGE_PULL_POLICY: "${{ github.event.inputs.experimentImagePullPolicy }}" CHAOS_NAMESPACE: "${{ github.event.inputs.chaosNamespace }}" @@ -96,7 +96,7 @@ jobs: if: always() run: | gcloud compute instances delete litmus-e2e-first-vm-${{ github.run_number }} litmus-e2e-second-vm-${{ github.run_number }} \ - --zone=us-central1-a \ + --zone=${{ secrets.GCP_ZONE }} \ --quiet - name: "[Debug]: check chaos resources" @@ -179,9 +179,9 @@ jobs: run: | gcloud compute instances create litmus-e2e-vm-${{ github.run_number }} \ --machine-type=f1-micro \ - --zone=us-central1-a \ - --create-disk name=litmus-e2e-first-disk-${{ github.run_number }},size=1GB,device-name=litmus-e2e-first-disk-${{ github.run_number }} \ - --create-disk name=litmus-e2e-second-disk-${{ github.run_number }},size=1GB,device-name=litmus-e2e-second-disk-${{ github.run_number }} + --zone=${{ secrets.GCP_ZONE }} \ + --create-disk name=litmus-e2e-first-disk-${{ github.run_number }},size=1GB \ + --create-disk name=litmus-e2e-second-disk-${{ github.run_number }},size=1GB - name: Litmus Infra Setup if: always() @@ -195,8 +195,7 @@ jobs: env: GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} DISK_VOLUME_NAMES: "litmus-e2e-first-disk-${{ github.run_number }},litmus-e2e-second-disk-${{ github.run_number }}" - DISK_ZONES: "us-central1-a,us-central1-a" - DEVICE_NAMES: "litmus-e2e-first-disk-${{ github.run_number }},litmus-e2e-second-disk-${{ github.run_number }}" + DISK_ZONES: "${{ secrets.GCP_ZONE }},${{ secrets.GCP_ZONE }}" EXPERIMENT_IMAGE: "${{ github.event.inputs.experimentImage }}" EXPERIMENT_IMAGE_PULL_POLICY: "${{ github.event.inputs.experimentImagePullPolicy }}" CHAOS_NAMESPACE: "${{ github.event.inputs.chaosNamespace }}" @@ -206,7 +205,7 @@ jobs: if: always() run: | gcloud compute instances delete litmus-e2e-vm-${{ github.run_number }} \ - --zone=us-central1-a \ + --zone=${{ secrets.GCP_ZONE }} \ --delete-disks=all \ --quiet diff --git a/.github/workflows/m-agent-experiment-pipeline.yml b/.github/workflows/m-agent-experiment-pipeline.yml index 11b3aa6b1..272c5240f 100644 --- a/.github/workflows/m-agent-experiment-pipeline.yml +++ b/.github/workflows/m-agent-experiment-pipeline.yml @@ -39,7 +39,7 @@ jobs: run: | gcloud compute instances create litmus-e2e-m-agent-vm-${{ github.run_number }} \ --machine-type=f1-micro \ - --zone=us-east4-c \ + --zone=${{ secrets.GCP_ZONE }} \ --metadata=startup-script='#! /bin/bash apt update apt -y install apache2 @@ -49,7 +49,7 @@ jobs: - name: Get Agent Endpoint and Auth Token if: always() id: get-credentials - run: gcloud compute ssh --zone us-east4-c litmus-e2e-m-agent-vm-${{ github.run_number }} -- 'm-agent --get-token --token-expiry-duration 30m' > token.txt + run: gcloud compute ssh --zone ${{ secrets.GCP_ZONE }} litmus-e2e-m-agent-vm-${{ github.run_number }} -- 'm-agent --get-token --token-expiry-duration 30m' > token.txt - uses: actions/upload-artifact@v3 with: @@ -59,12 +59,12 @@ jobs: - name: Get main PID of the Apache Service as Target Process if: always() id: get-apache-target-process - run: echo "::set-output name=pid1::$(gcloud compute ssh --zone us-east4-c litmus-e2e-m-agent-vm-${{ github.run_number }} -- 'systemctl show --property MainPID --value apache2')" + run: echo "::set-output name=pid1::$(gcloud compute ssh --zone ${{ secrets.GCP_ZONE }} litmus-e2e-m-agent-vm-${{ github.run_number }} -- 'systemctl show --property MainPID --value apache2')" - name: Get main PID of the Apache Service as Target Process if: always() id: get-crond-target-process - run: echo "::set-output name=pid2::$(gcloud compute ssh --zone us-east4-c litmus-e2e-m-agent-vm-${{ github.run_number }} -- 'systemctl show --property MainPID --value cron')" + run: echo "::set-output name=pid2::$(gcloud compute ssh --zone ${{ secrets.GCP_ZONE }} litmus-e2e-m-agent-vm-${{ github.run_number }} -- 'systemctl show --property MainPID --value cron')" Process_Kill_Serial_Test: needs: Setup_m-agent @@ -252,5 +252,5 @@ jobs: if: always() run: | gcloud compute instances delete litmus-e2e-m-agent-vm-${{ github.run_number }} \ - --zone=us-east4-c \ + --zone=${{ secrets.GCP_ZONE }} \ --quiet \ No newline at end of file diff --git a/.github/workflows/nightly-gcp-experiment-pipeline.yml b/.github/workflows/nightly-gcp-experiment-pipeline.yml index 5489460d5..b17c0b7ee 100644 --- a/.github/workflows/nightly-gcp-experiment-pipeline.yml +++ b/.github/workflows/nightly-gcp-experiment-pipeline.yml @@ -64,7 +64,7 @@ jobs: run: | gcloud compute instances create litmus-e2e-first-vm-${{ github.run_number }} litmus-e2e-second-vm-${{ github.run_number }} \ --machine-type=f1-micro \ - --zone=us-central1-a + --zone=${{ secrets.GCP_ZONE }} - name: Litmus Infra Setup if: always() @@ -75,14 +75,14 @@ jobs: env: GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} VM_INSTANCE_NAMES: "litmus-e2e-first-vm-${{ github.run_number }},litmus-e2e-second-vm-${{ github.run_number }}" - INSTANCE_ZONES: "us-central1-a,us-central1-a" + INSTANCE_ZONES: "${{ secrets.GCP_ZONE }},${{ secrets.GCP_ZONE }}" run: make gcp-vm-instance-stop - name: Delete target GCP VM Instances if: always() run: | gcloud compute instances delete litmus-e2e-first-vm-${{ github.run_number }} litmus-e2e-second-vm-${{ github.run_number }} \ - --zone=us-central1-a \ + --zone=${{ secrets.GCP_ZONE }} \ --quiet - name: "[Debug]: check chaos resources" @@ -165,9 +165,9 @@ jobs: run: | gcloud compute instances create litmus-e2e-vm-${{ github.run_number }} \ --machine-type=f1-micro \ - --zone=us-central1-a \ - --create-disk name=litmus-e2e-first-disk-${{ github.run_number }},size=1GB,device-name=litmus-e2e-first-disk-${{ github.run_number }} \ - --create-disk name=litmus-e2e-second-disk-${{ github.run_number }},size=1GB,device-name=litmus-e2e-second-disk-${{ github.run_number }} + --zone=${{ secrets.GCP_ZONE }} \ + --create-disk name=litmus-e2e-first-disk-${{ github.run_number }},size=1GB \ + --create-disk name=litmus-e2e-second-disk-${{ github.run_number }},size=1GB - name: Litmus Infra Setup if: always() @@ -178,15 +178,14 @@ jobs: env: GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} DISK_VOLUME_NAMES: "litmus-e2e-first-disk-${{ github.run_number }},litmus-e2e-second-disk-${{ github.run_number }}" - DISK_ZONES: "us-central1-a,us-central1-a" - DEVICE_NAMES: "litmus-e2e-first-disk-${{ github.run_number }},litmus-e2e-second-disk-${{ github.run_number }}" + DISK_ZONES: "${{ secrets.GCP_ZONE }},${{ secrets.GCP_ZONE }}" run: make gcp-vm-disk-loss - name: Delete the VM Instance and target Disk Volumes if: always() run: | gcloud compute instances delete litmus-e2e-vm-${{ github.run_number }} \ - --zone=us-central1-a \ + --zone=${{ secrets.GCP_ZONE }} \ --delete-disks=all \ --quiet diff --git a/.github/workflows/nightly-m-agent-experiment-pipeline.yaml b/.github/workflows/nightly-m-agent-experiment-pipeline.yaml index 2de9ed8f1..a6d5fbf10 100644 --- a/.github/workflows/nightly-m-agent-experiment-pipeline.yaml +++ b/.github/workflows/nightly-m-agent-experiment-pipeline.yaml @@ -29,7 +29,7 @@ jobs: run: | gcloud compute instances create litmus-e2e-m-agent-vm-${{ github.run_number }} \ --machine-type=f1-micro \ - --zone=us-east4-c \ + --zone=${{ secrets.GCP_ZONE }} \ --metadata=startup-script='#! /bin/bash apt update apt -y install apache2 @@ -39,7 +39,7 @@ jobs: - name: Get Agent Endpoint and Auth Token if: always() id: get-credentials - run: gcloud compute ssh --zone us-east4-c litmus-e2e-m-agent-vm-${{ github.run_number }} -- 'm-agent --get-token --token-expiry-duration 30m' > token.txt + run: gcloud compute ssh --zone ${{ secrets.GCP_ZONE }} litmus-e2e-m-agent-vm-${{ github.run_number }} -- 'm-agent --get-token --token-expiry-duration 30m' > token.txt - uses: actions/upload-artifact@v3 with: @@ -49,12 +49,12 @@ jobs: - name: Get main PID of the Apache Service as Target Process if: always() id: get-apache-target-process - run: echo "::set-output name=pid1::$(gcloud compute ssh --zone us-east4-c litmus-e2e-m-agent-vm-${{ github.run_number }} -- 'systemctl show --property MainPID --value apache2')" + run: echo "::set-output name=pid1::$(gcloud compute ssh --zone ${{ secrets.GCP_ZONE }} litmus-e2e-m-agent-vm-${{ github.run_number }} -- 'systemctl show --property MainPID --value apache2')" - name: Get main PID of the Apache Service as Target Process if: always() id: get-crond-target-process - run: echo "::set-output name=pid2::$(gcloud compute ssh --zone us-east4-c litmus-e2e-m-agent-vm-${{ github.run_number }} -- 'systemctl show --property MainPID --value cron')" + run: echo "::set-output name=pid2::$(gcloud compute ssh --zone ${{ secrets.GCP_ZONE }} litmus-e2e-m-agent-vm-${{ github.run_number }} -- 'systemctl show --property MainPID --value cron')" Process_Kill_Serial_Test: needs: Setup_m-agent @@ -232,5 +232,5 @@ jobs: if: always() run: | gcloud compute instances delete litmus-e2e-m-agent-vm-${{ github.run_number }} \ - --zone=us-east4-c \ + --zone=${{ secrets.GCP_ZONE }} \ --quiet \ No newline at end of file diff --git a/pkg/environment/environment.go b/pkg/environment/environment.go index 41f0413d0..915dd5529 100644 --- a/pkg/environment/environment.go +++ b/pkg/environment/environment.go @@ -38,7 +38,6 @@ func GetENV(testDetails *types.TestDetails, expName, engineName string) { testDetails.InstanceZones = Getenv("INSTANCE_ZONES", "") testDetails.DiskVolumeNames = Getenv("DISK_VOLUME_NAMES", "") testDetails.DiskZones = Getenv("DISK_ZONES", "") - testDetails.DeviceNames = Getenv("DEVICE_NAMES", "") testDetails.VMIds = Getenv("APP_VM_MOIDS", "") testDetails.Region = Getenv("REGION", "us-west-1") testDetails.UpdateWebsite = Getenv("UPDATE_WEBSITE", "false") diff --git a/pkg/install.go b/pkg/install.go index 98d7be9f8..fa8fb80c9 100644 --- a/pkg/install.go +++ b/pkg/install.go @@ -334,8 +334,7 @@ func setEngineVar(chaosEngine *v1alpha1.ChaosEngine, testsDetails *types.TestDet case "gcp-vm-disk-loss": envDetails.SetEnv("GCP_PROJECT_ID", testsDetails.GCPProjectID). SetEnv("DISK_VOLUME_NAMES", testsDetails.DiskVolumeNames). - SetEnv("DISK_ZONES", testsDetails.DiskZones). - SetEnv("DEVICE_NAMES", testsDetails.DeviceNames) + SetEnv("DISK_ZONES", testsDetails.DiskZones) case "vm-poweroff": envDetails.SetEnv("APP_VM_MOIDS", testsDetails.VMIds) case "process-kill": diff --git a/pkg/types/types.go b/pkg/types/types.go index 71bfb2185..f2639860c 100644 --- a/pkg/types/types.go +++ b/pkg/types/types.go @@ -47,7 +47,6 @@ type TestDetails struct { InstanceZones string DiskVolumeNames string DiskZones string - DeviceNames string VMIds string Region string Lib string