Skip to content

Commit

Permalink
Merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
albandum committed Nov 26, 2024
1 parent 1f0aa36 commit d728853
Show file tree
Hide file tree
Showing 76 changed files with 1,920 additions and 1,222 deletions.
2 changes: 1 addition & 1 deletion .github/actions/slack-notify/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ runs:
id: email
uses: slackapi/[email protected]
with:
errors: true
errors: false
method: users.lookupByEmail
token: ${{ inputs.slack_token }}
payload: |
Expand Down
70 changes: 53 additions & 17 deletions .github/workflows/deploy-dante.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ jobs:
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: "socks-proxy"
image_tag: ${{ steps.short_sha.outputs.short_sha }}
channel: ${{ secrets.SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_BOT_TOKEN }}

- name: "Authenticate with Google Cloud"
uses: "google-github-actions/auth@v1"
with:
Expand All @@ -33,29 +43,55 @@ jobs:
- 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-private --region us-central1
- name: Build the image on Cloud Build
run: |
mkdir empty
cp ./dante.Dockerfile empty
cd empty
chmod +x ../k8s/cloud-build.sh
../k8s/cloud-build.sh --image-name=dante --dockerfile-path=./dante.Dockerfile --working-dir=./ --gcloud-ignore-file=../.gcloudignore-dante --dust-client-facing-url=https://dust.tt
../k8s/cloud-build.sh \
--image-name=dante \
--dockerfile-path=./dante.Dockerfile \
--working-dir=./ \
--gcloud-ignore-file=../.gcloudignore-dante \
--dust-client-facing-url=https://dust.tt
cd ..
- name: Deploy the image on Kubernetes
run: |
chmod +x ./k8s/deploy-image.sh
./k8s/deploy-image.sh gcr.io/$GCLOUD_PROJECT_ID/dante-image:${{ steps.short_sha.outputs.short_sha }} socks-proxy-deployment socks-proxy
- 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: Wait for rollout to complete
run: |
echo "Waiting for rollout to complete"
kubectl rollout status deployment/socks-proxy-deployment --timeout=10m
- 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: 'socks-proxy',
image_tag: '${{ steps.short_sha.outputs.short_sha }}',
slack_thread_ts: "${{ steps.build_message.outputs.thread_ts }}",
slack_channel: '${{ secrets.SLACK_CHANNEL_ID }}'
}
});
- name: Notify Failure
if: failure()
uses: ./.github/actions/slack-notify
with:
step: "failure"
component: "socks-proxy"
image_tag: ${{ steps.short_sha.outputs.short_sha }}
channel: ${{ secrets.SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_BOT_TOKEN }}
thread_ts: "${{ steps.build_message.outputs.thread_ts }}"
73 changes: 53 additions & 20 deletions .github/workflows/deploy-nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,70 @@ jobs:
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: "http-proxy"
image_tag: ${{ steps.short_sha.outputs.short_sha }}
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-private --region us-central1
- name: Build the image on Cloud Build
run: |
mkdir empty
cp ./nginx.Dockerfile empty
cd empty
chmod +x ../k8s/cloud-build.sh
../k8s/cloud-build.sh --image-name=nginx-proxy --dockerfile-path=./nginx.Dockerfile --working-dir=./ --gcloud-ignore-file=../.gcloudignore-nginx --dust-client-facing-url=https://dust.tt
../k8s/cloud-build.sh \
--image-name=nginx-proxy \
--dockerfile-path=./nginx.Dockerfile \
--working-dir=./ \
--gcloud-ignore-file=../.gcloudignore-nginx \
--dust-client-facing-url=https://dust.tt
cd ..
- name: Deploy the image on Kubernetes
run: |
chmod +x ./k8s/deploy-image.sh
./k8s/deploy-image.sh gcr.io/$GCLOUD_PROJECT_ID/nginx-proxy-image:${{ steps.short_sha.outputs.short_sha }} proxy-deployment proxy
- 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: Wait for rollout to complete
run: |
echo "Waiting for rollout to complete"
kubectl rollout status deployment/proxy-deployment --timeout=10m
- 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: 'http-proxy',
image_tag: '${{ steps.short_sha.outputs.short_sha }}',
slack_thread_ts: "${{ steps.build_message.outputs.thread_ts }}",
slack_channel: '${{ secrets.SLACK_CHANNEL_ID }}'
}
});
- name: Notify Failure
if: failure()
uses: ./.github/actions/slack-notify
with:
step: "failure"
component: "http-proxy"
image_tag: ${{ steps.short_sha.outputs.short_sha }}
channel: ${{ secrets.SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_BOT_TOKEN }}
thread_ts: "${{ steps.build_message.outputs.thread_ts }}"
11 changes: 11 additions & 0 deletions connectors/migrations/db/migration_39.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
DELETE FROM
"zendesk_timestamp_cursors"
WHERE
"timestampCursor" IS NULL;

ALTER TABLE
"zendesk_timestamp_cursors"
ALTER COLUMN
"timestampCursor"
SET
NOT NULL;
4 changes: 2 additions & 2 deletions connectors/src/admin/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ import {
ZendeskCategory,
ZendeskConfiguration,
ZendeskTicket,
ZendeskTimestampCursors,
ZendeskTimestampCursor,
} from "@connectors/lib/models/zendesk";
import logger from "@connectors/logger/logger";
import { sequelizeConnection } from "@connectors/resources/storage";
Expand Down Expand Up @@ -121,7 +121,7 @@ async function main(): Promise<void> {
await RemoteDatabaseModel.sync({ alter: true });
await RemoteSchemaModel.sync({ alter: true });
await RemoteTableModel.sync({ alter: true });
await ZendeskTimestampCursors.sync({ alter: true });
await ZendeskTimestampCursor.sync({ alter: true });
await ZendeskConfiguration.sync({ alter: true });
await ZendeskBrand.sync({ alter: true });
await ZendeskCategory.sync({ alter: true });
Expand Down
Loading

0 comments on commit d728853

Please sign in to comment.