Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCP Pipeline Fixes #379

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 8 additions & 9 deletions .github/workflows/gcp-experiment-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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 }}"
Expand All @@ -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"
Expand Down Expand Up @@ -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()
Expand All @@ -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 }}"
Expand All @@ -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

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/m-agent-experiment-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
17 changes: 8 additions & 9 deletions .github/workflows/nightly-gcp-experiment-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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"
Expand Down Expand Up @@ -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()
Expand All @@ -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

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/nightly-m-agent-experiment-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
1 change: 0 additions & 1 deletion pkg/environment/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 1 addition & 2 deletions pkg/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
1 change: 0 additions & 1 deletion pkg/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ type TestDetails struct {
InstanceZones string
DiskVolumeNames string
DiskZones string
DeviceNames string
VMIds string
Region string
Lib string
Expand Down