-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🌱 Add make targets for setting up Tilt #7097
Conversation
Skipping CI for Draft Pull Request. |
@Jont828: This issue is currently awaiting triage. If CAPI contributors determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Makefile
Outdated
|
||
.PHONY: tilt-up | ||
tilt-up: kind-cluster ## Start tilt and build kind cluster if needed. | ||
EXP_CLUSTER_RESOURCE_SET=true EXP_MACHINE_POOL=true tilt up |
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.
Is there a reason we are setting these env values here. A user can set the feature gates in tilt-settings.yaml
, right?
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.
I would also prefer having only one place where env vars / feature flags are enabled (tilt-settings.yaml) vs. overwriting them here hard-coded
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.
I think I just copied that over from my own set up. Just to clarify are we good to remove those env vars and just have it run tilt-up
?
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.
I'm fine with that
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.
I think the kind-reset target could be useful - but we should make the cluster name explicit in the kind-cluster target to ensure they're always targetting the same cluster.
The tilt up target doesn't seem that useful on top of the flow make kind-cluster && tilt up
and, as @ykakarap said, we shouldn't be including env variables there.
Makefile
Outdated
@@ -669,6 +669,14 @@ test-capd-junit: $(SETUP_ENVTEST) $(GOTESTSUM) ## Run unit and integration tests | |||
kind-cluster: ## Create a new kind cluster designed for development with Tilt | |||
hack/kind-install-for-capd.sh | |||
|
|||
.PHONY: kind-reset | |||
kind-reset: ## Destroys the "capi-test" kind cluster. | |||
kind delete cluster --name=capi-test || true |
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.
I dont think we can always assume that the kind cluster's name will be capi-test
given that make kind-cluster
can create clusters with other names. We can either enforce the cluster name as @killianmuldoon suggested or have the kind-reset
target also support the CAPI_KIND_CLUSTER_NAME
like the kind-cluster
target does.
I dont have strong opinions on either options.
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.
I would prefer to use the same logic here as we have in the script. Which means use the env var CAPI_KIND_CLUSTER_NAME
if it is set and fallback to capi-test
if the env var is not set
@sbueringer I've added make targets for removing .tiltbuild files and local charts per your comment in #7018, what do you think about this approach? |
Makefile
Outdated
|
||
.PHONY: clean-bin | ||
clean-bin: ## Remove all generated binaries | ||
rm -rf $(BIN_DIR) | ||
rm -rf $(TOOLS_BIN_DIR) | ||
|
||
.PHONY: clean-tilt | ||
clean-tilt: ## Remove all files in .tiltbuild | ||
rm -rf ./tiltbuild |
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.
I am good with adding this target but just FYI tilt-prepare
takes care of updating the files in .tiltbuild
if it observes any changes. Dropping this comment here incase this target was just added as part of the "pull the correct chart" problem.
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.
Yeah I added it since @sbueringer mentioned a while back we didn't have any way to clean up unused files in .tiltbuild
. For example when we change the output filename it won't remove the old file.
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 doesn't remove the .tiltbuild stuff in e.g. docker, controlplane, bootstrap, right? I guess we should remove ./**/.tiltbuild
?
This also won't clean artifacts in provider repos, so it could be slightly confusing, but those are just binaries I think.
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.
You are right, the .tiltbuild
folders under providers only contain the manager binaries for now. I think we should be fine with just cleaning up .tiltbuild
in the CAPI root.
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.
Let's delete all of them. Only deleting one is a bit inconsequential. I'm fine with just listing the 4 rm -rf calls here. After all they are pretty stable in core CAPI
nice improvement, lgtm pending open comments |
@fabriziopandini Sure thing. Do we want to put it on the Tilt dev page? |
b3b4d81
to
d76b044
Compare
I added some docs, PTAL when you have some time! |
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.
one small nit, otherwise lgtm
Makefile
Outdated
@@ -669,6 +672,14 @@ test-capd-junit: $(SETUP_ENVTEST) $(GOTESTSUM) ## Run unit and integration tests | |||
kind-cluster: ## Create a new kind cluster designed for development with Tilt | |||
hack/kind-install-for-capd.sh | |||
|
|||
.PHONY: kind-reset | |||
kind-reset: ## Destroys the kind cluster with the name $CAPI_KIND_CLUSTER_NAME. |
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.
kind-reset: ## Destroys the kind cluster with the name $CAPI_KIND_CLUSTER_NAME. | |
clean-kind: ## Cleanup the kind cluster with the name $CAPI_KIND_CLUSTER_NAME. |
Also, this target should be moved down in the file so it appears under the clean section (before clean tilt)
docs/book/src/developer/tilt.md
Outdated
After stopping Tilt, you can clean up your kind cluster and development environment by running | ||
|
||
```bash | ||
make kind-reset | ||
``` |
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.
q: should this be part of make clean (like all the clean targets)?
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.
I can see why they make sense as 2 different targets. make clean
is to delete all auto-generated files that are now part of the project folder strucutre. make kind-reset
doesn't really fall under the same category.
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.
In that case do we still want to rename make kind-reset
to make clean-tilt
? I had it next to make kind-cluster
in the file as it's the inverse operation.
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.
In that case do we still want to rename make kind-reset to make clean-tilt?
Did you mean rename kind-reset
to clean-kind
? If so, then yeah, I think that sounds good. (As suggested here: #7097 (comment))
I had it next to make kind-cluster in the file as it's the inverse operation.
Having make kind-reset
next to make kind-cluster
makes sense, since as you said they it is the inverse operation.
Alright I pushed some changes and squashed, I think we're ready for a last pass of reviews! |
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.
/lgtm
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.
Changes look good.
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.
/lgtm
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.
/lgtm
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it: Add make targets to create a kind cluster and set up Tilt with
make tilt-up
and delete kind cluster withkind-reset