-
Notifications
You must be signed in to change notification settings - Fork 297
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
Fixes #38109 - As a user, I want to install flatpaks on remote hosts via REX #11264
Conversation
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.
Thanks @sjha4
I did not test this yet, but left some annoying nitpicks etc. below. Sorry!
@@ -0,0 +1,37 @@ | |||
<%# | |||
kind: job_template | |||
name: Install Flatpak and Firefox |
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'm assuming you're changing this so it's an input and not hard-coded to Firefox, right? Why have a template specifically for Firefox?
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.
No..This was bait for you to take a look and drive the PR from here on.. <3
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.
You know how to trick me!
kind: job_template | ||
name: Install Flatpak and Firefox | ||
job_category: Katello | ||
description_format: 'Install Flatpak and Firefox' |
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.
description_format
can use wildcards and incorporate the input.
- name: Password | ||
description: Password for container registry login |
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.
This is where we're meant to use the personal auth token, right? Maybe the input or description should call that out.
flatpak remote-add --authenticator-name=org.flatpak.Authenticator.Oci <%= remote_name %> oci+<%= server_url %>/ | ||
podman login <%= server_url %> --username <%= username %> --password <%= password %> | ||
cp /run/containers/0/auth.json /etc/flatpak/oci-auth.json | ||
flatpak install firefox --assumeyes |
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.
The actual install could probably be split into a second template, and then called here with render_template
. Then you could do flatpak installs separately assuming your installations and logins are already in place.
name: Install Flatpak and Firefox | ||
job_category: Katello | ||
description_format: 'Install Flatpak and Firefox' | ||
feature: katello_host_flatpak_install |
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.
If you're introducing a new REX feature, you'll have to register the feature (in plugin.rb I think?)
You don't have to use a feature, if you don't need easy access from Hammer or web UI..
@jeremylenz Thanks for the reviews..Working on them. This is kind of an early draft to make sure the flow makes sense..I'll split this into 2 templates : 1 for remote-add/authentication and another for the flatpak install. |
ed3d6d9
to
fc0a938
Compare
fc0a938
to
1cff036
Compare
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.
On second thought, I think it actually is a good idea to introduce and register new REX Features. The reason is that it makes it much easier to invoke REX jobs from the web UI. (sorry, I don't think I remembered this fully before)
Per the job_invocations API docs, in order to invoke a new REX job via API you need to either send the feature name, or the job template ID. Job template ID will be different for every database, so if we ever want to invoke one of these templates via web UI, we would need to have a feature.
kind: job_template | ||
name: Install Flatpak application on host | ||
job_category: Katello | ||
description_format: 'Install Flatpak application on host' |
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.
description_format: 'Install Flatpak application on host' | |
description_format: 'Install Flatpak application %{Application name} on host' |
Would be nice to include the application name here, as this will probably be displayed in the UI as a toast.
kind: job_template | ||
name: Setup Flatpak remote on host | ||
job_category: Katello | ||
description_format: 'Setup Flatpak remote on host' |
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.
description_format: 'Setup Flatpak remote on host' | |
description_format: 'Set up Flatpak remote on host' |
@@ -0,0 +1,35 @@ | |||
<%# | |||
kind: job_template | |||
name: Setup Flatpak remote on host |
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.
name: Setup Flatpak remote on host | |
name: Set up Flatpak remote on host |
1cff036
to
45d509f
Compare
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 didn't actually install podman or flatpak, but templates do render correctly and fail as expected. 👍 LGTM
45d509f
to
0ed0288
Compare
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.
Looks good to me.
packit/PRT passed at SatelliteQE/robottelo#17207
0ed0288
to
8cc049c
Compare
There is one pipeline failing. db:seed with ruby 2.7..Re-running suite to see if it's transient.. 😕 |
8cc049c
to
f766daa
Compare
f766daa
to
360cbe9
Compare
What are the changes introduced in this pull request?
Adds a new job template to setup flatpak remote, authentication and possibly install a flatpak repo on a host
Considerations taken when implementing this change?
We are not installing flatpak/podman. Admin/Client will need to do that on their own.
This will need to be run with sudo or as root on the host
What are the testing steps for this pull request?
To import the new job template:
In Rails console:
ForemanInternal.all.first.delete
Then run:
bundle exec rails db:seed