Skip to content

Commit

Permalink
go1.20.5 build image (#762)
Browse files Browse the repository at this point in the history
* go1.20.5 build image

* give up on depguard. golangci/golangci-lint#3877

* make linters happy
  • Loading branch information
ldemailly committed Jun 12, 2023
1 parent 7eb5747 commit da8c0b9
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defaultEnv:
&defaultEnv
docker:
# specify the version
- image: docker.io/fortio/fortio.build:v58@sha256:84ab73744546c1b27e2f08143e2c080114c4f1864f760b9fca3908683259d3c4
- image: docker.io/fortio/fortio.build:v59@sha256:735db577fe940063725cdac8dd2723875f147434f266cbdf0e6970b4fd9b1a07
working_directory: /build/fortio

jobs:
Expand Down
9 changes: 1 addition & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ linters-settings:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).FErrf
enable-all: true
disable-all: false
depguard:
list-type: blacklist
include-go-root: false
packages:
- github.com/sirupsen/logrus
packages-with-error-message:
# specify an error message to output when a blacklisted package is used
- github.com/sirupsen/logrus: "logging is allowed only by fortio.log"
lll:
# max line length, lines longer will be reported. Default is 120.
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
Expand Down Expand Up @@ -115,6 +107,7 @@ linters:
- cyclop
- forcetypeassert
- ireturn
- depguard
enable-all: true
disable-all: false
# Must not use fast: true in newer golangci-lint or it'll just skip a bunch of linter instead of doing caching like before (!)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the binaries in larger image
FROM docker.io/fortio/fortio.build:v58@sha256:84ab73744546c1b27e2f08143e2c080114c4f1864f760b9fca3908683259d3c4 as build
FROM docker.io/fortio/fortio.build:v59@sha256:735db577fe940063725cdac8dd2723875f147434f266cbdf0e6970b4fd9b1a07 as build
WORKDIR /build
COPY --chown=build:build . fortio
ARG MODE=install
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Dependencies and linters for build:
FROM golang:1.20.4@sha256:6dd5c5f8936d7d4487802fb10a77f31b1776740be0fc17ada1acb74ac958f7be
FROM golang:1.20.5@sha256:4b1fc02d16fca272e5e6e6adc98396219b43ef663a377eef4a97e881d364393f
# Need gcc for -race test (and some linters though those work with CGO_ENABLED=0)
RUN apt-get -y update && \
apt-get --no-install-recommends -y upgrade && \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.echosrv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the binaries in larger image
FROM docker.io/fortio/fortio.build:v58@sha256:84ab73744546c1b27e2f08143e2c080114c4f1864f760b9fca3908683259d3c4 as build
FROM docker.io/fortio/fortio.build:v59@sha256:735db577fe940063725cdac8dd2723875f147434f266cbdf0e6970b4fd9b1a07 as build
WORKDIR /build
COPY . fortio
RUN make -C fortio official-build-version BUILD_DIR=/build OFFICIAL_TARGET=fortio.org/fortio/echosrv
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.fcurl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the binaries in larger image
FROM docker.io/fortio/fortio.build:v58@sha256:84ab73744546c1b27e2f08143e2c080114c4f1864f760b9fca3908683259d3c4 as build
FROM docker.io/fortio/fortio.build:v59@sha256:735db577fe940063725cdac8dd2723875f147434f266cbdf0e6970b4fd9b1a07 as build
WORKDIR /build
COPY . fortio
RUN make -C fortio official-build-version BUILD_DIR=/build OFFICIAL_TARGET=fortio.org/fortio/fcurl
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
IMAGES=echosrv fcurl # plus the combo image / Dockerfile without ext.

DOCKER_PREFIX := docker.io/fortio/fortio
BUILD_IMAGE_TAG := v58@sha256:84ab73744546c1b27e2f08143e2c080114c4f1864f760b9fca3908683259d3c4
BUILD_IMAGE_TAG := v59@sha256:735db577fe940063725cdac8dd2723875f147434f266cbdf0e6970b4fd9b1a07
BUILDX_PLATFORMS := linux/amd64,linux/arm64,linux/ppc64le,linux/s390x
BUILDX_POSTFIX :=
ifeq '$(shell echo $(BUILDX_PLATFORMS) | awk -F "," "{print NF-1}")' '0'
Expand Down
2 changes: 1 addition & 1 deletion Webtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ fi
PPROF_URL="$BASE_URL/debug/pprof/heap?debug=1"
$CURL "$PPROF_URL" | grep -i TotalAlloc # should find this in memory profile
# creating dummy container to hold a volume for test certs due to remote docker bind mount limitation.
DOCKERCURLID=$(docker run -d -v $TEST_CERT_VOL --net host --name $DOCKERSECVOLNAME docker.io/fortio/fortio.build:v58@sha256:84ab73744546c1b27e2f08143e2c080114c4f1864f760b9fca3908683259d3c4 sleep 120)
DOCKERCURLID=$(docker run -d -v $TEST_CERT_VOL --net host --name $DOCKERSECVOLNAME docker.io/fortio/fortio.build:v59@sha256:735db577fe940063725cdac8dd2723875f147434f266cbdf0e6970b4fd9b1a07 sleep 120)
# while we have something with actual curl binary do
# Test for h2c upgrade (#562)
docker exec $DOCKERSECVOLNAME /usr/bin/curl -v --http2 -m 10 -d foo42 http://localhost:8080/debug | tee >(cat 1>&2) | grep foo42
Expand Down
2 changes: 1 addition & 1 deletion periodic/periodic.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ func (r *periodicRunner) runQPSSetup(extra string) (requestedDuration string, re
// Always print that as we need ^C to interrupt, in that case the user need to notice
_, _ = fmt.Fprintf(r.Out, "Starting at %g qps with %d thread(s) [gomax %d] until interrupted%s\n",
r.QPS, r.NumThreads, runtime.GOMAXPROCS(0), extra)
return
return //nolint:nakedret // it's fine/cleaner to not repeat all the parameters we just set/we return.
}
// else:
requestedDuration = fmt.Sprint(r.Duration)
Expand Down
16 changes: 8 additions & 8 deletions rapi/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func SendTSVDataIndex(urlPrefix string, w http.ResponseWriter) {
useCache := (info.ModTime() == gTSVCache.cachedDirTime) && (len(gTSVCache.cachedResult) > 0)
if !useCache {
var b bytes.Buffer
b.Write([]byte("TsvHttpData-1.0\n"))
b.WriteString("TsvHttpData-1.0\n")
for _, e := range DataList() {
fname := e + ".json"
f, err := os.Open(path.Join(dataDir, fname))
Expand All @@ -96,13 +96,13 @@ func SendTSVDataIndex(urlPrefix string, w http.ResponseWriter) {
log.Errf("Copy/read error for %s: %v", fname, err)
continue
}
b.Write([]byte(urlPrefix))
b.Write([]byte(fname))
b.Write([]byte("\t"))
b.Write([]byte(strconv.FormatInt(sz, 10)))
b.Write([]byte("\t"))
b.Write([]byte(base64.StdEncoding.EncodeToString(h.Sum(nil))))
b.Write([]byte("\n"))
b.WriteString(urlPrefix)
b.WriteString(fname)
b.WriteString("\t")
b.WriteString(strconv.FormatInt(sz, 10))
b.WriteString("\t")
b.WriteString(base64.StdEncoding.EncodeToString(h.Sum(nil)))
b.WriteString("\n")
}
gTSVCache.cachedDirTime = info.ModTime()
gTSVCache.cachedResult = b.Bytes()
Expand Down
2 changes: 1 addition & 1 deletion release/Dockerfile.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Concatenated after ../Dockerfile to create the tgz
FROM docker.io/fortio/fortio.build:v58@sha256:84ab73744546c1b27e2f08143e2c080114c4f1864f760b9fca3908683259d3c4 as stage
FROM docker.io/fortio/fortio.build:v59@sha256:735db577fe940063725cdac8dd2723875f147434f266cbdf0e6970b4fd9b1a07 as stage
ARG archs="amd64 arm64 ppc64le s390x"
ENV archs=${archs}
# Build image defaults to build user, switch back to root for
Expand Down

0 comments on commit da8c0b9

Please sign in to comment.