Skip to content

Commit

Permalink
Bump docker base image to golang:1.22-bookworm (stop test failing) (#…
Browse files Browse the repository at this point in the history
…433)
  • Loading branch information
AriehSchneier authored Mar 14, 2024
1 parent 9c64362 commit 7e48a22
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 39 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
runs-on: ${{ vars.RUNNER_UBUNTU && fromJSON(vars.RUNNER_UBUNTU) || 'ubuntu-latest' }}
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
docker.io/anzbank/sysl-go
Expand All @@ -34,7 +34,7 @@ jobs:
org.opencontainers.image.url=https://sysl.io
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Build test docker container image
run: |
Expand All @@ -61,15 +61,15 @@ jobs:
- name: Login to DockerHub
# only attempt to push if we are in the open source repo that has credentials, and there's been a push, not merely a pull request.
if: github.repository == 'anz-bank/sysl-go' && github.event_name == 'push'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}

- name: Build and push docker container image
# only attempt to push if we are in the open source repo that has credentials, and there's been a push, not merely a pull request.
if: github.repository == 'anz-bank/sysl-go' && github.event_name == 'push'
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
pull: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generate-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
runs-on: ${{ vars.RUNNER_UBUNTU && fromJSON(vars.RUNNER_UBUNTU) || 'ubuntu-latest' }}
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: '0'

- name: Checkout github-tag-action
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ vars.GENERATE_TAG_REPO || 'anothrNick/github-tag-action' }}
ref: ${{ vars.GENERATE_TAG_REF || '1.62.0' }}
Expand Down
23 changes: 3 additions & 20 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
runs-on: ${{ vars.RUNNER_UBUNTU && fromJSON(vars.RUNNER_UBUNTU) || 'ubuntu-latest' }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Build docker container image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
file: builder.Dockerfile
Expand All @@ -39,22 +39,5 @@ jobs:
- name: "make all"
run: docker run --rm -v $(pwd):/work -w /work --entrypoint "/usr/bin/make" ci-builder all

- name: "hack - workaround github actions runner filesystem permission issue"
# This hack should not be necessary, but if we don't do it, the
# next step fails during docker build as docker does not have
# permission to read files included in the github workspace that
# were written by the previous step. This is pretty daft as we
# don't even want or need docker to attempt to read these files
# during the image build. Github actions appears to give us no way
# to customise the build context to exclude it trying to read these
# files.
#
# Refs:
# https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user
# https://docs.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#filesystems-on-github-hosted-runners
# https://github.com/actions/checkout/issues/211
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
- name: "make check-tidy"
run: docker run --rm -v $(pwd):/work -w /work --entrypoint "/usr/bin/make" ci-builder check-tidy
6 changes: 3 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
service:
golangci-lint-version: 1.51.0
golangci-lint-version: 1.56.2

linters-settings:
lll:
Expand All @@ -10,7 +10,7 @@ linters:
enable:
- asciicheck
- bodyclose
- depguard
# - depguard
- dogsled
- errcheck
- exportloopref
Expand Down Expand Up @@ -84,4 +84,4 @@ issues:
- funlen # Ignore function length for tests

run:
deadline: 2m
timeout: 2m
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ARG DOCKER_BASE=golang:1.20-buster
ARG DOCKER_BASE=golang:1.22-bookworm
FROM --platform=$BUILDPLATFORM ${DOCKER_BASE} AS stage

ARG TARGETARCH
ARG TARGETOS
# requires git make curl
# but this base image has all of those tools already

ENV SYSL_VERSION=0.686.0
ENV ARRAI_VERSION=0.313.0
ENV SYSL_VERSION=0.735.0
ENV ARRAI_VERSION=0.319.0

ENV PROTOC_VERSION=21.7
ENV PROTOC_GEN_GO_VERSION=1.28.1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ See [sysl-template](https://github.com/anz-bank/sysl-template) for more examples
Ensure your environment provides:

- [go 1.20](https://golang.org/doc/install)
- [golangci-lint 1.51.0](https://github.com/golangci/golangci-lint/releases/tag/v1.51.0)
- [golangci-lint 1.56.2](https://github.com/golangci/golangci-lint/releases/tag/v1.56.2)
- [protobuf 3.11.4](https://github.com/protocolbuffers/protobuf/)
- `make`
- proto3 and gRPC
Expand Down
11 changes: 7 additions & 4 deletions builder.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG DOCKER_BASE=golang:1.20-buster
ARG DOCKER_BASE=golang:1.22-bookworm
FROM ${DOCKER_BASE}

ENV SYSL_VERSION=0.604.0
ENV ARRAI_VERSION=0.313.0
ENV SYSL_VERSION=0.735.0
ENV ARRAI_VERSION=0.319.0

WORKDIR /temp-deps/sysl
RUN curl -LJO https://github.com/anz-bank/sysl/releases/download/v"$SYSL_VERSION"/sysl_"$SYSL_VERSION"_linux-amd64.tar.gz && tar -xvf sysl_"$SYSL_VERSION"_linux-amd64.tar.gz && mv sysl /bin/sysl
Expand All @@ -11,8 +11,11 @@ WORKDIR /temp-deps/arrai
RUN curl -LJO https://github.com/arr-ai/arrai/releases/download/v"$ARRAI_VERSION"/arrai_v"$ARRAI_VERSION"_linux-amd64.tar.gz && tar -xvf arrai_v"$ARRAI_VERSION"_linux-amd64.tar.gz && mv arrai /bin/arrai

WORKDIR /temp-deps/golangci-lint
RUN curl -LJO https://github.com/golangci/golangci-lint/releases/download/v1.51.0/golangci-lint-1.51.0-linux-amd64.tar.gz && tar -xvf golangci-lint-1.51.0-linux-amd64.tar.gz && mv golangci-lint-1.51.0-linux-amd64/golangci-lint /bin/golangci-lint
RUN curl -LJO https://github.com/golangci/golangci-lint/releases/download/v1.56.2/golangci-lint-1.56.2-linux-amd64.tar.gz && tar -xvf golangci-lint-1.56.2-linux-amd64.tar.gz && mv golangci-lint-1.56.2-linux-amd64/golangci-lint /bin/golangci-lint

RUN go install golang.org/x/tools/cmd/goimports@latest

# Need this line to fix git commands not working inside the docker image (it is run in actions/checkout but the git config is not passed in to the image, and even if it was, the full path doesn't match)
RUN git config --global --add safe.directory /work

ENTRYPOINT [ "/usr/bin/make" ]
3 changes: 2 additions & 1 deletion core/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
pkgHealth "github.com/anz-bank/pkg/health"
pkg "github.com/anz-bank/pkg/log"
zero "github.com/anz-bank/pkg/logging"

"github.com/anz-bank/sysl-go/config"
"github.com/anz-bank/sysl-go/health"
"github.com/anz-bank/sysl-go/log"
Expand Down Expand Up @@ -597,7 +598,7 @@ type autogenServer struct {
m sync.Mutex // protect access to multiServer
}

//nolint:funlen,gocognit
//nolint:funlen
func (s *autogenServer) Start() error {
// precondition: ctx must have been threaded through InitialiseLogging and hence contain a logger
ctx := s.ctx
Expand Down

0 comments on commit 7e48a22

Please sign in to comment.