-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Provide RPM/specfile? #138
Comments
This would be a great idea! I've never done one from scratch, but I have an (example) from a user that could get us started - this is called
Would you be able to help / take lead on finishing this guy up? I am pinging @griznog who can take credit for this work! If we can work together it would be awesome! I would appreciate it greatly as I'd learn a lot too :) |
Yah, some help would be appreciated as I'm not very good at spec files. That being said, I can poke around with this or wait to see if @griznog has anything to add. |
I've since dismissed the brain cells that had looked at this for dereliction of duty, but I think the above spec file may Just Work(tm) if the repo tags a release for it to reference and download and the release versions match in the repo and spec. |
Cool, so what does one do with that file? |
First thing I'd try is putting it in the repo as sregistry.spec. Then set the line for
To whatever the github release version is. Then tag a release (no idea how that works) so that github generates the .tar.gz file with the version and that spec file included. No with the resulting .tar.gz, it's just
and you'll either get errors or rpms. One of which will be an srpm which can then be distributed and anyone can rebuild with That's all from memory and untested, so grains of salt as required. |
Also, dependencies are left as an exercise for the reader :) |
ok testing this out! |
okay @fearful-symmetry you can take it from here! I have a basic .tar.gz built that you can download and (see if you are able to get it to build / make tweaks to do so). Here is what I was doing to test it: # download
cd /tmp
wget https://github.com/singularityhub/sregistry-cli/archive/0.0.91.tar.gz
# I messed up a label somewhere because it wants the file with and without the name
$ cp 0.0.91.tar.gz sregistry-0.0.91.tar.gz
$ rpmbuild -ta 0.0.91.tar.gz
error: Failed build dependencies:
python-devel is needed by sregistry-cli-0.0.91-0.x86_64 I tried in a container to get around installing random stuff on my host: docker run -it centos bash
yum update && yum install -y python-devel wget
cd /tmp
wget https://github.com/singularityhub/sregistry-cli/archive/0.0.91.tar.gz
# oh yeah this thing
yum install -y rpm-build
# I messed up a label somewhere because it wants the file with and without the name
$ cp 0.0.91.tar.gz sregistry-0.0.91.tar.gz
$ rpmbuild -ta 0.0.91.tar.gz
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.gzYtyU
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd /root/rpmbuild/BUILD
+ rm -rf sregistry-0.0.91
+ /usr/bin/gzip -dc /tmp/sregistry-0.0.91.tar.gz
+ /usr/bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd sregistry-0.0.91
/var/tmp/rpm-tmp.gzYtyU: line 35: cd: sregistry-0.0.91: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.gzYtyU (%prep)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.gzYtyU (%prep)
[root@db4b9c5b7b12 tmp]# So I think at this point it's mostly debugging the build steps (e.g., the above is a path error!) So I think this would be a good start for you to jump in? When you get a set of changes that warrant a new version let me know and I'll make it so. insert Picard meme |
oh I see the name issue: %prep
%setup -q -n sregistry-%{version}
... that would be the first thing to fix! %prep
%setup -q -n %{version}
... |
Is it possible to make github name the release file |
yeah let me try it. I've never done it before because it didn't matter, but now I know it does! |
okay, updated one --> https://github.com/singularityhub/sregistry-cli/releases/tag/sregistry-cli-0.0.93 |
I seem to be having issues with the release name scheme that @griznog suggested. The releases with the name form |
The file ${name}-${version}.tar.gz should untar into ${name}-${version} directory. I have no idea how to get github to make it do that though. |
the |
Should we change it to be |
Let me much around with the Github interface and see if I can break thi... I mean, fix things :) |
@fearful-symmetry what aspect doesn't it like? It looks like when we have:
and name is set to it downloads |
okay I am testing again. |
I've been testing by having results in a directory called via rpmbuild, it can't cd into the directory:
If I use one of the older releases that use the form |
I checked another project I've been playing with and they seem to do the same thing with the release urls, just using the version string. |
I don't think the rpm is right, I'm looking at other projects and seeing some variance. |
There does appear to be an issue with the specfile as well: |
Yeah I fixed that locally :) I'm trying to figure out a way to test this locally without needing to do a Github release every time... |
okay here is updated file : https://github.com/singularityhub/sregistry-cli/blob/master/sregistry-cli.spec The issue I'm running into locally is about a group/name permission, which is likely because I'm trying this in a container. See if you can clone and compress the folder into an archive and test locally - I just can't create a release to wget every time. |
We have hope!! A gift from @Trophime :) He has been creating (and using) these build recipes, which I've added here: https://github.com/singularityhub/sregistry-cli/tree/master/release/rpm @fearful-symmetry do you think we can get this generalized to work with an export from Github? I can write some helpful "how to package" and "how to use" docs if we get this down right! Looking quickly - I think the .dsc file is akin to the .spec, and that the archives coincide with the .tar.gz we've been using. |
And more help! I need to look through this carefully too, I've never done this before:
|
So, uhhhh, I feel like this is perhaps anticlimactic, but apparently you can just run And it works fine. Builds a basic RPM and all. The only issue I'm having is that the RPM doesn't specify dependencies or things like that, so the installed RPM doesn't work unless you already have |
haha are you kidding? This is music to my ears! You basically said:
Let me give it a test, write up some docs, and I'll post here for all to look at. |
Okay here is a quick documentation: https://singularityhub.github.io/sregistry-cli/contribute-packaging This is mostly working - but it's not clear to me why when I specify a pre-build script (and I can see that the code shows up in the pre section of the rpm spec when I have And it's really my fault for not starting fresh with a Google search for "rpm package for python" because I would have found that quickly. My entire thinking was based on a starting point of "oh, I need a spec file!" Anyway who cares, we are figuring it out, and lesson learned! |
No response for a month, closing issue. the docs are live and anyone that runs into issue I hope will bring up here. Thanks again! Closing. |
For large, mutli-tenant environments, deploying CLI tools via and RPM is more maintainable than a global
pip install
across multiple nodes. This is also how singularity itself is distributed. So, getting some kind of RPM, or at least a specfile, from upstream would be nice. Is this something someone has considered before?There is one caveat I can think of, which is the multiple optional dependencies against various backends (dropbox, google, shub, etc). Not sure what the best way to do that is.
The text was updated successfully, but these errors were encountered: