Skip to content

Commit

Permalink
neonvmd: moved neonvm/daemon -> neonvm-daemon to comply with new repo…
Browse files Browse the repository at this point in the history
… flatten structure

Signed-off-by: Misha Sakhnov <[email protected]>
  • Loading branch information
mikhail-sakhnov committed Oct 11, 2024
1 parent e9198cd commit 1e3c8a8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-test-vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:

env:
IMG_POSTGRES_16_BULLSEYE: "neondatabase/vm-postgres-16-bullseye"
# using locally build base image
# using image built in the same workflow
IMG_DAEMON: "daemon:dev"

defaults:
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 docker-build-daemon
- run: make bin/vm-builder

- name: upload vm-builder
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ 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: docker-build-daemon ## Build vm-builder binary.
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}" vm-builder/main.go
.PHONY: run
run: fmt vet ## Run a controller from your host.
Expand Down Expand Up @@ -191,7 +191,7 @@ docker-build-runner: docker-build-go-base ## Build docker image for NeonVM runne
docker-build-daemon: ## Build docker image for NeonVM daemon.
docker build \
--tag $(IMG_DAEMON) \
--file neonvm/daemon/Dockerfile \
--file neonvm-daemon/Dockerfile \
.

.PHONY: docker-build-vxlan-controller
Expand Down
2 changes: 1 addition & 1 deletion neonvm/daemon/Dockerfile → neonvm-daemon/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM golang:1.23-alpine AS builder
COPY . .

# Build
RUN CGO_ENABLED=0 go build -a -o /neonvmd neonvm/daemon/main.go
RUN CGO_ENABLED=0 go build -o /neonvmd neonvm-daemon/main.go

FROM scratch
COPY --from=builder /neonvmd /neonvmd
File renamed without changes.
10 changes: 3 additions & 7 deletions vm-builder/files/Dockerfile.img
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM {{.RootDiskImage}} AS rootdisk
USER root
{{.SpecMerge}}

FROM {{.NeonvmDaemonImage}} AS vm-daemon-loader
FROM {{.NeonvmDaemonImage}} AS neonvm-daemon-loader

FROM alpine:3.19 AS vm-runtime
# add busybox
Expand All @@ -21,9 +21,6 @@ RUN set -e \
COPY helper.move-bins.sh /helper.move-bins.sh

# add udevd and agetty (with shared libs)
#
# We need unshare and nsenter from util-linux-misc because buxybox's implementations don't have
# support for cgroup namespaces (at least, master as of 2024-08-11).
RUN set -e \
&& apk add --no-cache --no-progress --quiet \
acpid \
Expand All @@ -42,7 +39,6 @@ RUN set -e \
udevadm \
agetty \
su-exec \
unshare nsenter \
cgexec \
resize2fs \
blkid \
Expand Down Expand Up @@ -74,7 +70,7 @@ RUN set -e \
quota-tools \
&& /helper.move-bins.sh quota edquota quotacheck quotaoff quotaon quotastats setquota repquota tune2fs

COPY --from=vm-daemon-loader /neonvmd /neonvm/bin/neonvmd
COPY --from=neonvm-daemon-loader /neonvmd /neonvm/bin/neonvmd

# init scripts & configs
COPY inittab /neonvm/bin/inittab
Expand Down Expand Up @@ -108,7 +104,7 @@ RUN set -e \
&& /neonvm/bin/id -g sshd > /dev/null 2>&1 || /neonvm/bin/addgroup sshd \
&& /neonvm/bin/id -u sshd > /dev/null 2>&1 || /neonvm/bin/adduser -D -H -G sshd -g 'sshd privsep' -s /neonvm/bin/nologin sshd

FROM vm-runtime AS builder
FROM alpine:3.19 AS builder
ARG DISK_SIZE
COPY --from=rootdisk-mod / /rootdisk

Expand Down

0 comments on commit 1e3c8a8

Please sign in to comment.