-
Notifications
You must be signed in to change notification settings - Fork 768
[Executor] Update taskaction cr #6826
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
Open
machichima
wants to merge
12
commits into
flyteorg:v2
Choose a base branch
from
machichima:udpate-taskaction-cr
base: v2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,708
−162
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
631c224
feat: remove phase and message
machichima 527df00
feat: add condition type and reason constant
machichima b2e2f44
feat: use condition instead of phase
machichima 0b75f7b
Merge branch 'v2' of github.com:flyteorg/flyte into udpate-taskaction-cr
machichima 5316f5f
feat: add read task spec
machichima d56d9f5
fix: update go mod to build executor correctly
machichima 27fd1b6
feat: add printcolumn for taskaction crd
machichima 1319ee6
build: update dockerfile and makefile to build successfully
machichima 7f9ba05
docs: add development guide and readme
machichima 31a6b6d
feat: add mockery for workflowconnect
machichima 6221b4c
test: update taskaction controller test to make it pass
machichima 0545633
feat: add validation for ParentActionName
machichima 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 hidden or 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 hidden or 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,154 @@ | ||
| # Executor Development Guide | ||
|
|
||
| This guide provides steps on how to develop and iterates changes. | ||
|
|
||
| ## Prerequisites | ||
| - go version v1.24.0+ | ||
| - docker version 17.03+. | ||
| - kubectl version v1.11.3+. | ||
|
|
||
| ### Setup on kind | ||
|
|
||
| We recommend using kind to create a Kubernetes cluster for local development. | ||
|
|
||
| ### Use go v1.24 | ||
|
|
||
| Currently, flyte-v2 use go v1.24 for development. | ||
|
|
||
| ```sh | ||
| go install golang.org/dl/go1.24.0@latest | ||
| go1.24.0 download | ||
| export GOROOT=$(go1.24.0 env GOROOT) | ||
| export PATH="$GOROOT/bin:$PATH" | ||
| ``` | ||
|
|
||
| ### Clean up local binaries | ||
|
|
||
| To keep consistent code generation and testing result, it is recommended to remove outdated binaries installed by the Makefile. | ||
|
|
||
| ```sh | ||
| make clean | ||
| ``` | ||
|
|
||
| ## Local development on kind cluster | ||
|
|
||
| Following steps requires you to switch your workign directory to the `executor/`. | ||
|
|
||
| ```sh | ||
| cd executor | ||
| ``` | ||
|
|
||
| ### Run executor inside the cluster | ||
|
|
||
| 1. Create a kind cluster | ||
|
|
||
| ```sh | ||
| kind create cluster --image=kindest/node:v1.26.0 --name flytev2 | ||
| ``` | ||
|
|
||
| 2. Build the image | ||
|
|
||
| ```sh | ||
| IMG=flyteorg/executor:nightly make docker-build | ||
| ``` | ||
|
|
||
| 3. Load image into kind cluster | ||
|
|
||
| ```sh | ||
| kind load docker-image flyteorg/executor:nightly --name flytev2 | ||
| ``` | ||
|
|
||
| 4. Install CRD in to the cluster | ||
|
|
||
| ```sh | ||
| make install | ||
| ``` | ||
|
|
||
| 5. Deploy the Manager to the cluster with the image specified by `IMG`: | ||
|
|
||
| ```sh | ||
| make deploy IMG=flyteorg/executor:nightly | ||
| ``` | ||
|
|
||
| 6. Clean up | ||
|
|
||
| ```sh | ||
| kind delete cluster --name flytev2 | ||
| ``` | ||
|
|
||
| ### Run executor outside the cluster | ||
|
|
||
| 1. Create a kind cluster | ||
|
|
||
| ```sh | ||
| kind create cluster --image=kindest/node:v1.26.0 --name flytev2 | ||
| ``` | ||
|
|
||
| 2. Install CRD in to the cluster | ||
|
|
||
| ```sh | ||
| make install | ||
| ``` | ||
|
|
||
| 3. Compile the source code and run | ||
|
|
||
| ```sh | ||
| # Compile the source code | ||
| make build | ||
| # Run the executor | ||
| ./bin/manager | ||
| ``` | ||
|
|
||
| ## Tests | ||
|
|
||
| ### Manual test | ||
|
|
||
| You can apply the samples from the config/sample using the following command: | ||
|
|
||
| ```sh | ||
| kubectl apply -k config/samples/ | ||
| ``` | ||
|
|
||
| You can see the `TaskAction` CRD created: | ||
|
|
||
| ```sh | ||
| ❯ k get taskactions | ||
| NAME RUN ACTION STATUS AGE | ||
| taskaction-sample sample-run sample-task Completed 59m | ||
| ``` | ||
|
|
||
| Or use `-o wide` to view more details: | ||
|
|
||
| ```sh | ||
| ❯ k get taskactions -o wide | ||
| NAME RUN ACTION STATUS AGE PROGRESSING SUCCEEDED FAILED | ||
| taskaction-sample sample-run sample-task Completed 59m False True | ||
| ``` | ||
|
|
||
| ## Modify CRD | ||
|
|
||
| ### Quick Steps | ||
|
|
||
| 1. Modify the types file: Edit `api/v1/taskaction_types.go` | ||
| - Add/modify fields in `TaskActionSpec` or `TaskActionStatus` | ||
| - Add/modify printcolumns (the `// +kubebuilder:printcolumn` comments above the `TaskAction` struct) | ||
| - Add validation rules using `// +kubebuilder:validation:` markers | ||
|
|
||
| 2. Generate CRD manifests and DeepCopy code | ||
|
|
||
| ```sh | ||
| make manifests generate | ||
| ``` | ||
|
|
||
| This runs two commands: | ||
| - `make manifests`: Updates YAML manifests: | ||
| - `config/crd/bases/flyte.org_taskactions.yaml` (CRD with schema, validation, printcolumns) | ||
| - `config/rbac/role.yaml` (RBAC permissions) | ||
| - `make generate`: Updates Go code: | ||
| - `api/v1/zz_generated.deepcopy.go` (DeepCopy methods required by Kubernetes) | ||
|
|
||
| 3. Update CRD in the cluster | ||
|
|
||
| ```sh | ||
| make install | ||
| ``` |
This file contains hidden or 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 hidden or 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 hidden or 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
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.
Set working dir to root so that we can copy all required things in
Dockerfile