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

Hub XML-RPC upgrade support #408

Closed
wants to merge 53 commits into from
Closed

Conversation

cbosdo
Copy link
Contributor

@cbosdo cbosdo commented Jul 18, 2024

What does this PR change?

Cherry-pick and massage bits from #357 to add hub xml-rpc support to the mgradm upgrade podman command. Also fix the coco upgrade too.

Test coverage

  • No tests: hard to cover ATM
  • DONE

Links

Issue(s): #

  • DONE

Changelogs

Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository

If you don't need a changelog check, please mark this checkbox:

  • No changelog needed

If you uncheck the checkbox after the PR is created, you will need to re-run changelog_test (see below)

Before you merge

Check How to branch and merge properly!

rjmateus and others added 30 commits July 17, 2024 13:50
In order to avoid adding return variables for each value we want to
extract at migration time we are now collecting them in a result object.

This object could later be extended and reused for the inspect scripts
instead of using a map.
When migrating from a non-containerized server, the user may want to
setup confidential computing attestation.
The computation of image URLs suffered several problems.

  * The registry had to be manually set in the image flags: this is too
    error prone, and already some assignements were missing.
  * The way the images URL were computed was different between proxy and
    server
The dash in the salt-broker parameters name make Viper try to marshall
the parameters into a nested structure that we don't have. Changing the
parameters from --salt-broker-[image|tag] to --saltbroker-[image|tag]
solves the issue.
Creating the service and leaving it disabled allows to call the scale
command later to enable it.
Migrate also needs to setup the Hub XML-RPC API container. Reshuffling
the code a bit to share what install is doing.
Using podman creds is not secure as those will show up in the the ps output.
Instead we generate a temporary podman authentication file and pass it to
podman pull.
It doesn't make sense to try to extract all the values for both
containers and hosts. This commit introduces Inspector objects that are
responsible for generating the inspection script and parsing it into a
structure.

While at it, the extracted values that were not used have been removed.
This gains quite some time at each execution since extracting the
SCC registration status was quite long.

While doing this we could also drop the InspectData proxyHost flag as
SCC credentials are extracted for both server and proxy hosts.
Calling Fatal().Err() is not enough without .Msg(), but instead
just return error.

This also enables term and exec logging with trace log level.
The Helm chart path on the registry may be different from the one of the
container images. Create two separate variables to set those paths.
To make sure there is no slash in the path of the SQL file in the
container use the basename to compute the temporary filename.
The command outputs usually have a trailing new line, which fails
value != "true" in all cases. This is forcing the update of the podman
network even if it's not needed.
The scripts executed at installation, migration and upgrade time were
logging their output only in the console. Using the pre-configured
logger logs them to both the file and the console.
Properly check for write access to /var/log/uyuni-tools.log. If this
can't be used, print the log file path as first thing.
nadvornik and others added 23 commits July 18, 2024 12:28
Cobra inherits the UsageFunc from the parent classes, and the
implementation for the grouped flags was recursing: using the function
of a blank command object rather than setting to default breaks the
loop.
Most of the code is now shared between mgradm and mgrpxy.

mgradm support config tarball content:

 - tarball created by supportconfig command inside the container
 - tarball created by supportconfig command in the host
 - content of all the systemd files and configuration related to the server (systemctl cat uyuni-*)
 - content of all the bound files (it should be empty by now)
 - podman inspect
 - podman logs (it should be empty by now)

mgrpxy support config tarball content on podman:

 - tarball created by supportconfig command in the host
 - content of all the systemd files and configuration related to the proxy (systemctl cat uyuni-*)
 - content of all the bound files (e.g. apache tuning, squid tuning, other conf files)
 - podman inspect
 - podman logs

mgrpxy support config tarball content on kubernetes:

 - content of all configmap (all the configuration such as apache and squid are embedded there)
 - content of kubectl get pod -o yaml command
A command to help cleaning the squid cache on the proxy would be quite
appreciated as this is the best way to fix some issues.
In order to allow updating the image at each upgrade and keep the user
configuration, move the image in generated.conf and the rest in
custom.conf
If the volumes are already populated, try to reuse the existing user/org
if it is possible.
If we stop the coco instances how can we determine how many we have to
spin up again? The best thing to do is to just restart them all.
During migration, detect if the Hub XML-RPC API is enabled on the the
migrated server and enable it automatically in such a case without the
need to provide the number of replicas.
@cbosdo
Copy link
Contributor Author

cbosdo commented Jul 19, 2024

closed: autosquashed and pushed to the big PR #405.

@cbosdo cbosdo closed this Jul 19, 2024
@cbosdo cbosdo deleted the hub-upgrade branch July 19, 2024 12:46
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.

8 participants