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 from Kit to Taskfile #14017

Open
alexec opened this issue Dec 18, 2024 · 1 comment
Open

Migrate from Kit to Taskfile #14017

alexec opened this issue Dec 18, 2024 · 1 comment
Labels
type/feature Feature request

Comments

@alexec
Copy link
Contributor

alexec commented Dec 18, 2024

We should migrate the codebase to use Taskfile rather than Kit.

I've been using it on a recent project, and its a simple (YAML+Shell) popular (11k stars) task running. It can do almost everything that Kit can do, but has better documentation, and is easy to use.

I like it a lot.

I looked at other projects (e.g. Tilt) and found they tend to use complex DSLs.

cc. @agilgur5 @sarabala1979

@alexec alexec added the type/feature Feature request label Dec 18, 2024
@MasonM
Copy link
Contributor

MasonM commented Dec 19, 2024

Interesting, I was just looking into Kit and ways of improving the dev environment. I have to say I'm really impressed with Kit. It's a solid piece of software that does its job well.

One Kit feature we use that Task lacks is concurrency control using mutexes. There's two mutexes in task.yaml, one called docker and one called build:

- name: install
command: sh -c "make install PROFILE=$PROFILE"
env:
- PROFILE=minimal
dependencies: go-deps
watch: manifests
mutex: docker
- name: build-controller
command: make ./dist/workflow-controller
watch: cmd/workflow-controller config errors persist pkg util workflow
dependencies: go-deps
mutex: build

- name: build-argo
command: make ./dist/argo
dependencies: go-deps
env:
- STATIC_FILES=false
watch: cmd/argo config errors persist pkg util server workflow
mutex: build

- name: executor
command: make argoexec-image
watch: cmd/argoexec config errors pkg util workflow
mutex: docker
- name: example
command: kubectl create -f examples/hello-world.yaml
dependencies: install
mutex: docker

I don't think the docker one is necessary, because none of the tasks with that mutex conflict with each other. The build one does look to be necessary because make ./dist/argo and make ./dist/workflow-controller will both try to regenerate pkg/apis/workflow/v1alpha1/generated.proto and that logic involves writing temporary files:

argo-workflows/Makefile

Lines 362 to 375 in 7d7ebb1

pkg/apis/workflow/v1alpha1/generated.proto: $(GOPATH)/bin/go-to-protobuf $(PROTO_BINARIES) $(TYPES) $(GOPATH)/src/github.com/gogo/protobuf
# These files are generated on a v3/ folder by the tool. Link them to the root folder
[ -e ./v3 ] || ln -s . v3
# Format proto files. Formatting changes generated code, so we do it here, rather that at lint time.
# Why clang-format? Google uses it.
find pkg/apiclient -name '*.proto'|xargs clang-format -i
$(GOPATH)/bin/go-to-protobuf \
--go-header-file=./hack/custom-boilerplate.go.txt \
--packages=github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1 \
--apimachinery-packages=+k8s.io/apimachinery/pkg/util/intstr,+k8s.io/apimachinery/pkg/api/resource,k8s.io/apimachinery/pkg/runtime/schema,+k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/api/core/v1,k8s.io/api/policy/v1 \
--proto-import $(GOPATH)/src
# Delete the link
[ -e ./v3 ] && rm -rf v3
touch pkg/apis/workflow/v1alpha1/generated.proto

A workaround is to have make ./dist/argo be a dependency of make ./dist/workflow-controller or vice-versa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature Feature request
Projects
None yet
Development

No branches or pull requests

2 participants