From ef3a7101494a6893e1846efcc91d4d246908efb4 Mon Sep 17 00:00:00 2001 From: Misha Sakhnov Date: Thu, 5 Dec 2024 13:30:18 +0200 Subject: [PATCH 1/2] ci: build neonvm-daemon in build-images.yaml Signed-off-by: Misha Sakhnov --- .github/workflows/build-images.yaml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index 50ff027da..c24261c3d 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -46,7 +46,10 @@ on: autoscaler-agent: description: 'autoscaler-agent image' value: ${{ jobs.tags.outputs.autoscaler-agent }} - + daemon: + description: 'neonvm-daemon image' + value: ${{ jobs.tags.outputs.daemon }} + env: IMG_CONTROLLER: "neondatabase/neonvm-controller" IMG_VXLAN_CONTROLLER: "neondatabase/neonvm-vxlan-controller" @@ -54,6 +57,7 @@ env: IMG_KERNEL: "neondatabase/vm-kernel" IMG_SCHEDULER: "neondatabase/autoscale-scheduler" IMG_AUTOSCALER_AGENT: "neondatabase/autoscaler-agent" + IMG_DAEMON: "neondatabase/neonvm-daemon" IMG_CLUSTER_AUTOSCALER: "neondatabase/cluster-autoscaler-neonvm" ECR_DEV: "369495373322.dkr.ecr.eu-central-1.amazonaws.com" ECR_PROD: "093970136003.dkr.ecr.eu-central-1.amazonaws.com" @@ -78,6 +82,7 @@ jobs: scheduler: ${{ steps.show-tags.outputs.scheduler }} autoscaler-agent: ${{ steps.show-tags.outputs.autoscaler-agent }} cluster-autoscaler: ${{ steps.show-tags.outputs.cluster-autoscaler }} + daemon: ${{ steps.show-tags.outputs.daemon }} runs-on: ubuntu-latest steps: - id: show-tags @@ -88,6 +93,7 @@ jobs: echo "scheduler=${{ env.IMG_SCHEDULER }}:${{ inputs.tag }}" | tee -a $GITHUB_OUTPUT echo "autoscaler-agent=${{ env.IMG_AUTOSCALER_AGENT }}:${{ inputs.tag }}" | tee -a $GITHUB_OUTPUT echo "cluster-autoscaler=${{ env.IMG_CLUSTER_AUTOSCALER }}:${{ inputs.tag }}" | tee -a $GITHUB_OUTPUT + echo "daemon=${{ env.IMG_DAEMON }}:${{ inputs.tag }}" | tee -a $GITHUB_OUTPUT vm-kernel: # nb: use format(..) to catch both inputs.skip = true AND inputs.skip = 'true'. @@ -291,6 +297,19 @@ jobs: GO_BASE_IMG=${{ env.GO_BASE_IMG }} GIT_INFO=${{ steps.get-git-info.outputs.info }} + - name: Build and push neonvm-daemon image + uses: docker/build-push-action@v6 + with: + context: . + platforms: linux/amd64 + push: true + file: neonvm-daemon/Dockerfile + cache-from: type=registry,ref=cache.neon.build/neonvm-daemon:cache + cache-to: ${{ github.ref_name == 'main' && 'type=registry,ref=cache.neon.build/neonvm-daemon:cache,mode=max' || '' }} + tags: ${{ needs.tags.outputs.daemon }} + build-args: | + GO_BASE_IMG=${{ env.GO_BASE_IMG }} + - name: Build and push cluster-autoscaler image uses: docker/build-push-action@v6 if: ${{ format('{0}', inputs.build-cluster-autoscaler) == 'true' }} @@ -309,6 +328,7 @@ jobs: neonvm-controller \ neonvm-vxlan-controller \ neonvm-runner \ + neonvm-daemon \ vm-kernel \ autoscale-scheduler \ autoscaler-agent \ From 1977c04a3de8c5b346159d118d3117323b2638c6 Mon Sep 17 00:00:00 2001 From: Misha Sakhnov Date: Thu, 5 Dec 2024 17:41:21 +0200 Subject: [PATCH 2/2] ci: change default tag value for neon vm daemon Signed-off-by: Misha Sakhnov --- .github/workflows/build-test-vm.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test-vm.yaml b/.github/workflows/build-test-vm.yaml index 9fb28e0da..c63c5c4eb 100644 --- a/.github/workflows/build-test-vm.yaml +++ b/.github/workflows/build-test-vm.yaml @@ -30,7 +30,7 @@ on: env: IMG_POSTGRES_16_BULLSEYE: "neondatabase/vm-postgres-16-bullseye" # using image built in the same workflow - IMG_DAEMON: "daemon:dev" + IMG_DAEMON: "neondatabase/neonvm-daemon" defaults: run: @@ -46,13 +46,15 @@ jobs: - id: show-tags run: | echo "vm-postgres-16-bullseye=${{ env.IMG_POSTGRES_16_BULLSEYE }}:${{ inputs.tag }}" | tee -a $GITHUB_OUTPUT - echo "daemon=${{ env.IMG_DAEMON }}" | tee -a $GITHUB_OUTPUT + echo "daemon=${{ env.IMG_DAEMON }}:${{ inputs.tag }}" | tee -a $GITHUB_OUTPUT build: # nb: use format(..) to catch both inputs.skip = true AND inputs.skip = 'true'. if: ${{ format('{0}', inputs.skip) != 'true' }} needs: tags runs-on: [ self-hosted, gen3, large ] + env: + IMG_DAEMON: ${{ needs.tags.outputs.daemon }} steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5