-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
build: Use goreman for starting locally. #3074
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,9 +72,12 @@ STATIC_BUILD ?= true | |
CI ?= false | ||
DB ?= postgres | ||
K3D := $(shell if [ "`which kubectl`" != '' ] && [ "`kubectl config current-context`" = "k3s-default" ]; then echo true; else echo false; fi) | ||
# which components to start, useful if you want to disable them to debug | ||
COMPONENTS := controller,argo-server | ||
LOG_LEVEL := debug | ||
ALWAYS_OFFLOAD_NODE_STATUS := true | ||
|
||
ifeq ($(DB),no-db) | ||
ALWAYS_OFFLOAD_NODE_STATUS := false | ||
endif | ||
|
||
ifeq ($(CI),true) | ||
TEST_OPTS := -coverprofile=coverage.out | ||
|
@@ -125,6 +128,10 @@ define docker_build | |
if [ $(K3D) = true ]; then k3d import-images $(IMAGE_NAMESPACE)/$(1):$(VERSION); fi | ||
touch $(3) | ||
endef | ||
define docker_pull | ||
docker pull $(1) | ||
if [ $(K3D) = true ]; then k3d import-images $(1); fi | ||
endef | ||
|
||
.PHONY: build | ||
build: status clis executor-image controller-image manifests/install.yaml manifests/namespace-install.yaml manifests/quick-start-postgres.yaml manifests/quick-start-mysql.yaml | ||
|
@@ -310,32 +317,17 @@ $(VERSION_FILE): | |
@mkdir -p dist | ||
touch $(VERSION_FILE) | ||
|
||
dist/postgres.yaml: $(MANIFESTS) $(E2E_MANIFESTS) $(VERSION_FILE) | ||
kustomize build --load_restrictor=none test/e2e/manifests/postgres | sed 's/:$(MANIFESTS_VERSION)/:$(VERSION)/' | sed 's/pns/$(E2E_EXECUTOR)/' > dist/postgres.yaml | ||
|
||
dist/no-db.yaml: $(MANIFESTS) $(E2E_MANIFESTS) $(VERSION_FILE) | ||
dist/$(DB).yaml: $(MANIFESTS) $(E2E_MANIFESTS) $(VERSION_FILE) | ||
# We additionally disable ALWAYS_OFFLOAD_NODE_STATUS | ||
kustomize build --load_restrictor=none test/e2e/manifests/no-db | sed 's/:$(MANIFESTS_VERSION)/:$(VERSION)/' | sed 's/pns/$(E2E_EXECUTOR)/' | sed 's/"true"/"false"/' > dist/no-db.yaml | ||
|
||
dist/mysql.yaml: $(MANIFESTS) $(E2E_MANIFESTS) $(VERSION_FILE) | ||
kustomize build --load_restrictor=none test/e2e/manifests/mysql | sed 's/:$(MANIFESTS_VERSION)/:$(VERSION)/' | sed 's/pns/$(E2E_EXECUTOR)/' > dist/mysql.yaml | ||
kustomize build --load_restrictor=none test/e2e/manifests/$(DB) | sed 's/:$(MANIFESTS_VERSION)/:$(VERSION)/' | sed 's/pns/$(E2E_EXECUTOR)/' > dist/$(DB).yaml | ||
|
||
.PHONY: install | ||
install: dist/postgres.yaml dist/mysql.yaml dist/no-db.yaml | ||
install: dist/$(DB).yaml | ||
ifeq ($(K3D),true) | ||
k3d start | ||
endif | ||
# Install quick-start | ||
kubectl apply -f test/e2e/manifests/argo-ns.yaml | ||
ifeq ($(DB),postgres) | ||
kubectl -n argo apply -f dist/postgres.yaml | ||
else | ||
ifeq ($(DB),mysql) | ||
kubectl -n argo apply -f dist/mysql.yaml | ||
else | ||
kubectl -n argo apply -f dist/no-db.yaml | ||
endif | ||
endif | ||
kubectl -n argo apply -l app.kubernetes.io/part-of=argo --prune --force -f dist/$(DB).yaml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will delete mysql if you run postgres and vice-versa, but not delete workflows There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great, thanks for fitting my use case. |
||
|
||
.PHONY: pull-build-images | ||
pull-build-images: | ||
|
@@ -354,29 +346,27 @@ test/e2e/images/argosay/v2/argosay: $(shell find test/e2e/images/argosay/v2/main | |
|
||
.PHONY: test-images | ||
test-images: | ||
docker pull argoproj/argosay:v1 | ||
docker pull argoproj/argosay:v2 | ||
docker pull python:alpine3.6 | ||
$(call docker_pull,argoproj/argosay:v1) | ||
$(call docker_pull,argoproj/argosay:v2) | ||
$(call docker_pull,python:alpine3.6) | ||
|
||
.PHONY: stop | ||
stop: | ||
killall argo workflow-controller pf.sh kubectl || true | ||
|
||
$(GOPATH)/bin/goreman: | ||
go get github.com/mattn/goreman | ||
|
||
.PHONY: start-aux | ||
start-aux: | ||
start-aux: $(GOPATH)/bin/goreman | ||
kubectl config set-context --current --namespace=argo | ||
kubectl -n argo wait --for=condition=Ready pod --all -l app --timeout 2m | ||
./hack/port-forward.sh | ||
# Check minio, postgres and mysql are in hosts file | ||
grep '127.0.0.1 *minio' /etc/hosts | ||
grep '127.0.0.1 *postgres' /etc/hosts | ||
grep '127.0.0.1 *mysql' /etc/hosts | ||
ifneq ($(findstring controller,$(COMPONENTS)),) | ||
ALWAYS_OFFLOAD_NODE_STATUS=true OFFLOAD_NODE_STATUS_TTL=30s WORKFLOW_GC_PERIOD=30s UPPERIO_DB_DEBUG=1 ARCHIVED_WORKFLOW_GC_PERIOD=30s ./dist/workflow-controller --executor-image argoproj/argoexec:$(VERSION) --namespaced --loglevel $(LOG_LEVEL) & | ||
endif | ||
ifneq ($(findstring argo-server,$(COMPONENTS)),) | ||
UPPERIO_DB_DEBUG=1 ./dist/argo --loglevel $(LOG_LEVEL) server --namespaced --auth-mode client --secure & | ||
endif | ||
env ALWAYS_OFFLOAD_NODE_STATUS=$(ALWAYS_OFFLOAD_NODE_STATUS) LOG_LEVEL=$(LOG_LEVEL) VERSION=$(VERSION) goreman -set-ports=false start | ||
|
||
.PHONY: start | ||
start: status stop install controller cli executor-image start-aux wait env | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
workflow-controller: ALWAYS_OFFLOAD_NODE_STATUS=${ALWAYS_OFFLOAD_NODE_STATUS} OFFLOAD_NODE_STATUS_TTL=30s WORKFLOW_GC_PERIOD=30s UPPERIO_DB_DEBUG=1 ARCHIVED_WORKFLOW_GC_PERIOD=30s ./dist/workflow-controller --executor-image argoproj/argoexec:${VERSION} --namespaced --loglevel ${LOG_LEVEL} | ||
argo-server: UPPERIO_DB_DEBUG=1 ./dist/argo --loglevel ${LOG_LEVEL} server --namespaced --auth-mode client --secure |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix regular failing builds (due to Golang not being installed)