Skip to content

Commit

Permalink
feat(backend): update go version and license files (kubeflow#949)
Browse files Browse the repository at this point in the history
update the go version in Dockerfiles, go-license tool,
and license files. these changes come from upstream and
reduce the build time.

Signed-off-by: Yihong Wang <yh.wang@ibm.com>
  • Loading branch information
yhwang authored May 24, 2022
1 parent 00eaffc commit ca3c417
Show file tree
Hide file tree
Showing 11 changed files with 477 additions and 2,102 deletions.
9 changes: 5 additions & 4 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@
# limitations under the License.

# 1. Build api server application
# Use golang:1.13.1-stretch to keep GLIBC at 2.24 https://github.com/gotify/server/issues/225
FROM golang:1.13.1-stretch as builder
FROM golang:1.17.6-stretch as builder
RUN apt-get update && apt-get install -y cmake clang musl-dev openssl
WORKDIR /go/src/github.com/kubeflow/pipelines
COPY . .
RUN GO111MODULE=on go build -o /bin/apiserver backend/src/apiserver/*.go
# Check licenses and comply with license terms.
RUN ./hack/install-go-licenses.sh
RUN go-licenses csv /bin/apiserver > /tmp/licenses.csv && \
# First, make sure there's no forbidden license.
RUN go-licenses check ./backend/src/apiserver
RUN go-licenses csv ./backend/src/apiserver > /tmp/licenses.csv && \
diff /tmp/licenses.csv backend/third_party_licenses/apiserver.csv && \
go-licenses save /tmp/licenses.csv --save_path /tmp/NOTICES
go-licenses save ./backend/src/apiserver --save_path /tmp/NOTICES

# 2. Compile preloaded pipeline samples
FROM python:3.7 as compiler
Expand Down
8 changes: 5 additions & 3 deletions backend/Dockerfile.cacheserver
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

# Dockerfile for building the source code of cache_server
FROM golang:1.13.15-alpine3.12 as builder
FROM golang:1.17.6-alpine3.15 as builder

RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh gcc musl-dev
Expand All @@ -25,9 +25,11 @@ RUN GO111MODULE=on go build -o /bin/cache_server backend/src/cache/*.go

# Check licenses and comply with license terms.
RUN ./hack/install-go-licenses.sh
RUN go-licenses csv /bin/cache_server > /tmp/licenses.csv && \
# First, make sure there's no forbidden license.
RUN go-licenses check ./backend/src/cache
RUN go-licenses csv ./backend/src/cache > /tmp/licenses.csv && \
diff /tmp/licenses.csv backend/third_party_licenses/cache_server.csv && \
go-licenses save /tmp/licenses.csv --save_path /tmp/NOTICES
go-licenses save ./backend/src/cache --save_path /tmp/NOTICES

FROM alpine:3.8
WORKDIR /bin
Expand Down
8 changes: 5 additions & 3 deletions backend/Dockerfile.persistenceagent
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.13.15-alpine3.12 as builder
FROM golang:1.17.6-alpine3.15 as builder

WORKDIR /go/src/github.com/kubeflow/pipelines
COPY . .
Expand All @@ -26,9 +26,11 @@ RUN apk update && apk upgrade && \
RUN GO111MODULE=on go build -o /bin/persistence_agent backend/src/agent/persistence/*.go
# Check licenses and comply with license terms.
RUN ./hack/install-go-licenses.sh
RUN go-licenses csv /bin/persistence_agent > /tmp/licenses.csv && \
# First, make sure there's no forbidden license.
RUN go-licenses check ./backend/src/agent/persistence
RUN go-licenses csv ./backend/src/agent/persistence > /tmp/licenses.csv && \
diff /tmp/licenses.csv backend/third_party_licenses/persistence_agent.csv && \
go-licenses save /tmp/licenses.csv --save_path /tmp/NOTICES
go-licenses save ./backend/src/agent/persistence --save_path /tmp/NOTICES

FROM alpine:3.11
WORKDIR /bin
Expand Down
8 changes: 5 additions & 3 deletions backend/Dockerfile.scheduledworkflow
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.13.15-alpine3.12 as builder
FROM golang:1.17.6-alpine3.15 as builder

WORKDIR /go/src/github.com/kubeflow/pipelines
COPY . .
Expand All @@ -24,9 +24,11 @@ RUN apk update && apk upgrade && \
RUN GO111MODULE=on go build -o /bin/controller backend/src/crd/controller/scheduledworkflow/*.go
# Check licenses and comply with license terms.
RUN ./hack/install-go-licenses.sh
RUN go-licenses csv /bin/controller > /tmp/licenses.csv && \
# First, make sure there's no forbidden license.
RUN go-licenses check ./backend/src/crd/controller/scheduledworkflow
RUN go-licenses csv ./backend/src/crd/controller/scheduledworkflow > /tmp/licenses.csv && \
diff /tmp/licenses.csv backend/third_party_licenses/swf.csv && \
go-licenses save /tmp/licenses.csv --save_path /tmp/NOTICES
go-licenses save ./backend/src/crd/controller/scheduledworkflow --save_path /tmp/NOTICES

FROM alpine:3.11
WORKDIR /bin
Expand Down
8 changes: 5 additions & 3 deletions backend/Dockerfile.viewercontroller
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:alpine as builder
FROM golang:1.17.6-alpine3.15 as builder

RUN apk update && apk upgrade
RUN apk add --no-cache git gcc musl-dev
Expand All @@ -23,9 +23,11 @@ COPY . .
RUN GO111MODULE=on go build -o /bin/controller backend/src/crd/controller/viewer/*.go
# Check licenses and comply with license terms.
RUN ./hack/install-go-licenses.sh
RUN go-licenses csv /bin/controller > /tmp/licenses.csv && \
# First, make sure there's no forbidden license.
RUN go-licenses check ./backend/src/crd/controller/viewer
RUN go-licenses csv ./backend/src/crd/controller/viewer > /tmp/licenses.csv && \
diff /tmp/licenses.csv backend/third_party_licenses/viewer.csv && \
go-licenses save /tmp/licenses.csv --save_path /tmp/NOTICES
go-licenses save ./backend/src/crd/controller/viewer --save_path /tmp/NOTICES

FROM alpine
WORKDIR /bin
Expand Down
Loading

0 comments on commit ca3c417

Please sign in to comment.