Skip to content

Containerize Uyuni #3451

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

Closed
wants to merge 82 commits into from
Closed

Containerize Uyuni #3451

wants to merge 82 commits into from

Conversation

moio
Copy link
Contributor

@moio moio commented Mar 19, 2021

What does this PR change?

This is an experiment to deliver Uyuni as containers.

See the official HackWeek page or the Development Wiki page for more information.

GUI diff

No difference.

  • DONE

Documentation

Test coverage

  • No tests: add explanation

  • No tests: already covered

  • Unit tests were added

  • Cucumber tests were added

  • DONE

Links

official HackWeek page

  • DONE

Changelogs

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)

Re-run a test

If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run:

  • Re-run test "changelog_test"
  • Re-run test "backend_unittests_pgsql"
  • Re-run test "java_pgsql_tests"
  • Re-run test "schema_migration_test_oracle"
  • Re-run test "schema_migration_test_pgsql"
  • Re-run test "susemanager_unittests"
  • Re-run test "javascript_lint"
  • Re-run test "spacecmd_unittests"

organization = args.organization
organization_unit = args.organization_unit
email = args.email
cname = '.'.join(fqdn.split('.')[-2:])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be the following. FQDN can be specified with a trailing dot for the dns root, would give you canonical names such as com. instead of example.com for this.example.com.

Suggested change
cname = '.'.join(fqdn.split('.')[-2:])
cname = '.'.join(fqdn.rstrip(".").split('.')[-2:])

Copy link
Contributor

@Shirocco88 Shirocco88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update from "opensuse/leap:15.2" to "opensuse/leap:15.3"

@@ -0,0 +1,27 @@
# rebuild with: docker build -t proxy .

FROM registry.opensuse.org/opensuse/leap:15.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FROM registry.opensuse.org/opensuse/leap:15.3

@@ -0,0 +1,19 @@
# rebuild with: docker build -t proxy .

FROM registry.opensuse.org/opensuse/leap:15.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FROM registry.opensuse.org/opensuse/leap:15.3

@@ -0,0 +1,18 @@
# rebuild with: docker build -t proxy .

FROM registry.opensuse.org/opensuse/leap:15.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FROM registry.opensuse.org/opensuse/leap:15.3

@@ -0,0 +1,22 @@
# rebuild with: docker build -t proxy .

FROM registry.opensuse.org/opensuse/leap:15.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FROM registry.opensuse.org/opensuse/leap:15.3

@@ -0,0 +1,44 @@
FROM opensuse/leap:15.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FROM opensuse/leap:15.3


podman run --pod hub-opensuse152 -ti --name hub-opensuse152-server localhost/uyuni

podman generate kube hub-opensuse152 > hub-opensuse152.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

podman generate kube hub-opensuse153 > hub-opensuse153.yml

open file and remove the last empty lines
> change image to be load from localhost:5000/uyuni

podman pod rm hub-opensuse152
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

podman pod rm hub-opensuse153



## deployment and management
minikube kubectl -- delete po hub-opensuse152
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minikube kubectl -- delete po hub-opensuse153

## deployment and management
minikube kubectl -- delete po hub-opensuse152

minikube kubectl -- create -f hub-opensuse152.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minikube kubectl -- create -f hub-opensuse153.yml


minikube kubectl -- get po -A

minikube kubectl -- describe pod hub-opensuse152
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minikube kubectl -- describe pod hub-opensuse153

@moio
Copy link
Contributor Author

moio commented Sep 15, 2021

Thanks for your comments @Shirocco88, we hope to be back on this topic soon.

Copy link
Contributor

@vzhestkov vzhestkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestions appended

Comment on lines +73 to +75
os.mkdir(config_path + "/salt")
os.mkdir(config_path + "/salt/pki")
os.mkdir(config_path + "/salt/pki/minion")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not to use os.makedirs instead?

Suggested change
os.mkdir(config_path + "/salt")
os.mkdir(config_path + "/salt/pki")
os.mkdir(config_path + "/salt/pki/minion")
os.makedirs("/salt/pki/minion")

Comment on lines +92 to +93
os.mkdir(config_path + "/sysconfig")
os.mkdir(config_path + "/sysconfig/rhn")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same as before:

Suggested change
os.mkdir(config_path + "/sysconfig")
os.mkdir(config_path + "/sysconfig/rhn")
os.makedirs(config_path + "/sysconfig/rhn")

mcalmer and others added 22 commits November 23, 2021 10:59
Signed-off-by: Ricardo Mateus <[email protected]>
Signed-off-by: Ricardo Mateus <[email protected]>
Signed-off-by: Ricardo Mateus <[email protected]>
Signed-off-by: Ricardo Mateus <[email protected]>
Signed-off-by: Silvio Moioli <[email protected]>
Signed-off-by: Silvio Moioli <[email protected]>
Signed-off-by: Silvio Moioli <[email protected]>
Signed-off-by: Silvio Moioli <[email protected]>
Signed-off-by: Silvio Moioli <[email protected]>
Signed-off-by: Silvio Moioli <[email protected]>
Signed-off-by: Silvio Moioli <[email protected]>
moio added 3 commits November 23, 2021 11:53
Signed-off-by: Silvio Moioli <[email protected]>
Signed-off-by: Silvio Moioli <[email protected]>
Signed-off-by: Silvio Moioli <[email protected]>
Copy link
Contributor

@SchoolGuy SchoolGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did my best looking over the PR and found a few things I am unsure about. In general I like the shape this is already!

@@ -0,0 +1,3 @@
#!/bin/bash

podman ps | grep proxy- | awk '{print $1}' | xargs -l1 podman kill
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this grep a bit too wide. Do we have any way to specify a more precise filter? Maybe proxy-uyuni? Or we use the Label we add to the container?

For Podman the filter can be added like this: podman ps -f KEY=VALUE

Docs: https://docs.podman.io/en/latest/markdown/podman-ps.1.html#filter-f

Copy link
Member

@agraul agraul Nov 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The grep could also be removed in favor of awk '/proxy-/ {print $1}'. See number 49 on https://catonmat.net/awk-one-liners-explained-part-three

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah or we move it in the filter expression of podman. Both is possible.

{{- end }}
resources:
requests:
storage: {{ .Values.storageSize }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all storageclasses support that you resize them. I would suggest we add an educated guess to the docs about the size this will have after what time/configuration.

@@ -32,7 +32,6 @@
import com.redhat.rhn.frontend.xmlrpc.ProxyNotActivatedException;
import com.redhat.rhn.frontend.xmlrpc.ProxySystemIsSatelliteException;
import com.redhat.rhn.frontend.xmlrpc.system.XmlRpcSystemHelper;
import com.redhat.rhn.manager.entitlement.EntitlementManager;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that this Java change is correct but I would like to know the reason for it. The commit message is a bit vague about this change.

Signed-off-by: Silvio Moioli <[email protected]>
@moio
Copy link
Contributor Author

moio commented Dec 16, 2021

While code and approaches tried out in this PR are good and will continue to be useful, I am closing this now in favor of more specialized PRs in-progress and upcoming, including in particular #4526, as the bulk of the work will progress there.

Many thanks to all authors and commenters, see you in the other PRs!

@moio moio closed this Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants