Skip to content

Commit

Permalink
neonvmd: build neonvmd image in the build-test-vm workflow to prevent…
Browse files Browse the repository at this point in the history
… races with build-images workflow

Signed-off-by: Misha Sakhnov <[email protected]>
  • Loading branch information
mikhail-sakhnov committed Oct 14, 2024
1 parent 9743e68 commit 5b59f8a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 27 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,11 @@ 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"
IMG_RUNNER: "neondatabase/neonvm-runner"
IMG_DAEMON: "neondatabase/neonvm-daemon"
IMG_KERNEL: "neondatabase/vm-kernel"
IMG_SCHEDULER: "neondatabase/autoscale-scheduler"
IMG_AUTOSCALER_AGENT: "neondatabase/autoscaler-agent"
Expand Down Expand Up @@ -82,15 +78,13 @@ 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
run: |
echo "controller=${{ env.IMG_CONTROLLER }}:${{ inputs.tag }}" | tee -a $GITHUB_OUTPUT
echo "vxlan-controller=${{ env.IMG_VXLAN_CONTROLLER }}:${{ inputs.tag }}" | tee -a $GITHUB_OUTPUT
echo "runner=${{ env.IMG_RUNNER }}:${{ inputs.tag }}" | tee -a $GITHUB_OUTPUT
echo "daemon=${{ env.IMG_DAEMON }}:${{ inputs.tag }}" | tee -a $GITHUB_OUTPUT
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
Expand Down Expand Up @@ -236,17 +230,6 @@ jobs:
build-args: |
GO_BASE_IMG=${{ env.GO_BASE_IMG }}
# - name: Build and push neonvm-daemon image
# uses: docker/build-push-action@v3
# with:
# context: .
# platforms: linux/amd64
# push: true
# file: neonvm/daemon/Dockerfile
# tags: ${{ needs.tags.outputs.daemon }}
# build-args: |
# GO_BASE_IMG=${{ env.GO_BASE_IMG }}

- name: Generate neonvm-controller build tags
id: controller-build-tags
env:
Expand Down Expand Up @@ -334,7 +317,6 @@ jobs:
neonvm-controller \
neonvm-vxlan-controller \
neonvm-runner \
neonvm-daemon \
vm-kernel \
autoscale-scheduler \
autoscaler-agent \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-test-vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ on:
env:
IMG_POSTGRES_16_BULLSEYE: "neondatabase/vm-postgres-16-bullseye"
# using locally build base image
IMG_DAEMON: "autoscaling-go-base:dev"
IMG_DAEMON: "daemon:dev"

defaults:
run:
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
cache: false
# Sometimes setup-go gets stuck. Without this, it'll keep going until the job gets killed
timeout-minutes: 10

- run: make bin/vm-builder

- name: upload vm-builder
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ jobs:
IMG_CONTROLLER: ${{ needs.build-images.outputs.controller }}
IMG_VXLAN_CONTROLLER: ${{ needs.build-images.outputs.vxlan-controller }}
IMG_RUNNER: ${{ needs.build-images.outputs.runner }}
IMG_DAEMON: ${{ needs.build-images.outputs.daemon }}
IMG_SCHEDULER: ${{ needs.build-images.outputs.scheduler }}
IMG_AUTOSCALER_AGENT: ${{ needs.build-images.outputs.autoscaler-agent }}

Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ build: fmt vet bin/vm-builder ## Build all neonvm binaries.
GOOS=linux go build -o bin/runner neonvm/runner/*.go

.PHONY: bin/vm-builder
bin/vm-builder: ## Build vm-builder binary.
GOOS=linux CGO_ENABLED=0 go build -o bin/vm-builder -ldflags "-X main.Version=${GIT_INFO}" -X main.NeonvmDaemonImage=${IMG_DAEMON}" neonvm/tools/vm-builder/main.go
bin/vm-builder: docker-build-daemon ## Build vm-builder binary.
GOOS=linux CGO_ENABLED=0 go build -o bin/vm-builder -ldflags "-X main.Version=${GIT_INFO} -X main.NeonvmDaemonImage=${IMG_DAEMON}" vm-builder/main.go
.PHONY: run
run: fmt vet ## Run a controller from your host.
go run ./neonvm/main.go
Expand Down Expand Up @@ -188,10 +188,9 @@ docker-build-runner: docker-build-go-base ## Build docker image for NeonVM runne
.

.PHONY: docker-build-daemon
docker-build-daemon: docker-build-go-base ## Build docker image for NeonVM daemon.
docker-build-daemon: ## Build docker image for NeonVM daemon.
docker build \
--tag $(IMG_DAEMON) \
--build-arg GO_BASE_IMG=$(GO_BASE_IMG) \
--file neonvm/daemon/Dockerfile \
.

Expand Down
3 changes: 1 addition & 2 deletions neonvm/daemon/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ARG GO_BASE_IMG=autoscaling-go-base:dev
FROM $GO_BASE_IMG AS builder
FROM golang:1.23-alpine AS builder

# Build the Go binary
COPY . .
Expand Down

0 comments on commit 5b59f8a

Please sign in to comment.