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 #1

Closed
wants to merge 42 commits into from
Closed

Hub XML-RPC upgrade support #1

wants to merge 42 commits into from

Conversation

cbosdo
Copy link
Owner

@cbosdo cbosdo commented Jul 19, 2024

What does this PR change?

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

Test coverage

  • No tests: add explanation

  • No tests: already covered

  • Unit tests were added

  • 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!

cbosdo and others added 30 commits July 18, 2024 12:28
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.
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
rjpmestre and others added 12 commits July 18, 2024 12:28
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
Owner Author

cbosdo commented Jul 19, 2024

Closed: it was only to make review easier

@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.

6 participants