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

Migrate to go modules #1815

Closed
wants to merge 3 commits into from
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
10 changes: 5 additions & 5 deletions .argo-ci/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,39 @@ spec:
arguments:
parameters:
- name: cmd
value: dep ensure && make lint test verify-codegen
value: make lint test verify-codegen

- name: ci-builder
inputs:
parameters:
- name: cmd
artifacts:
- name: code
path: /go/src/github.com/argoproj/argo
path: argo
git:
repo: "{{workflow.parameters.repo}}"
revision: "{{workflow.parameters.revision}}"
container:
image: argoproj/argo-ci-builder:latest
command: [sh, -c]
args: ["{{inputs.parameters.cmd}}"]
workingDir: /go/src/github.com/argoproj/argo
workingDir: argo

- name: ci-dind
inputs:
parameters:
- name: cmd
artifacts:
- name: code
path: /go/src/github.com/argoproj/argo
path: argo
git:
repo: "{{workflow.parameters.repo}}"
revision: "{{workflow.parameters.revision}}"
container:
image: argoproj/argo-ci-builder:latest
command: [sh, -c]
args: ["until docker ps; do sleep 3; done && {{inputs.parameters.cmd}}"]
workingDir: /go/src/github.com/argoproj/argo
workingDir: argo
env:
- name: DOCKER_HOST
value: 127.0.0.1
Expand Down
5 changes: 1 addition & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,14 @@ Go to https://github.com/argoproj/
## How to setup your dev environment

### Requirements
* Golang 1.11
* Golang 1.13
* Docker
* dep v0.5
* Mac Install: `brew install dep`
* golangci-lint v1.16.0

### Quickstart
```
$ go get github.com/argoproj/argo
$ cd $(go env GOPATH)/src/github.com/argoproj/argo
$ dep ensure -vendor-only
$ make
```

Expand Down
27 changes: 8 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Initial stage which pulls prepares build dependencies and CLI tooling we need for our final image
# Also used as the image in CI jobs so needs all dependencies
####################################################################################################
FROM golang:1.11.5 as builder
FROM golang:1.13 as builder

RUN apt-get update && apt-get install -y \
git \
Expand All @@ -23,11 +23,6 @@ RUN wget -O docker.tgz "https://download.docker.com/linux/static/${DOCKER_CHANNE
tar --extract --file docker.tgz --strip-components 1 --directory /usr/local/bin/ && \
rm docker.tgz

# Install dep
ENV DEP_VERSION=0.5.0
RUN wget https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -O /usr/local/bin/dep && \
chmod +x /usr/local/bin/dep

# Install golangci-lint
ENV GOLANGCI_LINT_VERSION=1.16.0
RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/v$GOLANGCI_LINT_VERSION/install.sh| sh -s -- -b $(go env GOPATH)/bin v$GOLANGCI_LINT_VERSION
Expand Down Expand Up @@ -62,18 +57,12 @@ COPY --from=builder /usr/local/bin/docker /usr/local/bin/
####################################################################################################
FROM builder as argo-build

# A dummy directory is created under $GOPATH/src/dummy so we are able to use dep
# to install all the packages of our dep lock file
COPY Gopkg.toml ${GOPATH}/src/dummy/Gopkg.toml
COPY Gopkg.lock ${GOPATH}/src/dummy/Gopkg.lock

RUN cd ${GOPATH}/src/dummy && \
dep ensure -vendor-only && \
mv vendor/* ${GOPATH}/src/ && \
rmdir vendor
# Download dependencies. This is done separately to take advantage of caching
WORKDIR /argo
COPY go.mod go.sum /argo/
RUN go mod download

# Perform the build
WORKDIR /go/src/github.com/argoproj/argo
COPY . .
ARG MAKE_TARGET="controller executor cli-linux-amd64"
RUN make $MAKE_TARGET
Expand All @@ -83,20 +72,20 @@ RUN make $MAKE_TARGET
# argoexec
####################################################################################################
FROM argoexec-base as argoexec
COPY --from=argo-build /go/src/github.com/argoproj/argo/dist/argoexec /usr/local/bin/
COPY --from=argo-build /argo/dist/argoexec /usr/local/bin/


####################################################################################################
# workflow-controller
####################################################################################################
FROM scratch as workflow-controller
COPY --from=argo-build /go/src/github.com/argoproj/argo/dist/workflow-controller /bin/
COPY --from=argo-build /argo/dist/workflow-controller /bin/
ENTRYPOINT [ "workflow-controller" ]


####################################################################################################
# argocli
####################################################################################################
FROM scratch as argocli
COPY --from=argo-build /go/src/github.com/argoproj/argo/dist/argo-linux-amd64 /bin/argo
COPY --from=argo-build /argo/dist/argo-linux-amd64 /bin/argo
ENTRYPOINT [ "argo" ]
Loading