Skip to content

Commit

Permalink
Move to single master image for all argocd services (issue #762)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessesuen committed Nov 16, 2018
1 parent 641b7fd commit 361931f
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 133 deletions.
4 changes: 2 additions & 2 deletions .argo-ci/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
- name: cmd
value: "{{item}}"
withItems:
- make controller-image server-image repo-server-image
- make image
- name: test
template: ci-builder
arguments:
Expand Down Expand Up @@ -91,7 +91,7 @@ spec:
cpu: 200m
sidecars:
- name: dind
image: docker:17.10-dind
image: docker:18.09-dind
securityContext:
privileged: true
mirrorVolumeMounts: true
Expand Down
9 changes: 0 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,8 @@ ENV USER=argocd

COPY --from=argocd-build /go/src/github.com/argoproj/argo-cd/dist/* /usr/local/bin/

# Symlink argocd binaries under root for backwards compatibility that expect it under /
RUN ln -s /usr/local/bin/argocd /argocd && \
ln -s /usr/local/bin/argocd-server /argocd-server && \
ln -s /usr/local/bin/argocd-util /argocd-util && \
ln -s /usr/local/bin/argocd-application-controller /argocd-application-controller && \
ln -s /usr/local/bin/argocd-repo-server /argocd-repo-server

USER argocd

RUN helm init --client-only

WORKDIR /home/argocd
ARG BINARY
CMD ${BINARY}
69 changes: 0 additions & 69 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 7 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ cli: clean-debug

.PHONY: cli-linux
cli-linux: clean-debug
docker build --iidfile /tmp/argocd-linux-id --target argocd-build --build-arg MAKE_TARGET="cli IMAGE_TAG=$(IMAGE_TAG) IMAGE_NAMESPACE=$(IMAGE_NAMESPACE) CLI_NAME=argocd-linux-amd64" .
docker build --iidfile /tmp/argocd-linux-id --target argocd-build --build-arg MAKE_TARGET="cli CLI_NAME=argocd-linux-amd64" .
docker create --name tmp-argocd-linux `cat /tmp/argocd-linux-id`
docker cp tmp-argocd-linux:/go/src/github.com/argoproj/argo-cd/dist/argocd-linux-amd64 dist/
docker rm tmp-argocd-linux

.PHONY: cli-darwin
cli-darwin: clean-debug
docker build --iidfile /tmp/argocd-darwin-id --target argocd-build --build-arg MAKE_TARGET="cli GOOS=darwin IMAGE_TAG=$(IMAGE_TAG) IMAGE_NAMESPACE=$(IMAGE_NAMESPACE) CLI_NAME=argocd-darwin-amd64" .
docker build --iidfile /tmp/argocd-darwin-id --target argocd-build --build-arg MAKE_TARGET="cli GOOS=darwin CLI_NAME=argocd-darwin-amd64" .
docker create --name tmp-argocd-darwin `cat /tmp/argocd-darwin-id`
docker cp tmp-argocd-darwin:/go/src/github.com/argoproj/argo-cd/dist/argocd-darwin-amd64 dist/
docker rm tmp-argocd-darwin
Expand All @@ -86,33 +86,18 @@ manifests:
server: clean-debug
CGO_ENABLED=0 ${PACKR_CMD} build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd-server ./cmd/argocd-server

.PHONY: server-image
server-image:
docker build --build-arg BINARY=argocd-server -t $(IMAGE_PREFIX)argocd-server:$(IMAGE_TAG) .
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)argocd-server:$(IMAGE_TAG) ; fi

.PHONY: repo-server
repo-server:
CGO_ENABLED=0 go build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd-repo-server ./cmd/argocd-repo-server

.PHONY: repo-server-image
repo-server-image:
docker build --build-arg BINARY=argocd-repo-server -t $(IMAGE_PREFIX)argocd-repo-server:$(IMAGE_TAG) .
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)argocd-repo-server:$(IMAGE_TAG) ; fi

.PHONY: controller
controller:
CGO_ENABLED=0 go build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd-application-controller ./cmd/argocd-application-controller

.PHONY: controller-image
controller-image:
docker build --build-arg BINARY=argocd-application-controller -t $(IMAGE_PREFIX)argocd-application-controller:$(IMAGE_TAG) .
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)argocd-application-controller:$(IMAGE_TAG) ; fi

.PHONY: cli-image
cli-image:
docker build --build-arg BINARY=argocd -t $(IMAGE_PREFIX)argocd-cli:$(IMAGE_TAG) .
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)argocd-cli:$(IMAGE_TAG) ; fi
.PHONY: image
image:
docker build -t $(IMAGE_PREFIX)argocd:$(IMAGE_TAG) .
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)argocd:$(IMAGE_TAG) ; fi

.PHONY: builder-image
builder-image:
Expand Down Expand Up @@ -149,4 +134,4 @@ release-precheck: manifests
@if [ "$(GIT_TAG)" != "v`cat VERSION`" ]; then echo 'VERSION does not match git tag'; exit 1; fi

.PHONY: release
release: release-precheck precheckin cli-darwin cli-linux server-image controller-image repo-server-image cli-image
release: release-precheck precheckin cli-darwin cli-linux image
4 changes: 2 additions & 2 deletions hack/update-manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ AUTOGENMSG="# This is an auto-generated file. DO NOT EDIT"

update_image () {
if [ ! -z "${IMAGE_NAMESPACE}" ]; then
sed -i '' 's| image: \(.*\)/\(argocd-.*\)| image: '"${IMAGE_NAMESPACE}"'/\2|g' ${1}
sed -i '' 's| image: \(.*\)/\(argocd.*\)| image: '"${IMAGE_NAMESPACE}"'/\2|g' ${1}
fi
if [ ! -z "${IMAGE_TAG}" ]; then
sed -i '' 's|\( image: .*/argocd-.*\)\:.*|\1:'"${IMAGE_TAG}"'|g' ${1}
sed -i '' 's|\( image: .*/argocd.*\)\:.*|\1:'"${IMAGE_TAG}"'|g' ${1}
fi
}

Expand Down
2 changes: 1 addition & 1 deletion manifests/base/application-controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
spec:
containers:
- command:
- /argocd-application-controller
- argocd-application-controller
- --repo-server
- argocd-repo-server:8081
- --status-processors
Expand Down
4 changes: 2 additions & 2 deletions manifests/base/argocd-repo-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ spec:
automountServiceAccountToken: false
containers:
- name: argocd-repo-server
image: argoproj/argocd-repo-server:latest
command: [/argocd-repo-server]
image: argoproj/argocd:latest
command: [argocd-repo-server]
ports:
- containerPort: 8081
readinessProbe:
Expand Down
4 changes: 2 additions & 2 deletions manifests/base/argocd-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ spec:
name: static-files
containers:
- name: argocd-server
image: argoproj/argocd-server:latest
command: [/argocd-server, --staticassets, /shared/app, --repo-server, 'argocd-repo-server:8081']
image: argoproj/argocd:latest
command: [argocd-server, --staticassets, /shared/app]
volumeMounts:
- mountPath: /shared
name: static-files
Expand Down
4 changes: 2 additions & 2 deletions manifests/base/dex-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ spec:
serviceAccountName: dex-server
initContainers:
- name: copyutil
image: argoproj/argocd-server:latest
command: [cp, /argocd-util, /shared]
image: argoproj/argocd:latest
command: [cp, /usr/local/bin/argocd-util, /shared]
volumeMounts:
- mountPath: /shared
name: static-files
Expand Down
20 changes: 9 additions & 11 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -332,14 +332,14 @@ spec:
spec:
containers:
- command:
- /argocd-application-controller
- argocd-application-controller
- --repo-server
- argocd-repo-server:8081
- --status-processors
- "20"
- --operation-processors
- "10"
image: argoproj/argocd-application-controller:latest
image: jessesuen/argocd-application-controller:latest
name: application-controller
serviceAccountName: application-controller
---
Expand All @@ -359,8 +359,8 @@ spec:
automountServiceAccountToken: false
containers:
- command:
- /argocd-repo-server
image: argoproj/argocd-repo-server:latest
- argocd-repo-server
image: jessesuen/argocd:latest
name: argocd-repo-server
ports:
- containerPort: 8081
Expand All @@ -385,12 +385,10 @@ spec:
spec:
containers:
- command:
- /argocd-server
- argocd-server
- --staticassets
- /shared/app
- --repo-server
- argocd-repo-server:8081
image: argoproj/argocd-server:latest
image: jessesuen/argocd:latest
name: argocd-server
readinessProbe:
httpGet:
Expand All @@ -407,7 +405,7 @@ spec:
- -r
- /app
- /shared
image: argoproj/argocd-ui:latest
image: jessesuen/argocd-ui:latest
name: ui
volumeMounts:
- mountPath: /shared
Expand Down Expand Up @@ -445,9 +443,9 @@ spec:
initContainers:
- command:
- cp
- /argocd-util
- /usr/local/bin/argocd-util
- /shared
image: argoproj/argocd-server:latest
image: jessesuen/argocd:latest
name: copyutil
volumeMounts:
- mountPath: /shared
Expand Down
20 changes: 9 additions & 11 deletions manifests/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,14 @@ spec:
spec:
containers:
- command:
- /argocd-application-controller
- argocd-application-controller
- --repo-server
- argocd-repo-server:8081
- --status-processors
- "20"
- --operation-processors
- "10"
image: argoproj/argocd-application-controller:latest
image: jessesuen/argocd-application-controller:latest
name: application-controller
serviceAccountName: application-controller
---
Expand All @@ -292,8 +292,8 @@ spec:
automountServiceAccountToken: false
containers:
- command:
- /argocd-repo-server
image: argoproj/argocd-repo-server:latest
- argocd-repo-server
image: jessesuen/argocd:latest
name: argocd-repo-server
ports:
- containerPort: 8081
Expand All @@ -318,12 +318,10 @@ spec:
spec:
containers:
- command:
- /argocd-server
- argocd-server
- --staticassets
- /shared/app
- --repo-server
- argocd-repo-server:8081
image: argoproj/argocd-server:latest
image: jessesuen/argocd:latest
name: argocd-server
readinessProbe:
httpGet:
Expand All @@ -340,7 +338,7 @@ spec:
- -r
- /app
- /shared
image: argoproj/argocd-ui:latest
image: jessesuen/argocd-ui:latest
name: ui
volumeMounts:
- mountPath: /shared
Expand Down Expand Up @@ -378,9 +376,9 @@ spec:
initContainers:
- command:
- cp
- /argocd-util
- /usr/local/bin/argocd-util
- /shared
image: argoproj/argocd-server:latest
image: jessesuen/argocd:latest
name: copyutil
volumeMounts:
- mountPath: /shared
Expand Down

0 comments on commit 361931f

Please sign in to comment.