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

Support oci:// chart pulling #581

Closed
skylenet opened this issue Feb 24, 2021 · 7 comments · Fixed by #612
Closed

Support oci:// chart pulling #581

skylenet opened this issue Feb 24, 2021 · 7 comments · Fixed by #612

Comments

@skylenet
Copy link

From helm version 3.5.0 (Release notes) onwards, there is support for pulling charts from OCI registries: https://helm.sh/docs/topics/registries/

Example:

$ export HELM_EXPERIMENTAL_OCI=1 
$ helm pull oci://my-registry.local/my-chart --version 1.0.0

It would be nice if we could also support this on helmsman.

e.g.

...
apps:
  my-app:
    chart: oci://my-registry.local/my-chart
    version: 1.0.0

If you try to do this currently you'll get an error like:

ERROR: chart [ ~/oci:/my-registry.local/my-chart  ] version [1.0.0] can't be found. Inspection returned error: "Error: path "~/oci:/my-registry.local/my-chart" not found" -- If this is not a local chart, add the repo [ helm ] in your helmRepos stanza
@luisdavim
Copy link
Collaborator

luisdavim commented May 18, 2021

Hi, would helm install --upgrade oci://my-registry.local/my-chart --version 1.0.0 be valid or do we have to use the pull command?
Do we have to pull and export?

@luisdavim
Copy link
Collaborator

luisdavim commented May 18, 2021

I've opened #612 but I haven't tested this or ever used OCI so my assumptions might be wrong there. I also don't have access to a setup where I could test it so I'd appreciate if you could give it a go and provide some feedback.

Thanks.

@skylenet
Copy link
Author

hey @luisdavim . Thanks for looking into this 👍

Hi, would helm install --upgrade oci://my-registry.local/my-chart --version 1.0.0 be valid or do we have to use the pull command?
Do we have to pull and export?

Unfortunately helm install doesn't support the oci:// protocol yet. Thus, doing helm pull and helm export is the correct way for now.

I've opened #612 but I haven't tested this or ever used OCI so my assumptions might be wrong there. I also don't have access to a setup where I could test it so I'd appreciate if you could give it a go and provide some feedback.

Thanks.

That's great! I gave it a quick try and the pull and export seem to work fine. I did get the following error afterwards once helm show chart tries to validate the chart:

2021-05-19 14:12:08 DEBUG: helm chart pull xxxxxxx.azurecr.io/helm/my-chart:1.0.0
2021-05-19 14:12:10 DEBUG: helm chart export xxxxxxx.azurecr.io/helm/my-chart:1.0.0 -d /home/default/code/helmsman/cmd/helmsman/example/.helmsman-tmp/tmp438318710
…
2021-05-19 14:12:11 DEBUG: helm show chart /home/default/code/helmsman/cmd/helmsman/example/.helmsman-tmp/tmp438318710/052039960my-chart:1.0.0 --version 1.0.0
2021-05-19 14:12:11 ERROR: chart [ /home/default/code/helmsman/cmd/helmsman/example/.helmsman-tmp/tmp438318710/052039960my-chart:1.0.0 ] version [ 1.0.0 ] can't be found. If this is not a local chart, add the repo [ tmp438318710 ] in your helmRepos stanza. Error output: Getting latest non-local chart's version /home/default/code/helmsman/cmd/helmsman/example/.helmsman-tmp/tmp438318710/052039960my-chart:1.0.0-1.0.0 failed with non-zero exit code 1: exit status 1
output:
--- stdout ---
 
--- stderr ---
Error: file '/home/default/code/helmsman/cmd/helmsman/example/.helmsman-tmp/tmp438318710/052039960my-chart:1.0.0' does not appear to be a gzipped archive; got 'application/octet-stream'
2021-05-19 14:12:11 CRITICAL: chart validation failed

This is what the directory structure looks like after the export:

➜  example git:(oci_support) ✗ ls -la  /home/default/code/helmsman/cmd/helmsman/example/.helmsman-tmp/tmp438318710/
total 12
drwx------ 3 default default 4096 May 19 14:12 .
drwxr-x--- 4 default default 4096 May 19 14:12 ..
-rw------- 1 default default    0 May 19 14:12 052039960my-chart:1.0.0
-rw------- 1 default default    0 May 19 14:12 449162077values.yaml
drwxr-x--- 3 default default 4096 May 19 14:12 my-chart

So for this current directory layout, helm show chart works if I do it like:

helm show chart /home/default/code/helmsman/cmd/helmsman/example/.helmsman-tmp/tmp438318710/my-chart/ --version 1.0.0

@luisdavim
Copy link
Collaborator

luisdavim commented May 19, 2021

oh, I need to remove that :<version> thanks for testing it I'll get it fixed after I'm done with my day job today :P

@luisdavim
Copy link
Collaborator

I've updated the PR and I think it should work now though I can't be sure since I don't have a way to test it...

@skylenet
Copy link
Author

@luisdavim it's working now 🎉

One way to test this could be by running a local registry and pushing some charts there. More about that in here: https://helm.sh/docs/topics/registries/

@luisdavim
Copy link
Collaborator

Awesome, thanks.

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 a pull request may close this issue.

2 participants