Skip to content

Commit

Permalink
Merge branch 'main' into thomas/parent-id
Browse files Browse the repository at this point in the history
  • Loading branch information
tdraier committed Dec 11, 2024
2 parents 58936b2 + 218fb87 commit 1c1b1e1
Show file tree
Hide file tree
Showing 33 changed files with 589 additions and 501 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy-front-edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ jobs:

- name: Build the image on Cloud Build
run: |
chmod +x ./k8s/cloud-build_tmp.sh
./k8s/cloud-build_tmp.sh \
chmod +x ./k8s/cloud-build.sh
./k8s/cloud-build.sh \
--image-name=$IMAGE_NAME \
--dockerfile-path=./front/Dockerfile \
--working-dir=./ \
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/revert-connectors-edge.yml

This file was deleted.

67 changes: 52 additions & 15 deletions .github/workflows/revert-connectors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Revert Connectors

on:
workflow_dispatch:
inputs:
image_tag:
description: "The image tag/SHA to deploy"
type: string
required: true

env:
GCLOUD_PROJECT_ID: ${{ secrets.GCLOUD_PROJECT_ID }}
Expand All @@ -14,25 +19,57 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Notify Build And Deploy Start
id: build_message
uses: ./.github/actions/slack-notify
with:
step: "start"
component: "Revert connectors"
image_tag: ${{ inputs.image_tag }}
channel: ${{ secrets.SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_BOT_TOKEN }}

- name: "Authenticate with Google Cloud"
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.GCLOUD_SA_KEY }}"

- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v1"

- name: Install gke-gcloud-auth-plugin
run: |
gcloud components install gke-gcloud-auth-plugin
- name: Setup kubectl
run: |
gcloud container clusters get-credentials dust-kube --region us-central1
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.INFRA_DISPATCH_APP_ID }}
private-key: ${{ secrets.INFRA_DISPATCH_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: |
dust-infra
- name: Rollback the deployment
run: |
kubectl rollout undo deployment/connectors-deployment
- name: Trigger dust-infra workflow
uses: actions/github-script@v6
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
await github.rest.repos.createDispatchEvent({
owner: '${{ github.repository_owner }}',
repo: 'dust-infra',
event_type: 'trigger-component-deploy',
client_payload: {
regions: 'us-central1',
component: 'connectors',
image_tag: '${{ inputs.image_tag }}',
slack_thread_ts: "${{ steps.build_message.outputs.thread_ts }}",
slack_channel: '${{ secrets.SLACK_CHANNEL_ID }}'
}
});
- name: Wait for rollback to complete
run: kubectl rollout status deployment/connectors-deployment --timeout=10m
- name: Notify Failure
if: failure()
uses: ./.github/actions/slack-notify
with:
step: "failure"
blocked: ${{ steps.check_deployment_blocked.outputs.blocked }}
component: "Revert connectors"
image_tag: ${{ inputs.image_tag }}
channel: ${{ secrets.SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_BOT_TOKEN }}
thread_ts: "${{ steps.build_message.outputs.thread_ts }}"
67 changes: 52 additions & 15 deletions .github/workflows/revert-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Revert Core

on:
workflow_dispatch:
inputs:
image_tag:
description: "The image tag/SHA to deploy"
type: string
required: true

env:
GCLOUD_PROJECT_ID: ${{ secrets.GCLOUD_PROJECT_ID }}
Expand All @@ -14,25 +19,57 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Notify Build And Deploy Start
id: build_message
uses: ./.github/actions/slack-notify
with:
step: "start"
component: "Revert core"
image_tag: ${{ inputs.image_tag }}
channel: ${{ secrets.SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_BOT_TOKEN }}

- name: "Authenticate with Google Cloud"
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.GCLOUD_SA_KEY }}"

- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v1"

- name: Install gke-gcloud-auth-plugin
run: |
gcloud components install gke-gcloud-auth-plugin
- name: Setup kubectl
run: |
gcloud container clusters get-credentials dust-kube --region us-central1
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.INFRA_DISPATCH_APP_ID }}
private-key: ${{ secrets.INFRA_DISPATCH_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: |
dust-infra
- name: Rollback the deployment
run: |
kubectl rollout undo deployment/core-deployment
- name: Trigger dust-infra workflow
uses: actions/github-script@v6
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
await github.rest.repos.createDispatchEvent({
owner: '${{ github.repository_owner }}',
repo: 'dust-infra',
event_type: 'trigger-component-deploy',
client_payload: {
regions: 'us-central1',
component: 'core',
image_tag: '${{ inputs.image_tag }}',
slack_thread_ts: "${{ steps.build_message.outputs.thread_ts }}",
slack_channel: '${{ secrets.SLACK_CHANNEL_ID }}'
}
});
- name: Wait for rollback to complete
run: kubectl rollout status deployment/core-deployment --timeout=10m
- name: Notify Failure
if: failure()
uses: ./.github/actions/slack-notify
with:
step: "failure"
blocked: ${{ steps.check_deployment_blocked.outputs.blocked }}
component: "Revert core"
image_tag: ${{ inputs.image_tag }}
channel: ${{ secrets.SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_BOT_TOKEN }}
thread_ts: "${{ steps.build_message.outputs.thread_ts }}"
12 changes: 4 additions & 8 deletions .github/workflows/revert-front-edge.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy Front Edge
name: Revert Front Edge

on:
workflow_dispatch:
Expand All @@ -19,17 +19,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Get short sha
id: short_sha
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Notify Build And Deploy Start
id: build_message
uses: ./.github/actions/slack-notify
with:
step: "start"
component: "Revert front-edge"
image_tag: ${{ steps.short_sha.outputs.short_sha }}
image_tag: ${{ inputs.image_tag }}
channel: ${{ secrets.SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_BOT_TOKEN }}

Expand Down Expand Up @@ -60,7 +56,7 @@ jobs:
client_payload: {
regions: 'us-central1',
component: 'front-edge',
image_tag: '${{ steps.short_sha.outputs.short_sha }}',
image_tag: '${{ inputs.image_tag }}',
slack_thread_ts: "${{ steps.build_message.outputs.thread_ts }}",
slack_channel: '${{ secrets.SLACK_CHANNEL_ID }}'
}
Expand All @@ -73,7 +69,7 @@ jobs:
step: "failure"
blocked: ${{ steps.check_deployment_blocked.outputs.blocked }}
component: "Revert front-edge"
image_tag: ${{ steps.short_sha.outputs.short_sha }}
image_tag: ${{ inputs.image_tag }}
channel: ${{ secrets.SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_BOT_TOKEN }}
thread_ts: "${{ steps.build_message.outputs.thread_ts }}"
67 changes: 52 additions & 15 deletions .github/workflows/revert-front.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Revert Front

on:
workflow_dispatch:
inputs:
image_tag:
description: "The image tag/SHA to deploy"
type: string
required: true

env:
GCLOUD_PROJECT_ID: ${{ secrets.GCLOUD_PROJECT_ID }}
Expand All @@ -14,25 +19,57 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Notify Build And Deploy Start
id: build_message
uses: ./.github/actions/slack-notify
with:
step: "start"
component: "Revert front"
image_tag: ${{ inputs.image_tag }}
channel: ${{ secrets.SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_BOT_TOKEN }}

- name: "Authenticate with Google Cloud"
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.GCLOUD_SA_KEY }}"

- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v1"

- name: Install gke-gcloud-auth-plugin
run: |
gcloud components install gke-gcloud-auth-plugin
- name: Setup kubectl
run: |
gcloud container clusters get-credentials dust-kube --region us-central1
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.INFRA_DISPATCH_APP_ID }}
private-key: ${{ secrets.INFRA_DISPATCH_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: |
dust-infra
- name: Rollback the deployment
run: |
kubectl rollout undo deployment/front-deployment
- name: Trigger dust-infra workflow
uses: actions/github-script@v6
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
await github.rest.repos.createDispatchEvent({
owner: '${{ github.repository_owner }}',
repo: 'dust-infra',
event_type: 'trigger-component-deploy',
client_payload: {
regions: 'us-central1',
component: 'front',
image_tag: '${{ inputs.image_tag }}',
slack_thread_ts: "${{ steps.build_message.outputs.thread_ts }}",
slack_channel: '${{ secrets.SLACK_CHANNEL_ID }}'
}
});
- name: Wait for rollback to complete
run: kubectl rollout status deployment/front-deployment --timeout=10m
- name: Notify Failure
if: failure()
uses: ./.github/actions/slack-notify
with:
step: "failure"
blocked: ${{ steps.check_deployment_blocked.outputs.blocked }}
component: "Revert front"
image_tag: ${{ inputs.image_tag }}
channel: ${{ secrets.SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_BOT_TOKEN }}
thread_ts: "${{ steps.build_message.outputs.thread_ts }}"
2 changes: 1 addition & 1 deletion connectors/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1c1b1e1

Please sign in to comment.