-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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: replace kit
with task
#11928
base: main
Are you sure you want to change the base?
build: replace kit
with task
#11928
Changes from 6 commits
75ebacc
1e9d3c5
7937cbb
3040183
6aaf99e
bf07cea
26d51fe
8a1c81f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -517,27 +517,22 @@ dist/argosay: | |
mkdir -p dist | ||
cp test/e2e/images/argosay/v2/argosay dist/ | ||
|
||
.PHONY: kit | ||
kit: | ||
ifeq ($(shell command -v kit),) | ||
ifeq ($(shell uname),Darwin) | ||
brew tap kitproj/kit --custom-remote https://github.com/kitproj/kit | ||
brew install kit | ||
else | ||
curl -q https://raw.githubusercontent.com/kitproj/kit/main/install.sh | tag=v0.1.8 sh | ||
endif | ||
.PHONY: task | ||
task: | ||
# update this in Nix when upgrading it here | ||
ifneq ($(USE_NIX), true) | ||
npm i -g @go-task/[email protected] | ||
Comment on lines
+520
to
+524
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. Needs updating in the Nix file, happy to do that myself if you want? 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. @isubasinghe could you elaborate on this? You mentioned We discussed it at the Contributor meeting too if it could be used as a replacement on all environments, but no one knew the answer so we were looking to you for more info. 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. 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. Yeah it does have a task runner, infact Nix can replace the Makefile and task/goreman/etc. There is a manual step of setting up the k8s cluster needed at the moment but even this can be fully integrated into Nix. That controller should have a version attached to it, I did not set this version. So production builds using Nix are not really possible yet. This is still very fixable though, more than happy to talk about it if this is something we want to do. 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.
Yea I've seen that -- that's equivalent to |
||
endif | ||
|
||
|
||
.PHONY: start | ||
ifeq ($(RUN_MODE),local) | ||
ifeq ($(API),true) | ||
start: install controller kit cli | ||
start: install controller task cli | ||
else | ||
start: install controller kit | ||
start: install controller task | ||
endif | ||
else | ||
start: install kit | ||
start: install task | ||
endif | ||
@echo "starting STATIC_FILES=$(STATIC_FILES) (DEV_BRANCH=$(DEV_BRANCH), GIT_BRANCH=$(GIT_BRANCH)), AUTH_MODE=$(AUTH_MODE), RUN_MODE=$(RUN_MODE), MANAGED_NAMESPACE=$(MANAGED_NAMESPACE)" | ||
ifneq ($(API),true) | ||
|
@@ -558,7 +553,7 @@ endif | |
grep '127.0.0.1.*postgres' /etc/hosts | ||
grep '127.0.0.1.*mysql' /etc/hosts | ||
ifeq ($(RUN_MODE),local) | ||
env DEFAULT_REQUEUE_TIME=$(DEFAULT_REQUEUE_TIME) ARGO_SECURE=$(SECURE) ALWAYS_OFFLOAD_NODE_STATUS=$(ALWAYS_OFFLOAD_NODE_STATUS) ARGO_LOG_LEVEL=$(LOG_LEVEL) UPPERIO_DB_DEBUG=$(UPPERIO_DB_DEBUG) ARGO_AUTH_MODE=$(AUTH_MODE) ARGO_NAMESPACED=$(NAMESPACED) ARGO_NAMESPACE=$(KUBE_NAMESPACE) ARGO_MANAGED_NAMESPACE=$(MANAGED_NAMESPACE) ARGO_EXECUTOR_PLUGINS=$(PLUGINS) PROFILE=$(PROFILE) kit $(TASKS) | ||
env DEFAULT_REQUEUE_TIME=$(DEFAULT_REQUEUE_TIME) ARGO_SECURE=$(SECURE) ALWAYS_OFFLOAD_NODE_STATUS=$(ALWAYS_OFFLOAD_NODE_STATUS) ARGO_LOG_LEVEL=$(LOG_LEVEL) UPPERIO_DB_DEBUG=$(UPPERIO_DB_DEBUG) ARGO_AUTH_MODE=$(AUTH_MODE) ARGO_NAMESPACED=$(NAMESPACED) ARGO_NAMESPACE=$(KUBE_NAMESPACE) ARGO_MANAGED_NAMESPACE=$(MANAGED_NAMESPACE) ARGO_EXECUTOR_PLUGINS=$(PLUGINS) PROFILE=$(PROFILE) task $(TASKS) | ||
endif | ||
|
||
.PHONY: wait | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# yaml-language-server: $schema: https://taskfile.dev/schema.json | ||
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. the schema is a pretty nice addition too 😉 it's got integrations with VSCode and other editors as well if that's your preference |
||
|
||
# Install `task` by following https://taskfile.dev/installation/ | ||
# Run `task up` to start argo. | ||
|
||
# - `env PROFILE=mysql task up` to start with MySQL. | ||
# - `env PROFILE=plugins ARGO_EXECUTOR_PLUGINS=true task up` to start with plugins. | ||
# - `env PROFILE=sso ARGO_AUTH_MODE=sso task up` to start with SSO. | ||
|
||
# The app will be up-and-running between 15s and 1m later (if hot compiled or cold). | ||
# When using `--watch`, any changes made to the source code will be automatically recompiled and the app restarted, typically within a few seconds. | ||
|
||
version: 3 | ||
|
||
tasks: | ||
go-deps: | ||
cmd: go mod download | ||
# mutex: download | ||
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. I don't think any of these mutexes are actually strictly necessary, two downloads and two builds can run in parallel, they just may bottleneck (or they may not, I don't believe they do on my laptop), so it might be a concurrency optimization to run them serially instead. Task does have the 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. Removed the |
||
|
||
install: | ||
cmd: sh -c "make install PROFILE=$PROFILE" | ||
deps: [go-deps] | ||
sources: [manifests] | ||
env: | ||
PROFILE: minimal | ||
# mutex: docker | ||
|
||
build-controller: | ||
cmd: make ./dist/workflow-controller | ||
deps: [go-deps] | ||
sources: [cmd/workflow-controller, config, errors, persist, pkg, util, workflow] | ||
# mutex: build | ||
|
||
port-forward: | ||
cmd: ./hack/port-forward.sh | ||
deps: [install] | ||
# ports: 9000 | ||
agilgur5 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
controller: | ||
cmd: ./dist/workflow-controller | ||
deps: [install, build-controller, port-forward] | ||
env: | ||
ARGO_EXECUTOR_PLUGINS: false | ||
ARGO_NAMESPACE: argo | ||
ARGO_NAMESPACED: true | ||
ARGO_MANAGED_NAMESPACE: argo | ||
ARGO_LOG_LEVEL: info | ||
ARGO_REMOVE_PVC_PROTECTION_FINALIZER: true | ||
ARGO_PROGRESS_PATCH_TICK_DURATION: 7s | ||
DEFAULT_REQUEUE_TIME: 1s | ||
LEADER_ELECTION_IDENTITY: local | ||
ALWAYS_OFFLOAD_NODE_STATUS: false | ||
OFFLOAD_NODE_STATUS_TTL: 30s | ||
WORKFLOW_GC_PERIOD: 30s | ||
UPPERIO_DB_DEBUG: 1 | ||
ARCHIVED_WORKFLOW_GC_PERIOD: 30s | ||
# ports: "9090" | ||
|
||
build-argo: | ||
cmd: make ./dist/argo | ||
deps: [go-deps] | ||
sources: [cmd/argo, config, errors, persist, pkg, util, server, workflow] | ||
env: | ||
STATIC_FILES: false | ||
# mutex: build | ||
|
||
server: | ||
cmd: ./dist/argo server | ||
deps: [build-argo, port-forward] | ||
env: | ||
ARGO_X_FRAME_OPTIONS: SAMEORIGIN | ||
ARGO_SECURE: false | ||
ARGO_NAMESPACE: argo | ||
ARGO_NAMESPACED: true | ||
ARGO_LOG_LEVEL: info | ||
ARGO_AUTH_MODE: hybrid | ||
ARGO_MANAGED_NAMESPACE: argo | ||
UPPERIO_DB_DEBUG: 1 | ||
# ports: "2746" | ||
|
||
ui-deps: | ||
cmd: yarn install | ||
dir: ui | ||
# mutex: downloads | ||
|
||
ui: | ||
cmd: yarn start | ||
dir: ui | ||
deps: [ui-deps, server] | ||
# ports: "8080" | ||
|
||
executor: | ||
cmd: make argoexec-image | ||
sources: [cmd/argoexec, config, errors, pkg, util, workflow] | ||
# mutex: docker | ||
|
||
example: | ||
cmd: kubectl create -f examples/hello-world.yaml | ||
deps: [install] | ||
# mutex: docker | ||
|
||
build: | ||
deps: [build-controller, build-argo] | ||
|
||
pre-up: | ||
deps: [build, install, executor, example] | ||
|
||
up: | ||
deps: [pre-up, controller, server, ui] |
This file was deleted.
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.
this was removed in the
goreman
->kit
migration (this line), added it back now sincetask
does not handle port forwardingThere 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.
this fixed the Controller E2E tests. some Server tests are failing because apparently the Server didn't start at all. apparently
task
was waiting fordeps
to finish (which totally makes sense), but starting a servers will never finish. so thecmd
s need to be backgrounded properly. then everything works ok.I think
kit
'sports
keyword (mentioned above) was just watching for ports to be opened before proceeding to the next task. nifty feature for servers.