Skip to content

Commit

Permalink
neonvm: Switch to kernel 6.1.63 (#638)
Browse files Browse the repository at this point in the history
New kernel config is adapted from the existing 5.15.80 config.

At some point, we'd like to standardize our diff to some other public
kernel config (e.g. cloud-hypervisor or kata containers), but right now
it's important to get the immediate improvements from the upgrade.

Co-authored-by: Andrey Taranik <[email protected]>
  • Loading branch information
sharnoff and cicdteam authored Nov 22, 2023
1 parent e3a4cff commit 6cf6227
Show file tree
Hide file tree
Showing 5 changed files with 3,498 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
docker rm -f ${ID}
env:
VM_KERNEL_IMAGE: "neondatabase/vm-kernel"
VM_KERNEL_VERSION: "5.15.80"
VM_KERNEL_VERSION: "6.1.63"

# our docker builds use the output of 'git describe' for embedding git information
- run: git describe --long --dirty
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vm-kernel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:

env:
VM_KERNEL_IMAGE: "neondatabase/vm-kernel"
VM_KERNEL_VERSION: "5.15.80"
VM_KERNEL_VERSION: "6.1.63"

jobs:
vm-kernel:
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ E2E_TESTS_VM_IMG ?= vm-postgres:15-bullseye
PG14_DISK_TEST_IMG ?= pg14-disk-test:dev

# kernel for guests
VM_KERNEL_VERSION ?= "5.15.80"
VM_KERNEL_VERSION ?= "6.1.63"

## Golang details
GOARCH ?= $(shell go env GOARCH)
Expand Down Expand Up @@ -222,6 +222,7 @@ kernel: ## Build linux kernel.
--build-arg KERNEL_VERSION=$(VM_KERNEL_VERSION) \
--platform linux/amd64 \
--pull \
--load \
--iidfile $$iidfile \
--file neonvm/hack/Dockerfile.kernel-builder \
neonvm/hack; \
Expand Down
24 changes: 15 additions & 9 deletions neonvm/hack/Dockerfile.kernel-builder
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:11 AS build-deps
FROM ubuntu:23.10 AS build-deps

ARG KERNEL_VERSION

Expand All @@ -11,7 +11,6 @@ WORKDIR /build
RUN apt-get update && apt-get -y install \
curl \
ca-certificates \
git \
build-essential \
flex \
bison \
Expand All @@ -24,17 +23,24 @@ RUN apt-get update && apt-get -y install \
libncurses-dev

RUN set -e \
&& mkdir linux \
&& curl -sfL https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-${KERNEL_VERSION}.tar.xz -o linux-${KERNEL_VERSION} \
&& tar --strip-components=1 -C linux -xf linux-${KERNEL_VERSION}
&& mkdir -p linux-${KERNEL_VERSION} \
&& echo "downloading linux-${KERNEL_VERSION}.tar.xz" \
&& MAJOR=`echo ${KERNEL_VERSION} | sed -E 's/^([0-9]+)\.[0-9]+\.[0-9]+$/\1/'` \
&& curl -sfL https://cdn.kernel.org/pub/linux/kernel/v${MAJOR}.x/linux-${KERNEL_VERSION}.tar.xz -o linux-${KERNEL_VERSION}.tar.xz \
&& echo "unpacking kernel archive" \
&& tar --strip-components=1 -C linux-${KERNEL_VERSION} -xf linux-${KERNEL_VERSION}.tar.xz


FROM build-deps AS build

ADD linux-config-${KERNEL_VERSION} linux/.config
ARG KERNEL_VERSION

ADD linux-config-${KERNEL_VERSION} linux-${KERNEL_VERSION}/.config

RUN cd linux && make -j `nproc`
RUN cd linux-${KERNEL_VERSION} && make -j `nproc`

# Use alpine so that `cp` is available when loading custom kernels for the runner pod.
# See the neonvm controller's pod creation logic for more detail.
FROM alpine:3.16
COPY --from=build /build/linux/arch/x86/boot/bzImage /vmlinuz
FROM alpine:3.18
ARG KERNEL_VERSION
COPY --from=build /build/linux-${KERNEL_VERSION}/arch/x86/boot/bzImage /vmlinuz
Loading

0 comments on commit 6cf6227

Please sign in to comment.