Skip to content

Commit

Permalink
chore: Upgrade Go to v1.21 (kserve#3296)
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
  • Loading branch information
terrytangyuan authored and spolti committed Jan 11, 2024
1 parent 6d71f79 commit 9fad9f4
Show file tree
Hide file tree
Showing 11 changed files with 165 additions and 18 deletions.
98 changes: 89 additions & 9 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: "1.21"

- name: Setup Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -330,6 +330,86 @@ jobs:
kubectl get pods -n kserve
kubectl describe pods -n kserve
- name: Run all E2E tests except graph
timeout-minutes: 60
run: |
./test/scripts/gh-actions/run-e2e-tests.sh "fast or pmml" "2"
- name: Run E2E tests for graph
timeout-minutes: 120
run: |
./test/scripts/gh-actions/run-e2e-tests.sh "graph" "2"
- name: Check system status
if: always()
run: |
./test/scripts/gh-actions/status-check.sh
test-path-based-routing:
runs-on: ubuntu-latest
needs:
[
kserve-image-build,
predictor-runtime-build,
explainer-runtime-build,
graph-tests-images-build,
]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.21"

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.9"

- name: Free-up disk space
uses: ./.github/actions/free-up-disk-space

- name: Setup Minikube
uses: ./.github/actions/minikube-setup

- name: Download base images
uses: ./.github/actions/base-download

- name: KServe dependency setup
uses: ./.github/actions/kserve-dep-setup

- name: Download sklearn server image
uses: ishworkh/docker-image-artifact-download@v1
with:
image: "kserve/sklearnserver:${{ github.sha }}"

- name: Download xgb server image
uses: ishworkh/docker-image-artifact-download@v1
with:
image: "kserve/xgbserver:${{ github.sha }}"

- name: Download lgb server image
uses: ishworkh/docker-image-artifact-download@v1
with:
image: "kserve/lgbserver:${{ github.sha }}"

- name: Download transformer image
uses: ishworkh/docker-image-artifact-download@v1
with:
image: "kserve/image-transformer:${{ github.sha }}"

- name: Install Poetry and version plugin
run: ./test/scripts/gh-actions/setup-poetry.sh

- name: Install KServe
run: |
./test/scripts/gh-actions/setup-kserve.sh
kubectl get pods -n kserve
kubectl describe pods -n kserve
- name: Patch inferenceservice config
run : |
kubectl patch configmaps -n kserve inferenceservice-config --patch-file config/overlays/test/configmap/inferenceservice-ingress.yaml
Expand All @@ -354,7 +434,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: "1.21"
- uses: actions/setup-python@v4
with:
python-version: '3.9'
Expand Down Expand Up @@ -413,7 +493,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: "1.21"
- uses: actions/setup-python@v4
with:
python-version: '3.9'
Expand Down Expand Up @@ -467,7 +547,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: "1.21"
- uses: actions/setup-python@v4
with:
python-version: '3.9'
Expand Down Expand Up @@ -521,7 +601,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: "1.21"
- uses: actions/setup-python@v4
with:
python-version: '3.9'
Expand Down Expand Up @@ -573,7 +653,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: "1.21"
- uses: actions/setup-python@v4
with:
python-version: '3.9'
Expand Down Expand Up @@ -635,7 +715,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: "1.21"
- uses: actions/setup-python@v4
with:
python-version: '3.9'
Expand Down Expand Up @@ -674,7 +754,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: "1.21"
- uses: actions/setup-python@v4
with:
python-version: '3.9'
Expand Down Expand Up @@ -718,7 +798,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.20'
go-version: "1.21"
- uses: actions/setup-python@v4
with:
python-version: '3.9'
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: '1.20'
go-version: "1.21"
id: go

- name: Check out code into the Go module directory
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/verify-codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: "Verify Generated Code"

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
verify-codegen:
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.21

- name: Checkout source code
uses: actions/checkout@v3

- name: Install dependencies
run: |
go mod download
- name: Update Codegen
shell: bash
run: |
GOPATH=$(go env GOPATH)
KSERVE_PATH=$GOPATH/src/github.com/kserve/kserve
echo "KSERVE_PATH=$KSERVE_PATH" >> "$GITHUB_ENV"
mkdir -p $KSERVE_PATH
cp -a . $KSERVE_PATH
cd $KSERVE_PATH
make generate
- name: Verify
shell: bash
run: |
cd $KSERVE_PATH
# From: https://backreference.org/2009/12/23/how-to-match-newlines-in-sed/
# This is to leverage this workaround:
# https://github.com/actions/toolkit/issues/193#issuecomment-605394935
urlencode() {
sed ':begin;$!N;s/\n/%0A/;tbegin'
}
# When running make generate, it introduces some lint errors which is fixed manually.
# Reset these files to avoid false triggers due to those changes.
git checkout -- python/kserve/test/__init__.py python/kserve/kserve/api_client.py
if [ -z "$(git status --porcelain ./pkg ./python)" ]; then
echo "${{ github.repository }} up to date."
else
echo "Found diffs in: $(git diff-index --name-only HEAD -- ./pkg ./python)"
for x in $(git diff-index --name-only HEAD -- ./pkg ./python); do
echo "::error file=$x::Please run make generate.%0A$(git diff $x | urlencode)"
done
echo "${{ github.repository }} is out of date. Please run make generate"
exit 1
fi
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.20 as builder
FROM golang:1.21 as builder

# Copy in the go src
WORKDIR /go/src/github.com/kserve/kserve
Expand Down
2 changes: 1 addition & 1 deletion agent.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the inference-agent binary
FROM golang:1.20 as builder
FROM golang:1.21 as builder

# Copy in the go src
WORKDIR /go/src/github.com/kserve/kserve
Expand Down
2 changes: 1 addition & 1 deletion docs/samples/graph/bgtest/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20.3 AS build
FROM golang:1.21 AS build
WORKDIR /
COPY bgtest /project/bgtest/
RUN cd /project/bgtest && go build -mod vendor -o bgtest -ldflags '-linkmode "external" -extldflags "-static"'
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/kserve/kserve

go 1.20
go 1.21

require (
cloud.google.com/go/storage v1.30.1
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1
cloud.google.com/go/iam v1.0.1 h1:lyeCAU6jpnVNrE9zGQkTl3WgNgK/X+uWwaw0kynZJMU=
cloud.google.com/go/iam v1.0.1/go.mod h1:yR3tmSL8BcZB4bxByRv2jkSIahVmCtfKZwLYGBalRE8=
cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM=
cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
Expand Down Expand Up @@ -196,6 +197,7 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE=
github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
Expand Down Expand Up @@ -256,6 +258,7 @@ github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPg
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw=
github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
Expand Down Expand Up @@ -341,6 +344,7 @@ github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
Expand Down Expand Up @@ -474,6 +478,7 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
Expand Down Expand Up @@ -539,6 +544,7 @@ go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=
go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
Expand Down
2 changes: 1 addition & 1 deletion qpext/qpext.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the inference qpext binary
FROM golang:1.20 as builder
FROM golang:1.21 as builder

# Copy in the go src
WORKDIR /go/src/github.com/kserve/kserve/qpext
Expand Down
2 changes: 1 addition & 1 deletion router.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the inference-router binary
FROM golang:1.20 as builder
FROM golang:1.21 as builder

# Copy in the go src
WORKDIR /go/src/github.com/kserve/kserve
Expand Down
2 changes: 1 addition & 1 deletion tools/tf2openapi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.20 as builder
FROM golang:1.21 as builder

# Copy in the go src
WORKDIR /go/src/github.com/kserve/kserve
Expand Down

0 comments on commit 9fad9f4

Please sign in to comment.