sozu icon indicating copy to clipboard operation
sozu copied to clipboard

Proper packaging for distributions

Open Geal opened this issue 8 years ago • 24 comments

Right now, installing the proxy requires downloading rustup and installing the proxy through cargo install sozu, but we need a good packaging option for most Linux distributions.

As usual, whenever there's a new cool Rust toy available, @Keruspe packages it for Exherbo before everybody else.

Which will be the next one?

I'm especially interested in input about where to put elements like the default certificate, or the command unix socket.

Geal avatar Apr 20 '17 14:04 Geal

I can take care of an AUR package for Arch Linux.

badboy avatar May 10 '17 17:05 badboy

that would be great, thanks! Hopefully, something that could be automated at some point.

Geal avatar May 11 '17 14:05 Geal

Would you like a package for a release or for the git version?

badboy avatar May 11 '17 19:05 badboy

the release, I guess? I think I'll make a 0.3 soon, when I'm done breaking the API for now :)

Geal avatar May 11 '17 19:05 Geal

Ok, now it just needs to compile

   Compiling sozu-lib v0.1.1
error: no associated item named `get_2048_256` found for type `openssl::dh::Dh` in the current scope
   --> /home/jer/.cargo/registry/src/github.com-1ecc6299db9ec823/sozu-lib-0.1.1/src/network/tls.rs:433:11
    |
433 |     match Dh::get_2048_256() {
    |           ^^^^^^^^^^^^^^^^

error: no method named `set_ecdh_auto` found for type `openssl::ssl::SslContextBuilder` in the current scope
   --> /home/jer/.cargo/registry/src/github.com-1ecc6299db9ec823/sozu-lib-0.1.1/src/network/tls.rs:441:13
    |
441 |     context.set_ecdh_auto(true);
    |             ^^^^^^^^^^^^^

error: no associated item named `get_2048_256` found for type `openssl::dh::Dh` in the current scope
   --> /home/jer/.cargo/registry/src/github.com-1ecc6299db9ec823/sozu-lib-0.1.1/src/network/tls.rs:587:11
    |
587 |     match Dh::get_2048_256() {
    |           ^^^^^^^^^^^^^^^^

error: no method named `set_ecdh_auto` found for type `openssl::ssl::SslContextBuilder` in the current scope
   --> /home/jer/.cargo/registry/src/github.com-1ecc6299db9ec823/sozu-lib-0.1.1/src/network/tls.rs:594:9
    |
594 |     ctx.set_ecdh_auto(true);
    |         ^^^^^^^^^^^^^

badboy avatar May 12 '17 07:05 badboy

Seems to be a problem with having OpenSSL 1.1.0

badboy avatar May 12 '17 08:05 badboy

@badboy you can have a look at #178, sozu is not yet compatible with OpenSSL 1.1.0 indeed

BlackYoup avatar May 12 '17 08:05 BlackYoup

Right, should have looked first. I patched rust-openssl and now it compiles

badboy avatar May 12 '17 08:05 badboy

oh, nice, thanks!

Geal avatar May 12 '17 08:05 Geal

@badboy so, when can we move forward with this? :)

Geal avatar May 21 '17 08:05 Geal

Sure! Initial PKGBUILD is here: https://github.com/badboy/aur-packages/blob/master/sozu-git/PKGBUILD

I'll add a default config, etc. today and will push it to the AUR then as well

badboy avatar May 21 '17 08:05 badboy

Latest PKGBUILD here: https://github.com/badboy/aur-packages/blob/7a45fa0aef82ffaa7392cbc1fe0e50279f5b993f/sozu-git/PKGBUILD

Directory layout:

sozu-git /etc/
sozu-git /etc/sozu/
sozu-git /etc/sozu/config.toml
sozu-git /usr/
sozu-git /usr/bin/
sozu-git /usr/bin/sozu
sozu-git /usr/bin/sozuctl
sozu-git /usr/share/
sozu-git /usr/share/doc/
sozu-git /usr/share/doc/sozu-git/
sozu-git /usr/share/doc/sozu-git/README.md
sozu-git /usr/share/licenses/
sozu-git /usr/share/licenses/sozu-git/
sozu-git /usr/share/licenses/sozu-git/LICENSE-MIT
sozu-git /var/
sozu-git /var/lib/
sozu-git /var/lib/sozu/

State and the socket will be placed into /var/lib/sozu, though I think the socket should actually go into /run/

I need to add the systemd service file.

badboy avatar May 21 '17 11:05 badboy

Hi, I'm working on a project of packaging Rust crates for Fedora (eventually for Red Hat Enterprise Linux): https://docs.pagure.org/fedora-rust.sig/ The project is in very early stage, but we can also take a look at Sozu and try to package it.

msehnout avatar Jun 30 '17 12:06 msehnout

@msehnout that would be great!

Geal avatar Jul 03 '17 12:07 Geal

Ubuntu packages could be automated https://www.reddit.com/r/rust/comments/6o57em/distributing_binaries_through_ppas/

Geal avatar Jul 20 '17 08:07 Geal

@msehnout did you take a look at https://github.com/sozu-proxy/sozu/pull/181 ? Now building RPM should work.

Geal avatar Aug 21 '17 09:08 Geal

@badboy any chance you could send a PR for the arch PKGBUILD? Please put it in https://github.com/sozu-proxy/sozu/tree/master/os-build and add a script to build the package in one command

Geal avatar Aug 21 '17 09:08 Geal

will take care of it tonight!

badboy avatar Aug 21 '17 10:08 badboy

@Geal I'll send a PR with few changes. I'm currently trying to make it build on my Fedora 26 machine, so I can build it on https://copr.fedorainfracloud.org/. The main problem now is that it downloads dependencies from crates.io during build time, which is fine for Copr repository, but all dependencies must be packaged into RPM if we want to get this package directly into Fedora repositories.

msehnout avatar Aug 21 '17 12:08 msehnout

@msehnout take a look at cargo-vendor or cargo-local-registry for this. You can use it to download all dependencies in advance

Geal avatar Aug 21 '17 14:08 Geal

debian is working on packaging rust crates: https://alioth-lists.debian.net/pipermail/pkg-rust-maintainers/2018-June/001412.html

Geal avatar Jun 09 '18 08:06 Geal

any plan to deliver a docker container (under hub.docker.com)?

gjaegle avatar Jul 03 '18 15:07 gjaegle

@gjaegle We already have one under hub.docker.com. But we have some trouble with #470. I'll try to fix that as quickly as possible.

NotBad4U avatar Jul 03 '18 16:07 NotBad4U