Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Refactor operator to use the controller runtime with multi-version support #658

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,13 @@ go:
- 1.12.x

env:
- DEP_VERSION="0.5.3"
- GO111MODULE="on"

before_install:
# Download the binary to bin folder in $GOPATH
- curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep
# Make the binary executable
- chmod +x $GOPATH/bin/dep

install:
- dep ensure
- go mod download

go_import_path: github.com/GoogleCloudPlatform/spark-on-k8s-operator

script:
- go test -v ./...
- ./.travis.gofmt.sh



19 changes: 9 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,21 @@

ARG SPARK_IMAGE=gcr.io/spark-operator/spark:v2.4.4

FROM golang:1.12.5-alpine as builder
ARG DEP_VERSION="0.5.3"
FROM golang:1.12.9-alpine as builder
RUN apk add --no-cache bash git
ADD https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 /usr/bin/dep
RUN chmod +x /usr/bin/dep

WORKDIR ${GOPATH}/src/github.com/GoogleCloudPlatform/spark-on-k8s-operator
COPY Gopkg.toml Gopkg.lock ./
RUN dep ensure -vendor-only
COPY . ./
ENV GO111MODULE=on
RUN go mod download
RUN go generate && CGO_ENABLED=0 GOOS=linux go build -o /usr/bin/spark-operator

FROM ${SPARK_IMAGE}
FROM ${SPARK_IMAGE} as spark_builder
COPY --from=builder /usr/bin/spark-operator /usr/bin/
RUN apk add --no-cache openssl curl tini
COPY hack/gencerts.sh /usr/bin/

COPY entrypoint.sh /usr/bin/

FROM golang:1.12.9-alpine
COPY --from=spark_builder /usr/bin/ /usr/bin/
RUN apk add --no-cache bash openssl curl tini

ENTRYPOINT ["/usr/bin/entrypoint.sh"]
11 changes: 4 additions & 7 deletions Dockerfile.rh
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,14 @@
ARG SPARK_IMAGE=gcr.io/spark-operator/spark:v2.4.4

FROM golang:1.12.5-alpine as builder
ARG DEP_VERSION="0.5.3"
RUN apk add --no-cache bash git
ADD https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 /usr/bin/dep
RUN chmod +x /usr/bin/dep

RUN apk add --no-cache bash git
WORKDIR ${GOPATH}/src/github.com/GoogleCloudPlatform/spark-on-k8s-operator
COPY Gopkg.toml Gopkg.lock ./
RUN dep ensure -vendor-only
COPY . ./
ENV GO111MODULE=on
RUN go mod download
RUN go generate && CGO_ENABLED=0 GOOS=linux go build -o /usr/bin/spark-operator


FROM ${SPARK_IMAGE}
COPY --from=builder /usr/bin/spark-operator /usr/bin/
USER root
Expand Down
Loading