From 2c3e99f637561b727543e3174add9f90b4e95013 Mon Sep 17 00:00:00 2001 From: Evgeniy Abramov Date: Sat, 1 Feb 2025 15:54:45 +0800 Subject: [PATCH 1/4] chore: savepoint --- .github/workflows/deploy.yml | 54 ++++++++++++++++++++++++++++++++++++ .helm/values.yaml | 0 devenv.nix | 5 ++++ werf-giterminism.yaml | 7 +++++ werf.yaml | 13 +++++++++ 5 files changed, 79 insertions(+) create mode 100644 .github/workflows/deploy.yml create mode 100644 .helm/values.yaml create mode 100644 werf-giterminism.yaml create mode 100644 werf.yaml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..3162236 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,54 @@ +--- + name: Klickhouse Example - Deploy + + on: + workflow_dispatch: + + permissions: + contents: read + packages: write + + jobs: + converge: + runs-on: deploy + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + install: true + driver-opts: image=moby/buildkit:latest + buildkitd-flags: --debug + + - name: Cache Werf Stages + uses: actions/cache@v4 + with: + path: ~/.werf/local_cache + key: ${{ runner.os }}-werf-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-werf- + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Converge + uses: werf/actions/converge@v2 + with: + env: production + kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} + env: + WERF_REPO: ghcr.io/katanacap/klickhouse-example + WERF_SECRET_KEY: ${{ secrets.WERF_SECRET_KEY }} + DOCKER_BUILDKIT: 1 + WERF_LOG_VERBOSE: "on" + WERF_DOCKER_SERVER_STORAGE_DRIVER: overlay2 + WERF_BUILDAH_MODE: auto + \ No newline at end of file diff --git a/.helm/values.yaml b/.helm/values.yaml new file mode 100644 index 0000000..e69de29 diff --git a/devenv.nix b/devenv.nix index e7a5d16..1a617da 100644 --- a/devenv.nix +++ b/devenv.nix @@ -13,6 +13,11 @@ pkgs.cargo-audit pkgs.just pkgs.tree + pkgs.werf + pkgs.kubernetes-helm + pkgs.vault-medusa + # pkgs.vault-bin + # pkgs.ngrok ] ++ lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk; [ frameworks.SystemConfiguration frameworks.Security diff --git a/werf-giterminism.yaml b/werf-giterminism.yaml new file mode 100644 index 0000000..9c7a928 --- /dev/null +++ b/werf-giterminism.yaml @@ -0,0 +1,7 @@ +configVersion: 1 + +--- +giterminism: + config: + allowUncommitted: true + \ No newline at end of file diff --git a/werf.yaml b/werf.yaml new file mode 100644 index 0000000..1f6d9c1 --- /dev/null +++ b/werf.yaml @@ -0,0 +1,13 @@ +project: klickhouse-example + +configVersion: 1 + +--- +image: klickhouse-example +dockerfile: Dockerfile + +--- +deploy: + helmChartDir: .helm + values: + - .helm/values.yaml \ No newline at end of file From c68213471d6cb13987d2a20a5b9858f5d04697f8 Mon Sep 17 00:00:00 2001 From: Evgeniy Abramov Date: Sat, 1 Feb 2025 15:56:08 +0800 Subject: [PATCH 2/4] chore: savepoint --- werf-giterminism.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/werf-giterminism.yaml b/werf-giterminism.yaml index 9c7a928..70e7599 100644 --- a/werf-giterminism.yaml +++ b/werf-giterminism.yaml @@ -1,4 +1,4 @@ -configVersion: 1 +giterminismConfigVersion: 1 --- giterminism: From 0290020198646f44d805470867d33cef0a7aa3cd Mon Sep 17 00:00:00 2001 From: Evgeniy Abramov Date: Sat, 1 Feb 2025 19:36:37 +0800 Subject: [PATCH 3/4] chore: start implement werf deploy --- .env | 1 + devenv.nix | 1 + werf-giterminism.yaml | 1 - werf.yaml | 12 ++++-------- Dockerfile => x86.Dockerfile | 0 5 files changed, 6 insertions(+), 9 deletions(-) create mode 100644 .env rename Dockerfile => x86.Dockerfile (100%) diff --git a/.env b/.env new file mode 100644 index 0000000..3d431bc --- /dev/null +++ b/.env @@ -0,0 +1 @@ +DOCKERFILE_NAME=aarch64.Dockerfile \ No newline at end of file diff --git a/devenv.nix b/devenv.nix index 1a617da..d6c5667 100644 --- a/devenv.nix +++ b/devenv.nix @@ -46,4 +46,5 @@ # }; env.CLICKHOUSE_ADDR = "127.0.0.1:9111"; + env.DOCKERFILE_NAME = "aarch64.Dockerfile"; # for local development on mac aarch64 } diff --git a/werf-giterminism.yaml b/werf-giterminism.yaml index 70e7599..f8cb0c5 100644 --- a/werf-giterminism.yaml +++ b/werf-giterminism.yaml @@ -4,4 +4,3 @@ giterminismConfigVersion: 1 giterminism: config: allowUncommitted: true - \ No newline at end of file diff --git a/werf.yaml b/werf.yaml index 1f6d9c1..38501bf 100644 --- a/werf.yaml +++ b/werf.yaml @@ -1,13 +1,9 @@ +configVersion: 1 project: klickhouse-example -configVersion: 1 --- image: klickhouse-example -dockerfile: Dockerfile - ---- -deploy: - helmChartDir: .helm - values: - - .helm/values.yaml \ No newline at end of file +dockerfile: ./x86.Dockerfile +platform: +- linux/amd64 \ No newline at end of file diff --git a/Dockerfile b/x86.Dockerfile similarity index 100% rename from Dockerfile rename to x86.Dockerfile From 0c7f8a75115e9a8e7e3e65cb52c7490d8a62c641 Mon Sep 17 00:00:00 2001 From: Evgeniy Abramov Date: Sat, 8 Feb 2025 08:58:16 +0800 Subject: [PATCH 4/4] chore(ci): use latest nightly on main ci workflow --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c9d4697..647c331 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ jobs: matrix: include: - { rust: stable, os: ubuntu-24.04, jobname: "stable" } - - { rust: nightly-2025-01-19, os: ubuntu-24.04, jobname: "nightly" } + - { rust: nightly, os: ubuntu-24.04, jobname: "nightly" } services: clickhouse: image: clickhouse/clickhouse-server:24.8.12.28 @@ -65,7 +65,7 @@ jobs: fail-fast: false matrix: include: - - { rust: nightly-2025-01-19, os: ubuntu-24.04 } + - { rust: nightly, os: ubuntu-24.04 } steps: - name: Checkout uses: actions/checkout@v4