Skip to content

Commit

Permalink
Build core image with heaptrack
Browse files Browse the repository at this point in the history
  • Loading branch information
flvndvd committed Jul 15, 2024
1 parent 5e22406 commit 30dc788
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
59 changes: 59 additions & 0 deletions .github/workflows/deploy-core-heaptrack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy Core

on:
workflow_dispatch:

concurrency:
group: deploy_core
cancel-in-progress: false

env:
GCLOUD_PROJECT_ID: ${{ secrets.GCLOUD_PROJECT_ID }}

jobs:
build-and-deploy:
runs-on: ubuntu-latest

# if: github.ref == 'refs/heads/main'

steps:
- 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: "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: Build the image on Cloud Build
run: |
chmod +x ./k8s/cloud-build.sh
./k8s/cloud-build.sh core ./Dockerfile ./core/
# - name: Deploy the image on Kubernetes
# run: |
# chmod +x ./k8s/deploy-image.sh
# ./k8s/deploy-image.sh gcr.io/$GCLOUD_PROJECT_ID/core-image:${{ steps.short_sha.outputs.short_sha }} core-deployment
# ./k8s/deploy-image.sh gcr.io/$GCLOUD_PROJECT_ID/core-image:${{ steps.short_sha.outputs.short_sha }} core-sqlite-worker-deployment

# - name: Wait for rollout to complete
# run: |
# echo "Waiting for rollout to complete (web)"
# kubectl rollout status deployment/core-deployment --timeout=10m
# echo "Waiting for rollout to complete (sqlite worker)"
# kubectl rollout status deployment/core-sqlite-worker-deployment --timeout=10m
2 changes: 1 addition & 1 deletion core/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM rust:1.79.0 as core

RUN apt-get update && apt-get install -y vim redis-tools postgresql-client htop cmake
RUN apt-get update && apt-get install -y vim redis-tools postgresql-client htop cmake heaptrack

WORKDIR /app

Expand Down

0 comments on commit 30dc788

Please sign in to comment.