Skip to content

Fix problems including missing charts and the kubeconfig permission#7033

Merged
popojk merged 3 commits intoflyteorg:v2from
0yukali0:flyte-7032
Mar 16, 2026
Merged

Fix problems including missing charts and the kubeconfig permission#7033
popojk merged 3 commits intoflyteorg:v2from
0yukali0:flyte-7032

Conversation

@0yukali0
Copy link
Contributor

@0yukali0 0yukali0 commented Mar 16, 2026

Tracking issue

#Close #7032

Why are the changes needed?

  • Environment: wsl ubuntu
  1. Fix make sandbox-build failure caused by missing directory.
image
  1. Update permission of kubeconfig from k3s in order to execute make sandbox-run command to copy it.
image

What changes were proposed in this pull request?

  1. helm dependency update creates charts and downloads related tar if missing directory or empty directory happens
  2. Update the group and user of kubeconfig to allow make command to copy it.

How was this patch tested?

  1. git clone https://github.com/flyteorg/flyte.git -b <this pr branch>
  2. cd flyte
  3. make sandbox-build
  4. make sandbox-run
  5. export KUBECONFIG=~/.flyte/sandboxv2/kubeconfig
  6. kubectl get pods -A or k9s

Labels

  • fixed

Setup process

Screenshots

image
  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Signed-off-by: yuteng <a08h0283@gmail.com>
@machichima
Copy link
Member

I can reproduce the first issue on macOS by running make sandbox-build:

cd ../../charts/flyte-sandbox/charts && for f in *.tgz; do tar xzf "$f"; done
tar: Error opening archive: Failed to open '*.tgz'
make[1]: *** [dep_update] Error 1
make: *** [sandbox-build] Error 2

.PHONY: dep_update
dep_update:
@if [ ! -d ../../charts/flyte-sandbox/charts ] || [ -z "$$(find ../../charts/flyte-sandbox/charts -maxdepth 1 -name '*.tgz' -print -quit)" ]; then \
cd ../../charts/flyte-sandbox && helm dependency update; \
Copy link
Member

@machichima machichima Mar 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use helm dependency build instead? This will reconstruct the chart dependencies without updating the lock. I think this is better to not update Chart.lock every time we do make sandbox-build

https://helm.sh/docs/helm/helm_dependency_build

Maybe we can add new dep_build command to build, and have another make command to do the update, so that we can use if we want to update .lock file

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And to use helm dependency build, we should add a new make command to add helm repos

.PHONY: helm-repos
helm-repos:
	helm repo add docker-registry https://twuni.github.io/docker-registry.helm || true
	helm repo add kubernetes-dashboard https://kubernetes-retired.github.io/dashboard/ || true
	helm repo add bitnami https://charts.bitnami.com/bitnami || true
	helm repo update

Comment on lines +29 to +31
@if [ ! -d ../../charts/flyte-sandbox/charts ] || [ -z "$$(find ../../charts/flyte-sandbox/charts -maxdepth 1 -name '*.tgz' -print -quit)" ]; then \
cd ../../charts/flyte-sandbox && helm dependency update; \
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I think it's better to rebuild on every dep_update, to prevent having stale dependencies.

cd ../../charts/flyte-sandbox && helm dependency build

@machichima
Copy link
Member

I didn't get the second issue on my side (mac OS). But I think we can keep this change to support running on wsl

❯ make sandbox-run

Makefile:30: warning: overriding commands for target `build'
go.Makefile:75: warning: ignoring old commands for target `build'
Makefile:53: warning: overriding commands for target `help'
go.Makefile:25: warning: ignoring old commands for target `help'
/Library/Developer/CommandLineTools/usr/bin/make -C docker/sandbox-bundled start
[ -n "flyte-sandbox" ] || \
                docker volume create flyte-sandbox
6773d779b5f13d71366555447ded4d288d2b92185773c7df57706d463ade637c
Waiting for kubeconfig...
Kubeconfig copied to ~/.flyte/sandboxv2/kubeconfig

fi
@echo "Waiting for kubeconfig..."
@until [ -s $(PWD)/.kube/kubeconfig ]; do sleep 1; done
@docker exec flyte-sandbox chown $(shell id -u):$(shell id -g) /.kube/kubeconfig
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave a comment here showing that this is for WSL

# On WSL, the bind-mounted kubeconfig may be root-owned, which makes the host-side cp fail with permission denied.

Signed-off-by: yuteng <a08h0283@gmail.com>
@0yukali0
Copy link
Contributor Author

@machichima Thanks for comments.

I added mentioned suggestions into the next commit.

Proposals

  1. helm-repos command adds helm sources which is same as Chart.yaml
  2. dep_build command downloads tars .

Screenshot

image

@github-actions github-actions bot mentioned this pull request Mar 14, 2026
3 tasks
Comment on lines +29 to +31
helm repo add docker-registry https://twuni.github.io/docker-registry.helm || true
helm repo add kubernetes-dashboard https://kubernetes-retired.github.io/dashboard/ || true
helm repo add bitnami https://charts.bitnami.com/bitnami || true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, why do we need to add || true here? If the repo already exists, we will not get error. With and without || true will give the same output

❯ helm repo add bitnami https://charts.bitnami.com/bitnami || true
"bitnami" already exists with the same configuration, skipping

❯ helm repo add bitnami https://charts.bitnami.com/bitnami
"bitnami" already exists with the same configuration, skipping

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mistakenly copied the comments including helm sources and overlooked removing the || true comments.
I will remove them properly.

Signed-off-by: yuteng <a08h0283@gmail.com>
Copy link
Member

@machichima machichima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I can start sandbox successfully and run examples
cc @popojk for final check

Copy link
Contributor

@popojk popojk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

@popojk popojk merged commit a2df398 into flyteorg:v2 Mar 16, 2026
13 of 14 checks passed
afbrock pushed a commit that referenced this pull request Mar 18, 2026
…7033)

* fix problems about missing charts and kubeconfig permission

Signed-off-by: yuteng <a08h0283@gmail.com>

* make dep_build including updating helm-repo and build charts

Signed-off-by: yuteng <a08h0283@gmail.com>

* deleted unused operator

Signed-off-by: yuteng <a08h0283@gmail.com>

---------

Signed-off-by: yuteng <a08h0283@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants