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

Alpine Package Keeper (apk) format support #1054

Merged
merged 30 commits into from Apr 28, 2016

Conversation

Projects
None yet
6 participants
@Knetic
Contributor

Knetic commented Dec 29, 2015

After making #1042, I decided to give it a crack. This PR adds an "apk" destination which works just like you'd expect; implementing Alpine Linux packages.

Just to list it out so it's easy to see, this PR supports the following things beside the usual "install files to the right places";

  • Control scripts (preinstall, postupgrade, etc)
  • Dependencies (like relying on another package to be installed before the current one)
  • Package version/name/homepage/description (which are written to a special control file called .PKGINFO required by the format)
  • I've tested this against each minor version of Alpine, and the packages produced work on all versions currently on Dockerhub (2.6+, all the way to latest, which is 3.3).

A few things to note (so you don't have to pick through the code to notice it);

  • There are no tests. I'm not all that sure how one would even test this sort of thing without requiring docker. I looked through the spec folder, but didn't really understand it. If it helps, I can make a gist of the scripts and dockerfile I've been using to manually test it as I go.
  • I haven't gotten to extracting from an APK, only making a package. Not sure if that feature is required - i personally never make packages from anything other than a dir.
  • I know this is like 30 commits long, I haven't done any squashing. Not sure what the repo policy on that is.

Knetic added some commits Dec 12, 2015

@Knetic Knetic changed the title from Apk to Alpine Package Keeper (apk) format support Dec 29, 2015

@jordansissel jordansissel referenced this pull request Feb 10, 2016

Closed

Support for APK #1066

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Feb 10, 2016

I haven't read the code yet, nor tested, but let me respond to your concerns first --

There are no tests

I am OK with this. While having tests would be lovely, it is OK if you aren't sure how to write them! We can work on this iteratively. I suspect some folks manually testing this would be enough for me to be happy merging. I will try to test it myself also. :)

I haven't gotten to extracting from an APK, only making a package. Not sure if that feature is required

Not required. What you have (making a package) is great! We can always add "from APK" support in the future.

I haven't done any squashing. Not sure what the repo policy on that is.

I have no policy. 30 commits is fine with me :)

@subnetmarco

This comment has been minimized.

subnetmarco commented Mar 28, 2016

Any chance we can move this forward? Can't wait to use it to create the official Kong Docker packages.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Apr 13, 2016

@thefosk I'd love to! I currently have a plethora of windows boxes, none of which can run Alpine linux due to a bug somewhere between Hyper-V and Alpine Linux (the boot from the 3.3.1 and 3.3.3 ISO both hang similar to reported here).

As I can't test this right now, I'd love feedback from Alpine users who can help this PR get some feedback on usage, bugs, etc.

@xiaods

This comment has been minimized.

xiaods commented Apr 15, 2016

+1, testing it.

@tya

This comment has been minimized.

tya commented Apr 22, 2016

+1

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Apr 28, 2016

Tested using the alpine docker image:

% bin/fpm -s dir -t apk -n example $HOME/.zshrc
apk output does not currently sign packages. {:level=>:warn}
It's recommended that your package be installed with '--allow-untrusted' {:level=>:warn}
Created package {:path=>"example_1.0_noarch.apk"}

% docker run -v $PWD:/data:z -i -t alpine /bin/sh -c 'apk add /data/example_1.0_noarch.apk; ls -la /home/jls; apk del example'
Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning.
WARNING: Ignoring APKINDEX.5a59b88b.tar.gz: No such file or directory
WARNING: Ignoring APKINDEX.7c1f02d6.tar.gz: No such file or directory
(1/1) Installing example (1.0)
ERROR: Metadata for package example-1.0 is too long.
OK: 5 MiB in 12 packages
total 24
drwxrwxr-x    2 root     root          4096 Apr 27 08:29 .
drwxr-xr-x    3 root     root          4096 Apr 27 08:29 ..
-rw-r--r--    1 root     root         12567 Apr  9 00:20 .zshrc
WARNING: Ignoring APKINDEX.5a59b88b.tar.gz: No such file or directory
WARNING: Ignoring APKINDEX.7c1f02d6.tar.gz: No such file or directory
OK: 5 MiB in 11 packages

Looks like it worked!

I'm not sure what to test beyond this, but functionally it seems good (given my zero experience level with Alpine)

@jordansissel jordansissel merged commit 48e2fff into jordansissel:master Apr 28, 2016

@subnetmarco

This comment has been minimized.

subnetmarco commented Apr 28, 2016

Great news, thank you!

@Knetic

This comment has been minimized.

Contributor

Knetic commented Apr 28, 2016

Awesome! That's pretty similar to my tests, I tested a few init scripts and binaries together. I never observed that error ERROR: Metadata for package example-1.0 is too long., I'll look into it. I worked fairly hard to exactly match the apk format as the alpine tools generate it, but I may have added some extra padding somewhere or something.

@jordansissel Also just to put it out there, if you'd like I'm willing to field bugs and questions people may have on the APK support. But I don't really watch the fpm issue pages much - so if something comes up, feel free to at-me or email me or something.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Apr 28, 2016

@Knetic thank you much for the offer to help support folks as they play with the new apk support. Will ping you as appropriate via email ❤️

jordansissel added a commit that referenced this pull request Jun 20, 2016

Merge pull request #1054 from Knetic/apk
Alpine Package Keeper (apk) format support
@freeseacher

This comment has been minimized.

freeseacher commented Oct 5, 2016

any news ?

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Oct 5, 2016

@freeseacher about what? This was merged 5 months ago.

@freeseacher

This comment has been minimized.

freeseacher commented Oct 6, 2016

ou, sorry, i just read doc and did not find it. so i search for pull request and found that one.
so simply missed merged status.

@subnetmarco

This comment has been minimized.

subnetmarco commented May 17, 2017

I confirm that docs are not updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment