From 8833d87944416929cfa3fb09d49e83da71980873 Mon Sep 17 00:00:00 2001 From: Jaz Volpert Date: Wed, 13 Nov 2024 21:39:54 +0000 Subject: [PATCH 1/5] Use a custom Go build with netpoller fixes --- cmd/bigsky/Dockerfile | 27 ++++++++++++++++++++++++--- cmd/bigsky/custom_go.Dockerfile | 20 ++++++++++++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 cmd/bigsky/custom_go.Dockerfile diff --git a/cmd/bigsky/Dockerfile b/cmd/bigsky/Dockerfile index 5b80aef8f..4534788ac 100644 --- a/cmd/bigsky/Dockerfile +++ b/cmd/bigsky/Dockerfile @@ -2,17 +2,38 @@ # # podman build -f ./cmd/bigsky/Dockerfile -t bigsky . -### Compile stage -FROM golang:1.22-alpine3.19 AS build-env +FROM golang:1.23.3-alpine3.19 AS custom-go RUN apk add --no-cache build-base make git +# Clone go source +RUN git clone https://go.googlesource.com/go /gosource + +WORKDIR /gosource + +# Checkout go version 1.23.3 +RUN git checkout go1.23.3 + +# Cherry pick the CL +RUN git fetch https://go.googlesource.com/go refs/changes/97/564197/1 && git cherry-pick FETCH_HEAD + +# Build go +RUN ./src/all.bash + +# Copy the artifacts to /export +RUN mkdir -p /export +RUN cp /gosource/bin/go /export/go + + +### Compile stage +FROM custom-go AS build-env + ADD . /dockerbuild WORKDIR /dockerbuild # timezone data for alpine builds ENV GOEXPERIMENT=loopvar RUN GIT_VERSION=$(git describe --tags --long --always) && \ - go build -tags timetzdata -o /bigsky ./cmd/bigsky + /export/go build -tags timetzdata -o /bigsky ./cmd/bigsky ### Build Frontend stage FROM node:18-alpine as web-builder diff --git a/cmd/bigsky/custom_go.Dockerfile b/cmd/bigsky/custom_go.Dockerfile new file mode 100644 index 000000000..12090a0f2 --- /dev/null +++ b/cmd/bigsky/custom_go.Dockerfile @@ -0,0 +1,20 @@ +FROM golang:1.23.3-alpine3.19 AS custom-go +RUN apk add --no-cache build-base make git + +# Clone go source +RUN git clone https://go.googlesource.com/go /gosource + +WORKDIR /gosource + +# Checkout go version 1.23.3 +RUN git checkout go1.23.3 + +# Cherry pick the CL +RUN git fetch https://go.googlesource.com/go refs/changes/97/564197/1 && git cherry-pick FETCH_HEAD + +# Build go +RUN ./src/all.bash + +# Copy the artifacts to /export +RUN mkdir -p /export +RUN cp /gosource/bin/go /export/go From 814e8e4fc71fabaa3dd4fa1aa66569587db9767b Mon Sep 17 00:00:00 2001 From: Jaz Volpert Date: Wed, 13 Nov 2024 23:02:17 +0000 Subject: [PATCH 2/5] Git config --- cmd/bigsky/Dockerfile | 4 ++++ cmd/bigsky/custom_go.Dockerfile | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/cmd/bigsky/Dockerfile b/cmd/bigsky/Dockerfile index 4534788ac..74a53a5ec 100644 --- a/cmd/bigsky/Dockerfile +++ b/cmd/bigsky/Dockerfile @@ -5,6 +5,10 @@ FROM golang:1.23.3-alpine3.19 AS custom-go RUN apk add --no-cache build-base make git +# Git config +RUN git config --global user.email "automated_action_runner@github" +RUN git config --global user.name "automated_action_runner" + # Clone go source RUN git clone https://go.googlesource.com/go /gosource diff --git a/cmd/bigsky/custom_go.Dockerfile b/cmd/bigsky/custom_go.Dockerfile index 12090a0f2..5ae5cff54 100644 --- a/cmd/bigsky/custom_go.Dockerfile +++ b/cmd/bigsky/custom_go.Dockerfile @@ -1,6 +1,10 @@ FROM golang:1.23.3-alpine3.19 AS custom-go RUN apk add --no-cache build-base make git +# Git config +RUN git config --global user.email "automated_action_runner@github" +RUN git config --global user.name "automated_action_runner" + # Clone go source RUN git clone https://go.googlesource.com/go /gosource From 2c85c0690f3c19cc8685b8a42b7ad56a5d032ac0 Mon Sep 17 00:00:00 2001 From: Jaz Volpert Date: Wed, 13 Nov 2024 23:20:06 +0000 Subject: [PATCH 3/5] Build on bookworm? --- cmd/bigsky/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/bigsky/Dockerfile b/cmd/bigsky/Dockerfile index 74a53a5ec..ff2eb961d 100644 --- a/cmd/bigsky/Dockerfile +++ b/cmd/bigsky/Dockerfile @@ -2,7 +2,7 @@ # # podman build -f ./cmd/bigsky/Dockerfile -t bigsky . -FROM golang:1.23.3-alpine3.19 AS custom-go +FROM golang:1.23.3-bookworm AS custom-go RUN apk add --no-cache build-base make git # Git config @@ -40,7 +40,7 @@ RUN GIT_VERSION=$(git describe --tags --long --always) && \ /export/go build -tags timetzdata -o /bigsky ./cmd/bigsky ### Build Frontend stage -FROM node:18-alpine as web-builder +FROM node:18-alpine AS web-builder WORKDIR /app From 155383cab8916f3da1be54b5b6b5334f54a64d0c Mon Sep 17 00:00:00 2001 From: Jaz Volpert Date: Wed, 13 Nov 2024 23:22:16 +0000 Subject: [PATCH 4/5] Use apt --- cmd/bigsky/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/bigsky/Dockerfile b/cmd/bigsky/Dockerfile index ff2eb961d..5b81ddc04 100644 --- a/cmd/bigsky/Dockerfile +++ b/cmd/bigsky/Dockerfile @@ -3,7 +3,7 @@ # podman build -f ./cmd/bigsky/Dockerfile -t bigsky . FROM golang:1.23.3-bookworm AS custom-go -RUN apk add --no-cache build-base make git +RUN apt update && apt install -y build-essential make git # Git config RUN git config --global user.email "automated_action_runner@github" From e3767d1af5ab0e89f29a4eb562c958deb3282813 Mon Sep 17 00:00:00 2001 From: Jaz Volpert Date: Wed, 13 Nov 2024 23:31:38 +0000 Subject: [PATCH 5/5] Build stuff --- cmd/bigsky/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/bigsky/Dockerfile b/cmd/bigsky/Dockerfile index 5b81ddc04..8418b84cf 100644 --- a/cmd/bigsky/Dockerfile +++ b/cmd/bigsky/Dockerfile @@ -20,8 +20,10 @@ RUN git checkout go1.23.3 # Cherry pick the CL RUN git fetch https://go.googlesource.com/go refs/changes/97/564197/1 && git cherry-pick FETCH_HEAD +WORKDIR /gosource/src + # Build go -RUN ./src/all.bash +RUN ./all.bash # Copy the artifacts to /export RUN mkdir -p /export