-
Notifications
You must be signed in to change notification settings - Fork 39
Support arbitrary registration URL #610
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
base: main
Are you sure you want to change the base?
Conversation
Thank you for your contribution, however, I have to note that this registration only concerns the intermediate container used for RPM resolution, and not the final provisioned node(s). What is the problem that we're trying to solve? |
Enable the full process to be able to talk with a SUMA/RMT/SCC Instance. I understand that this container calls By allowing the registration URL just before the download, the downloads can be served by SUMA/RMT/SMT instead. Or at least is my understanding on when each stage is called 😅 |
This is awesome, thanks for the contribution. I'll do a quick test on my own to verify the templating part works correctly. In the meantime, I have a few notes on areas that aren't necessarily obvious that need to be updated before it can land:
|
@fdegir This is an outside contribution, so not on our roadmap, but can you put this on your todo list of things to add to CI? |
Light testing looked good to me. I don't have a local server to test against, but I was able to get the resolution script to show:
|
@@ -12,7 +12,7 @@ set -euo pipefail | |||
# Arch - sets the architecture of the rpm packages to pull |
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 more thing @josegomezr, please add mention of the new template variable and a brief description here.
Thanks for the contribution @josegomezr - another thing to mention in the documentation would be that by default we register against SCC/CDN, and that if the URL is omitted, this what we use by default. Thanks! |
Add support for `operatingSystem.packages.sccRegistrationUrl` to allow for registration against an RMT/SMT/SUMA.
Use net/url.Parse function to ensure a valid url is present
8b28958
to
5bf8166
Compare
* `sccRegistrationUrl` - Specifies a registration server like RMT or SUMA, which is used to connect download SUSE's internal RPM repositories. Defaults to `https://scc.suse.com`. | ||
|
||
> **_NOTE:_** When using `sccRegistrationUrl` over `https` it's important that the `eib` recognizes the CA of the `registrationUrl`. | ||
> This is common on RMT setups. See the [RMT docs on configuring clients](https://documentation.suse.com/sles/15-SP6/html/SLES-all/cha-rmt-client.html). |
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 must confess I'm not super inspired on this writing part, I'm very open to suggestions 😅
@atanasdinov @dbw7 @ipetrov117 - would you mind re-reviewing this? I think we should look to merge it if possible. Thank you! |
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.
Thank you for your contribution @josegomezr and apologies for jumping late on this.
Sadly, the suggested implementation does not handle all the use-cases that come with the sccRegistrationUrl
property introduction.
Ran some tests with this implementation against a local RMT server and found the following things to be working or in need of improvement.
Working:
- RMT server with
http
URL is successfully called and used in the RPM resolution process. Image is successfully built and booted.
In need of improvement:
- Currently,
sccRegistrationCode
andsccRegistrationUrl
are always bundled together. - The implementation does not really support
https
remote server urls.
TL;DR
Regarding (1), bundling these two properties together would mean that if users want to connect a local registration server, they must always provide a registration code. To my knowledge this is not always the case. RMT for instance does not require each connecting machine to provide a registration code. The registration code is placed onto the RMT server itself and connecting machines only need to provide the RMT server URL. IMO we should not bundle these two properties together.
Regarding (2), in the Building Images
documentation, we want to suggest the following:
When using
sccRegistrationUrl
overhttps
it's important that theeib
recognizes the CA of theregistrationUrl
.
There is actually no mechanism that EIB offers to add a custom certificate to the container that is running the RPM resolution process (in order to ensure a consistent RPM resolution process a new container is created inside of the EIB container, check our design doc about this if you have not already).
Yes, we have the certificates directory, however, it is not used to introduce certificates inside of the EIB container, or the RPM resolution container that is inside of it. It is used to introduce the certificates during the image boot. @atanasdinov @jdob please keep me honest.
So with today's implementation, if a user goes and provides sccRegistrationUrl: https://registration-server.like-rmt-smt.here
, during the RPM resolution process they would always get the following error:
SUSEConnect error: Post "https://<RMT_SERVER>/connect/subscriptions/systems": tls: failed to verify certificate: x509: certificate signed by unknown authority
To resolve this, the implementation would need to be enhanced to provide the certificate in some way.
@atanasdinov and @jdob, I would love to hear what you think, but from a first glance at the problem I see two approaches:
-
Use the
rmt-client-setup
script inside of the RPM resolution container to pull the certificates for the RMT server and connect to it (as described in the official doc). -
Introduce a mechanism that users could leverage to provide custom certificates to the RPM resolution container. In theory we could support a configuration similar to:
operatingSystem: packages: scc: registrationCode: <code> registrationUrl: <url> # Directory holding registration server specific certificates. # Created by the user within the Image Configure Directory certificateDir: <path>
With this approach, we would need to implement a mechanism to retrieve the certificates from
certificateDir
and transfer them to the RPM resolution container. This would ensure that the necessary certificates are always available in the container before attempting to connect to the registration server overhttps
.
Let me know if I missed or misunderstood something, but IMO we should not merge this implementation until we tackle/discuss the above points.
Leaving a note to self here: there seems to be support for populating the cert pool with arbitrary certificate and/or a directory! |
Add support for
operatingSystem.packages.sccRegistrationUrl
to allow for registration against an RMT/SMT/SUMA.Similar to suse-edge/misc#112