Support for hosted Helm repos #2
Comments
I'd like to do this, yeah! I have some of it in progress (I use an internal repo so I can move a bit quicker) but far from complete. Would you be into working with me on it @derkoe ? |
I'm not a Java developer, but anything I can help with? |
@DarthHater it would be nice to have a feature branch open with the current development.. |
@uliul-carpatin I'll see if I can push it up with a bit more progress soon. One of those things I don't want to do half baked. @tomdavidson help test it once I/we get something up! |
@DarthHater I'd like to test as well. Took me about a week to get this working as a built-in to Dockerized Nexus. It was then that I realized it only supported proxy. Guess I should have read the docs more thoroughly...stupid Y chromosome. |
@DarthHater This feature looks great. My team and I have been considering many ways to give authorization for helm charts repository but this looks better than others. |
I'll try and give this a bit more focus this week y'all! |
Made some progress on this today, gonna noodle a bit more and then see if I can get it out here on a branch for y'all. Just trying to figure out the best way to regenerate the index.yaml file each time a chart gets uploaded. Took some fun thinking as you can do it any number of ways, it's a question of which way will be the best for y'all to use, hopefully I took the right approach with some good input from @jlstephens89 |
Should have something for y'all to test next week. Thanks for keeping on me about this, I'll be stoked to see if it works to y'alls satisfaction! |
Aight @blackdog0403 @ntwrkguru @uliul-carpatin @derkoe @tomdavidson I got something that will generate the
This means that your repo at current time would have everything under The design for all of this mimics quite a bit of what we do for Yum createrepo in Nexus Repo 3, and thanks to @jlstephens89 and @doddi for guiding me down the path! |
Nice! A pipeline that releases to the repo will need to wait for the index.yaml before trying to deploy or have a quite small interval so I have a few questions to help me understand the implications:
|
@tomdavidson we chose this approach for Helm because we expected a lot of releases, versus with R we generate the metadata on each request (which can fall down at scale, but we didn't expect a LOT of releases on an R hosted repository).
Hope that helps! |
oh yes, give me some magic! Thank you for explaining how it works to me - this is prob obvious to many others. The race I was concerned about is the new artifact webhook triggering a deploy job and the job can't find the artifact because the index.yml is not created it. |
The configurable delay was something we added for Yum to prevent multiple
successive rebuilds when someone was uploading a LOT of RPMs. The helm
implementation can get everything it needs from the database and doesn't
need to crack open the charts so the default could / should be a lot lower
than 60 seconds (say 1 second). We should also benchmark it with a lot of
traffic as it might be unnecessary for Helm.
…On Wed, Aug 1, 2018 at 10:20 PM Tom Davidson ***@***.***> wrote:
oh yes, give me some magic!
Thank you for explaining how it works to me - this is prob obvious to many
others. The race I was concerned about is the new artifact webhook
triggering a deploy job and the job can't find the artifact because the
index.yml is not created it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANEL8xjxd3jKXiOp9l8-_2_Di9-IJyE7ks5uMlPZgaJpZM4TyhZv>
.
--
Joseph Stephens
Software Developer
Sonatype, Inc.
8161 Maple Lawn Blvd., Suite 250
Fulton, MD 20759
jstephens@sonatype.com <mben-soula@sonatype.com>
o: 3
<https://app.onsip.com/app/call?n=Sue%20Jasmin&a=sjasmin%40sonatype.onsip.com>
01.684.8080 x628
|
The artifact should be available as soon as it's published by the standard URL, so as long as something is calling that, it'll be fine. The index.yaml will be available with updated metadata in 60 seconds, or that can be tuned down. As @jlstephens89 said, we can likely change the configured time down, or just abandon it entirely if it's unecesssary (or better yet y'all can send an opinionated PR that does that :) ). I'd like y'all to test this once I get it out and let me know what seems to fit best. I anticipated quite a bit of publishing with helm, but maybe I was a bit overly enthusiastic. The format seems like one given CI/CD where you might publish a lot of charts, but I don't fully get when you'd make a change to a chart (could be infrequent), versus when you'd make a change to a Docker image (which seems to be very frequent). |
Gotta get through a PR process, but today I got it to save what I think is a valid index.yaml file after uploading three charts:
Pretty stoked! Still need to get the created DateTime right (fun times with snakeyaml), but it's looking pretty good to me. |
Okie dokie, I just pushed this out to master, I'll tag a release as well to make it obvious. I have NOT added documentation related to this yet, because I would like some people to test it first to let me know what they run into before I make it explicitly known it's out. You'll want to setup a I've been using curl to test thus far, an example of such is:
Once you upload charts, they should get processed by Nexus Repo, and in 1 second a new index.yaml should get created at the root. Adding this repo should be very similar to how you would add a proxy repo to helm, take a gander at that! Please let me know what issues you run into, create new ones here, etc... and I'll dive in to them. Thanks for the patience! CC @blackdog0403 @ntwrkguru @uliul-carpatin @derkoe @tomdavidson @JPWKU |
Stuff I want to know about:
Etc.... I am a helm user but pretty light overall, so I'd love to know more about your use, as I am sure it will eclipse mine! |
Testing now. Re: Your Dockerfile; I use a multi-stage build. I'm sure it can be improved, but it seems to work. The key parts are the initial Below that, in the main image build steps, I Something like this:
|
Neato, thanks for sharing! Feel free to create a new issue if you think we can improve the one we have out there, or send a PR! |
Yours is cleaner, for sure, so maybe I'll submit a PR to add a build stage to the one you have. :-) |
DOH!!! Ignore me...I'm completely out of it today...that Dockerfile totally uses a build stage. |
Hah yeah I was wondering! No worries, my head is a bit in the clouds today :) |
FTR I turned the 60 second rebuild time down to 1 second, and it's still configurable, if you want to play with different intervals. |
For some reason, it builds fine on my Mac, but not on my Ubuntu 14.04 server. Pardon the garbled junk...it's Ansible's output:
|
@ntwrkguru Does your stack trace include which test fails? |
Got it to work with some "magic". It's probably not your code, rather my implementation. I can indeed create a hosted helm repo, but am I correct in assuming that this only accepts uploads via curl at the moment? I attempted to add the repo using |
@ntwrkguru , you likely won't be able to add a repo until after you've uploaded artifacts to it, as the You can upload to the repo via anything that does HTTP PUT, so curl, wget, your own code, etc... |
@DarthHater does the hosted helm repo still support proxying to an external repo? |
@DarthHater |
@brezblock See my PR #5 |
Hi, keen to use this, but can't get it to work. I'm running nexus 3.13.0-01. I've successfully published a helm chart to the repo, and I can see that it has created an index.yaml file - it shows up in the browse view, and lists a file size and blob reference etc. But when I try to actually download it, I get a 404 (eg from http://my-nexus-hostname:8081/nexus/repository/my-helm/index.yaml which is the url listed 'Path' in the summary view when browsing the repo). I've tried regenerating the index.yaml but still get the same behaviour. I can see the contents of the file in the blob store on the disk, and it looks correct. Any idea what's going on here? Have I done something stupid or does something not quite work right? |
@jonathansloman I noticed this bug as well. I’ve been meaning to open an issue. Restart nexus and it should see the index.yaml. You only need to do this once for the initial index create. |
Hey y'all! Sorry, I was out on vacation. Appreciate the feedback, I'll see what I can get merged, etc... today! |
Thanks, can confirm this fixes it. One the one hand, glad it wasn't something stupid I did, on the other hand, should have thought of restarting to try to fix it myself.. |
That seems super odd that you two needed to restart (I've never experienced this). I'll see if I can spin things up and recreate it! |
Yeah our dev and prod nexus server exhibited the same issue. You have to push a single chart, then restart nexus the 2nd time. After that, its good for new indexes. |
SUPER weird. Lemme play with it. I left out some functionality that would allow you to generate the index.yaml manually (rather than automagically like now), maybe I can add that in for trouble shooting, but I'd love to know why it's not working right out of the gate for y'all. |
Maybe the nexus frontend is caching something about the store and the restart clears the cache making the index.yaml available? |
Hey guys, need some informations because as I correctly intend, the "hosted" repo was a really recent improvement. I created an "hosted helm repo" on my Nexus instance. Now in the list of repositories I have helm repo too, with the relative URL (ex: https://nexus.mydomain.com/repository/charts/). I uploaded a chart package in the way in which @DarthHater did here #2 (comment) (I don't know if there is another way to do that). Now I tried to add this new repo to my helm client then I did:
but I receive:
I don't know if it is the best place to ask this, but I saw that this is the issue about "hosted helm" feature and wanted to avoid duplication. In case tell me where repost. Thank you for your support |
hi @g0blin79 - read my comment above, it's the same issue. The index.yaml file, though it exists, is not visible after you add your first chart. Try restarting your nexus, you should then find the index.yaml is visible and you can do the helm repo add. |
@jonathansloman yes, sure: thank you. Now it works. |
Ok y'all, after some talking with @jlstephens89 I think we figured out why the index.yaml might not "show up" until after a restart, and that was because I was adding a NegativeCacheHandler to Hosted repos. I went ahead and got rid of that, and tagged a new release: https://github.com/sonatype-nexus-community/nexus-repository-helm/releases/tag/v0.0.4 Give that a whirl and let me know your experience! What I think was happening was that a request for the index.yaml was cached as 404, and that cache wasn't busted until you restarted Nexus Repo. Removing the negative cache handler SHOULD alleviate that, I believe. |
I'm gonna play a bit more with the exact commands y'all are running too, got some free time today! |
wow now it works like a charm. But (don't hate me...)... It's not clear for me if there is a way more "standard" to upload a chart via command-line. Anyway, any other solution could be really appreciated. Meantime a "curl" could be enough 😄 |
@DarthHater Ok I just tested out 0.0.5 and things seem to be working. |
@g0blin79 I haven't been able to get this in its own repo, but I created a simple helm plugin to |
That's neat @dtshepherd ! If you rewrote it in Golang (maybe I can help you) maybe we can get it accepted to helm itself? |
There's already a stale ticket here: helm/helm#3564 Also, the push interface may be too specific for helm itself. The plugin should probably be called The github plugin is written in bash: https://github.com/sagansystems/helm-github/blob/master/github.sh. I kind of like using bash because it doesn't require more binary packaging, but I can understand wanting it to be in Go. Not sure what repo to host this code in yet, but I do find it useful for integration with your nexus helm plugin. |
Yeah I love it! If you write it in Golang you'll probably get more helm people to pitch in on it at some point. I'd gladly help you on that (I love writing Go). If you want, we can create a repo here on sonatype-nexus-community, something like |
Yeah, I'd be on board with that. I can write Go as well, I don't think it will be much effort to port it. |
@dtshepherd send me an email at jhesse at sonatype dot com and I'll help you get some stuff put together for it, already created the repo/added you as an org member, etc... |
Has any one uploaded a .tgz.prov file along with a .tgz file? |
hi, Is it possible to have a folder structure? |
Hi all, has anything been done regarding the above post? Chartmuseum supports nested folders by defining a "depth" parameter. Can something like that be added here or do we have to create multiple repositories? |
I’ve installed version 0.0.13 on Nexus 3.19 but have an issue with ‘helm push’ - server returns 500. Was it fixed or not? |
@vosmax no need to use helm push, you just need to upload the package to the repo somehow. I use curl: |
What are you trying to do?
Creating a hosted Helm repository.
What feature or behavior is this required for?
To publish inhouse Helm Charts
Anything else?
Is there any plan to support hosted (and probably proxy) Helm repositories?
The text was updated successfully, but these errors were encountered: