-
Notifications
You must be signed in to change notification settings - Fork 284
Suse: Introduce support for upstream repo #169
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
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.
I welcome a good intension to add upstream support for SUSE, but for me the implementation looks like half-done.
Very quick and rough investigation reveals obvious things. Please take a look at my in-line comments.
Also, would you mind to organize Git history in PR(s) a little bit? You can use --amend
to simply add stuff to your previous commit. And do --interactive
rebase to squash intermediate commits. This will significantly improve understanding what's changed and why, especially when the PR would be eventually merged.
name: pgdg-sles-{{ release }} | ||
humanname: PostgreSQL {{ repo.version }} $releasever - $basearch | ||
#Suse repos are suffixed 'suse/sles-12-$basearch' by upstream community convention. | ||
baseurl: 'https://download.postgresql.org/pub/repos/yum/{{ repo.version }}/suse/sles-12-$basearch' |
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.
Hard-coding SUSE release number looks not very flexible. Things may change, so maybe use $releasever
? However, this may affect OpenSuse...
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 cannot use '$releasever' because packages target Suse family (SUSE 12+, OpenSUSE 42+), so the upstream repo convention seems to be hardcoding of "sles-12". Using '$releasever' breaks the formula for Suse family except Sles 12.
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.
Yeah, that's true, I understand. My point was that the installation could be broken on other SUSE variants which is not currently supported by upstream: SLES 11, OpenSuse 13 or Tumbleweed.
In such cases it's better to fail fast. But that also introduces complexities.
I think this is fine for now.
baseurl: 'https://download.postgresql.org/pub/repos/yum/{{ repo.version }}/suse/sles-12-$basearch' | ||
gpgkey: 'https://download.postgresql.org/pub/repos/yum/{{ repo.version }}/suse/sles-12-$basearch/repodata/repomd.xml' | ||
#future: fix suse "4-Signatures public key is not available" issue and enable gpgcheck. | ||
gpgcheck: 0 |
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 not a SUSE expert by any mean, but I assume GPG key verification should just work as in other RedHat-based distro. Have you tried to resolve this? I would make a guess that the key public key file is just located elsewhere.
It looks not so nice to introduce "half-secure" solution by default.
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 agree its not nice - I'm looking for agreement to raise as "ISSUE" and fix afterwards.
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.
Yes I done some troubleshooting. But @myoung34 has identified the problem.
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 just need to provide correct public key URL, and I think everything would just "magically" work :)
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.
Duh, need to wear my reading glasses.
{% set lib_dir = '/var/lib/pgsql/' ~ repo.version ~ '/data' %} | ||
|
||
pkg: postgresql{{ release }}-server | ||
pkg_client: postgresql{{ release }}-server |
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.
As I see, client binaries are available from postgresql{{ release }}
package.
test: test -f '{{ lib_dir }}/PG_VERSION' | ||
|
||
# Directory containing PostgreSQL client executables | ||
bin_dir: /usr/pgsql-{{ repo.version }}/bin |
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.
Why to blindly copy-paste all the stuff? It seems that SUSE packages install all (?) needed alternatives itself during post-installation phase.
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 PR description explains why ... "Design is aligned with Redhat Stanza for convenience and continuity". It keeps the PR simple.
It seems that SUSE packages install all (?) needed alternatives itself during post-installation phase.
The upstream repo is common to SusE/RedHat/Fedora so same comment applies. Perhaps alternatives handling can be improved but lets keep PR focussed.
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 SUSE section does need to be full copy of RedHat just for the sake of artificial consistency.
These options bin_dir
, client_bins
and server_bins
serve a concrete purpose: allow subsequent states and postges
modules to properly discover binaries and be able to do the job.
Other distros don't have them, because they don't need to. That's why it is configurable.
The necessary thing should be already done by installed packages, so the formula must not duplicate this.
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 alternatives cod is legacy. Perhaps in the past the packages did not already do this.
I will investigate and raise common issue on RedHat/Suse.
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.
And Suse definitely doesn't require that.
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.
There has to be a better way to handle this than to cargo cult large blocks that are similar between os families
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 for pointing me in right way here. Surely RedHat has same problem.
Agreed - I tested and all except two are already handled by upstream packages.
pkg: postgresql-server | ||
pkg_client: postgresql | ||
pkg_libpq_dev: postgresql | ||
pkg_client: postgresql-server |
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.
Again, are you sure the client and the server package are the same in packages provided by SUSE distribution?
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.
Yes, I'm sure.
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.
Actually, it was a rhetoric question :)
https://software.opensuse.org/package/postgresql
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 sorry, okay thanks.
pillar.example
Outdated
pkgs_extra: | ||
- postgresql-contrib | ||
- postgresql-plpython | ||
pkgs_extra: [] |
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 aware that hard-coding platform-specific packages here was bad idea. But this possibly may affect later installation of the uuid_ossp
extension defined below. Have you tried to run test kitchen with provided config?
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, I've tested on OpenSUSE LEAP 42.
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.
Better to test your changes on other platforms as well, because you change shared things, and pillar.example
has been used in existent test. That's not perfect, and the change is actually meaningful, but we need to understand an impact.
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.
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 assume this affects Ubuntu and the existing test based on it.
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.
Also this is just a pillar.example
, just leave the values as is to help people understand layout. We only get one pillar.example and support (unofficially) any number of distros so it doesnt need to change with every iteration of what distro was last used against it.
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.
That's exactly what I've been trying to express 👍 But having some working example that fits the most popular ones would be great.
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.
Agreed. Will action.
humanname: PostgreSQL {{ repo.version }} $releasever - $basearch | ||
#Suse repos are suffixed 'suse/sles-12-$basearch' by upstream community convention. | ||
baseurl: 'https://download.postgresql.org/pub/repos/yum/{{ repo.version }}/suse/sles-12-$basearch' | ||
gpgkey: 'https://download.postgresql.org/pub/repos/yum/{{ repo.version }}/suse/sles-12-$basearch/repodata/repomd.xml' |
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 isnt a gpg key, this is a yum repo metadata xml file
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.
Good spot, thanks.
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 have found that starting from PostgreSQL 9.6 they ship valid repo key within the repo:
https://download.postgresql.org/pub/repos/zypp/9.6/suse/sles-12-x86_64/repodata/repomd.xml.key
I think we could leave 9.5 and versions below as is, since user is able to override GPG check in Pillar.
I see that there's a |
Could you please update the status of this PR? Would you have some time or any plans to work on it further according to review comments? |
Hey @vutny Thank you for reviewing!!!!! I will followup on #173 and your comments in this review in a new PR as soon as I make some time. |
@noelmcloughlin Awesome, thanks. So let's keep this PR open as a reminded until you'd have another one refactored. Then we close it out in favor of that. |
Hi @vutny I'll pick this up again as next priority, been hectic with other stuff. thx |
Rebased as #176 |
This PR is an enhancement to allow the upstream repo to be used for SLES and OpenSUSE.
The osmap.yaml was updated introducing the feature. Design is aligned with Redhat Stanza for convenience and continuity. These log files demonstrate working "feature" on OpenSuse LEAP 42 as postgresql 9.5 software is retrieved from upstream-
Limitation
GPGCHECK is disabled (for now): See https://redmine.postgresql.org/issues/2732
Followup
Nice to Have
The pillar.example was improved in the following manner-
Thanks