Skip to content

Commit 9b1709d

Browse files
committed
[preview] pass context to rollout status, fix regression
1 parent c0d6fa9 commit 9b1709d

File tree

4 files changed

+655
-24
lines changed

4 files changed

+655
-24
lines changed

.github/workflows/ide-integration-tests.yml

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,29 +58,42 @@ jobs:
5858
SLACK_WEBHOOK: ${{ secrets.IDE_SLACK_WEBHOOK }}
5959
SLACK_COLOR: ${{ job.status }}
6060
SLACK_MESSAGE: main branch build failed
61-
check:
62-
name: Check for regressions
63-
needs: [configuration]
64-
runs-on: [self-hosted]
65-
container:
66-
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1
61+
62+
infrastructure:
63+
name: Create preview environment infrastructure
64+
needs: [ configuration ]
65+
runs-on: [ self-hosted ]
66+
concurrency:
67+
group: ${{ github.head_ref || github.ref_name }}-infrastructure
6768
steps:
6869
- uses: actions/checkout@v3
6970
- name: Create preview environment infrastructure
71+
id: create
7072
uses: ./.github/actions/preview-create
7173
with:
7274
name: ${{ needs.configuration.outputs.name }}
75+
sa_key: ${{ secrets.GCP_CREDENTIALS }}
7376
infrastructure_provider: harvester
7477
large_vm: true
75-
sa_key: ${{ secrets.GCP_CREDENTIALS }}
7678
- name: Deploy Gitpod to the preview environment
77-
if: github.event.inputs.skip_deploy != 'true'
7879
id: deploy-gitpod
7980
uses: ./.github/actions/deploy-gitpod
8081
with:
8182
name: ${{ needs.configuration.outputs.name }}
8283
sa_key: ${{ secrets.GCP_CREDENTIALS }}
8384
version: ${{ needs.configuration.outputs.version}}
85+
86+
check:
87+
name: Check for regressions
88+
needs: [configuration, infrastructure]
89+
runs-on: [self-hosted]
90+
container:
91+
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1
92+
volumes:
93+
- /var/tmp:/var/tmp
94+
- /tmp:/tmp
95+
steps:
96+
- uses: actions/checkout@v3
8497
- name: Integration Test
8598
shell: bash
8699
env:
@@ -153,9 +166,16 @@ jobs:
153166
SLACK_WEBHOOK: ${{ secrets.IDE_SLACK_WEBHOOK }}
154167
SLACK_COLOR: ${{ job.status }}
155168
SLACK_MESSAGE: ${{ steps.test_summary.outputs.passed }}/${{ steps.test_summary.outputs.total }} tests passed
156-
- name: Delete preview environment
157-
if: github.event.inputs.skip_delete != 'true' && (success() || failure())
158-
uses: ./.github/actions/delete-preview
159-
with:
160-
name: ${{ needs.configuration.outputs.name }}
161-
sa_key: ${{ secrets.GCP_CREDENTIALS }}
169+
170+
delete:
171+
name: Delete preview environment
172+
needs: [ configuration, infrastructure, check ]
173+
if: github.event.inputs.skip_delete != 'true' && always()
174+
runs-on: [ self-hosted ]
175+
steps:
176+
- uses: actions/checkout@v3
177+
- name: Delete preview environment
178+
uses: ./.github/actions/delete-preview
179+
with:
180+
name: ${{ needs.configuration.outputs.name }}
181+
sa_key: ${{ secrets.GCP_CREDENTIALS }}

.github/workflows/preview-env-check-regressions.yml

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
description: "The infrastructure provider to use. Valid options: harvester, gcp"
1717
required: false
1818
default: harvester
19+
1920
jobs:
2021
configuration:
2122
name: Configuration
@@ -46,29 +47,43 @@ jobs:
4647
echo "skip=${{ github.event.workflow_run.conclusion == 'failure' }}"
4748
} >> $GITHUB_OUTPUT
4849
fi
49-
check:
50-
name: Check for regressions
51-
needs: [configuration]
52-
if: ${{ needs.configuration.outputs.skip == 'false' }}
53-
runs-on: [self-hosted]
54-
container:
55-
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1
50+
51+
infrastructure:
52+
name: Create preview environment infrastructure
53+
needs: [ configuration ]
54+
runs-on: [ self-hosted ]
55+
concurrency:
56+
group: ${{ github.head_ref || github.ref_name }}-infrastructure
5657
steps:
5758
- uses: actions/checkout@v3
5859
- name: Create preview environment infrastructure
60+
id: create
5961
uses: ./.github/actions/preview-create
6062
with:
6163
name: ${{ needs.configuration.outputs.name }}
64+
sa_key: ${{ secrets.GCP_CREDENTIALS }}
6265
infrastructure_provider: ${{ needs.configuration.outputs.infrastructure_provider }}
6366
large_vm: false
64-
sa_key: ${{ secrets.GCP_CREDENTIALS }}
6567
- name: Deploy Gitpod to the preview environment
6668
id: deploy-gitpod
6769
uses: ./.github/actions/deploy-gitpod
6870
with:
6971
name: ${{ needs.configuration.outputs.name }}
7072
sa_key: ${{ secrets.GCP_CREDENTIALS }}
7173
version: ${{ needs.configuration.outputs.version}}
74+
75+
check:
76+
name: Check for regressions
77+
needs: [configuration, infrastructue]
78+
if: ${{ needs.configuration.outputs.skip == 'false' }}
79+
runs-on: [self-hosted]
80+
container:
81+
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-kubecdl-home.1
82+
volumes:
83+
- /var/tmp:/var/tmp
84+
- /tmp:/tmp
85+
steps:
86+
- uses: actions/checkout@v3
7287
- name: Check
7388
shell: bash
7489
env:
@@ -123,11 +138,13 @@ jobs:
123138
paths: "test/tests/**/TEST.xml"
124139
if: always()
125140
- id: auth
141+
if: failure()
126142
uses: google-github-actions/auth@v1
127143
with:
128144
token_format: access_token
129145
credentials_json: "${{ secrets.GCP_CREDENTIALS }}"
130146
- name: Get Secrets from GCP
147+
if: failure()
131148
id: 'secrets'
132149
uses: 'google-github-actions/get-secretmanager-secrets@v1'
133150
with:
@@ -140,8 +157,15 @@ jobs:
140157
SLACK_WEBHOOK: '${{ steps.secrets.outputs.devx-slack-webhook }}'
141158
SLACK_COLOR: ${{ job.status }}
142159
SLACK_MESSAGE: "`${{ needs.configuration.outputs.version}}` smoke test failed"
160+
161+
delete:
162+
name: Delete preview environment
163+
needs: [ configuration, infrastructure, check ]
164+
if: always()
165+
runs-on: [ self-hosted ]
166+
steps:
167+
- uses: actions/checkout@v3
143168
- name: Delete preview environment
144-
if: always()
145169
uses: ./.github/actions/delete-preview
146170
with:
147171
name: ${{ needs.configuration.outputs.name }}

dev/preview/workflow/preview/deploy-gitpod.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ rm -f "${INSTALLER_RENDER_PATH}"
617617
# Wait for objects to be ready
618618
# =========================
619619
for item in deployment.apps/blobserve deployment.apps/content-service deployment.apps/dashboard deployment.apps/ide-metrics deployment.apps/ide-proxy deployment.apps/ide-service deployment.apps/image-builder-mk3 deployment.apps/minio deployment.apps/node-labeler deployment.apps/payment-endpoint deployment.apps/proxy deployment.apps/public-api-server deployment.apps/redis deployment.apps/server deployment.apps/spicedb deployment.apps/usage deployment.apps/ws-manager deployment.apps/ws-manager-bridge deployment.apps/ws-proxy statefulset.apps/messagebus statefulset.apps/mysql statefulset.apps/openvsx-proxy daemonset.apps/agent-smith daemonset.apps/fluent-bit daemonset.apps/registry-facade daemonset.apps/ws-daemon; do
620-
kubectl rollout status "${item}"
620+
kubectl --kubeconfig "${PREVIEW_K3S_KUBE_PATH}" --context "${PREVIEW_K3S_KUBE_CONTEXT}" rollout status "${item}"
621621
done
622622

623623
# =====================

0 commit comments

Comments
 (0)