Skip to content
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

Traefik: 1.7.14 -> 2.2.0 #76723

Merged
merged 4 commits into from Apr 13, 2020
Merged

Traefik: 1.7.14 -> 2.2.0 #76723

merged 4 commits into from Apr 13, 2020

Conversation

jokogr
Copy link
Contributor

@jokogr jokogr commented Dec 31, 2019

Motivation for this change

I was experimenting with Traefik and thought to update the package to the latest v2 one.

In the mean time, buildGoPackage was switched to buildGoModule and the respective NixOS module has been adapted to the new configuration requirements (static and dynamic, routers, middlewares, services and so on).

Finally, I have removed hamhut1066 from the maintainers list, as this user is no longer in GitHub.

Fixes #76518.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @vdemeester

Copy link
Member

@Br1ght0ne Br1ght0ne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff for package LGTM
didn't check module
executable shows usage

[5 built, 5 copied (432.5 MiB), 104.1 MiB DL]
https://github.com/NixOS/nixpkgs/pull/76723
1 package built:
traefik

@dali99
Copy link
Member

dali99 commented Jan 5, 2020

Considering that the configuration isn't backwards compatible, should this maybe go into a separate package/module?

traefik 1.7 is still supported upstream until september 2020 2021, and this kind of change should definetly not be backported to 19.09

having this be the only option on master and 20.03 seems reasonable

Otherwise LGTM!

EDIT: https://containo.us/blog/traefik-2-1-in-the-wild/

@jokogr
Copy link
Contributor Author

jokogr commented Jan 7, 2020

Considering that the configuration isn't backwards compatible, should this maybe go into a separate package/module?

traefik 1.7 is still supported upstream until september 2020, and this kind of change should definetly not be backported to 19.09

having this be the only option on master and 20.03 seems reasonable

Otherwise LGTM!

Thanks for having a look on this PR. I do not understand your initial question, as in whether to have a separate package / module. As you point out after the question and I agree with this, we could maintain Traefik v1.7 on 19.09 only and v2.1 and later on 20.03 and master. Why should we have additional maintenance effort on master?

@vdemeester what's your view on this?

@dali99
Copy link
Member

dali99 commented Jan 7, 2020

Yeah I'm just not sure on what the general policy is on changes like this. It's kind of two entirely different pieces of software, and 20.09 is the first release we can do where 1.7 is no longer supported upstream.

I'm personally okay with 2.1 being the only thing available on master and 20.03, but I just wanted to put the info here so other's could chime in.

@dali99
Copy link
Member

dali99 commented Jan 20, 2020

@vdemeester
@kalbasit

Friendly pings :D (3 weeks) has this been forgotten?

@lo1tuma lo1tuma mentioned this pull request Jan 22, 2020
10 tasks
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nixos-20-03-feature-freeze/5655/17

pkgs/servers/traefik/default.nix Outdated Show resolved Hide resolved
pkgs/servers/traefik/default.nix Outdated Show resolved Hide resolved
'';
type = types.attrs;
default = {
defaultEntryPoints = ["http"];
entryPoints.http.address = ":80";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you need to set entryPoints.web.address like in the example case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I didn't see anything defaultEntryPoints on the official documentation site, so I skipped this.

This issue on the official traefik GitHub repo supports this.

@jokogr jokogr force-pushed the u/traefik-2.1.1 branch 2 times, most recently from 4b9b99d to 9b7d1a1 Compare February 8, 2020 11:41
@jokogr
Copy link
Contributor Author

jokogr commented Feb 8, 2020

Thanks @kalbasit for the review and sorry for the wait! I have made the following changes:

  • Refactored to current master.
  • Updated to Traefik v2.1.4.
  • Removed goPackagePath as suggested.
  • Made a new commit in the relevant NixOS service to make configuration deep mergeable as in 00eb055162a52a2d9f42ba6c0eeec892c83bfa58 (thanks @Mic92 for the hint)

@ofborg ofborg bot requested a review from kalbasit February 8, 2020 12:08
@jokogr jokogr changed the title Traefik: 1.7.14 -> 2.1.1 Traefik: 1.7.14 -> 2.1.4 Feb 8, 2020
@ngerstle ngerstle mentioned this pull request Feb 22, 2020
10 tasks
@jokogr
Copy link
Contributor Author

jokogr commented Mar 2, 2020

Thanks @rnhmjoj for the review! I have made the following changes:

  • Rebased to current master.
  • Updated traefik to v2.1.6.
  • Switched to makeFlagsArray as suggested by @rnhmjoj (sorry, rebasing took away @kalbasit's and @rnhmjoj's comments).

@jokogr jokogr changed the title Traefik: 1.7.14 -> 2.1.4 Traefik: 1.7.14 -> 2.1.6 Mar 2, 2020
@rnhmjoj
Copy link
Contributor

rnhmjoj commented Mar 3, 2020

So, the changes look good and I tested the package update.
I would be more confident to merge this if someone would review the module: it's a substantial change. Also it would be good to have a NixOS test, even a simple one.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review-may-2019/3032/130

@dali99
Copy link
Member

dali99 commented Mar 22, 2020

Changed the module to use attrsOf instead of lazyAttrsOf as a test on 19.09

hash mismatch in fixed-output derivation '/nix/store/hb3xrk6vzszz87vz6z0sk1zdcjssf0r3-traefik-2.1.6-go-modules':
  wanted: sha256:1mdzjc9v54b0gc8f97gpdgym1dxhyc1p1qivgfvjraj3vgfc7i5g                          
  got:    sha256:1chd174wplr0sqyij4z05kpnhs81sd3xc7jjlb2jlxmbnsf9kay5

changing the hash:

build github.com/containous/traefik/v2/internal: cannot load crypto/ed25519: cannot find module providing package crypto/ed25519
generate.go:5: running "go": exit status 1

I dont actually know the difference between lazyAttrsOf and attrsOf semantically, so that could be the reason its failing like it is, in that case disregard this comment.

EDIT: Package should build anyways, but it doesnt

20.03 should be out soon, Ill try build it ontop of that if (it doesnt get merged into it) when that happens.

@jokogr
Copy link
Contributor Author

jokogr commented Apr 4, 2020

  • Rebased to current master.
  • Updated traefik to v2.2.0.
  • Switched from buildInputs to nativeBuildInputs as suggested by @Mic92.

@dali99 please, do not use words like Package should build anyways, but it doesnt, it gives a wrong impression of this PR.

Traefik as of now requires Go 1.14 (which is the default version currently in unstable) and NixOS 19.09 merely supports 1.13 and it is not working as in unstable, as you have noticed.

It happens to use this package (and NixOS module) on my servers running NixOS 19.09 and it works as intended after adding Go 1.14 in a package overlay:

  buildGo114Module = super.callPackage ./go-modules_generic.nix {
    go = self.buildPackages.go_1_14;
  };
  go_1_14 = super.callPackage ./go_1.14 {
    inherit (super.darwin.apple_sdk.frameworks) Security Foundation;
  };
  traefik = super.callPackage ./traefik {
    buildGoModule = self.buildGo114Module;
  };

The versions and the files I have copied there is left to the readers as an exercise. As I have mentioned before, I would like to focus my efforts on unstable to speed up the update process.

@rnhmjoj I will try to create a NixOS test for traefik today or tomorrow.

@jokogr jokogr changed the title Traefik: 1.7.14 -> 2.1.6 Traefik: 1.7.14 -> 2.2.0 Apr 4, 2020
@dali99
Copy link
Member

dali99 commented Apr 4, 2020

I'm sorry I was just trying to help 😞

Good that I was just personally failing to build it though!

@jokogr
Copy link
Contributor Author

jokogr commented Apr 6, 2020

I'm sorry I was just trying to help disappointed

Good that I was just personally failing to build it though!

No worries, I know you meant well, but I also do not want reviewers to have an excuse for not reviewing this 😃

  • Added a test to check the Docker and file providers.

@jokogr
Copy link
Contributor Author

jokogr commented Apr 6, 2020

  • Added passthru.tests as suggested by @Mic92.

@jokogr
Copy link
Contributor Author

jokogr commented Apr 6, 2020

  • Added nixosTests in the argument list. 🙄

@jokogr
Copy link
Contributor Author

jokogr commented Apr 6, 2020

  • Set a limit on x86_64-linux for the test, as it relies on docker-containers, whose tests have the same limit.

nixos/modules/services/web-servers/traefik.nix Outdated Show resolved Hide resolved
nixos/modules/services/web-servers/traefik.nix Outdated Show resolved Hide resolved
This commit:

1. Updates the path of the traefik package, so that the out output is
   used.
2. Adapts the configuration settings and options to Traefik v2.
3. Formats the NixOS traefik service using nixfmt.
@jokogr
Copy link
Contributor Author

jokogr commented Apr 12, 2020

  • Rebased to current master.
  • Dropped recursiveMerge as requested by @rnhmjoj.
  • Formatted the package and the service nix files using nixfmt to address a code change request by @rnhmjoj.

Copy link
Contributor

@rnhmjoj rnhmjoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I don't have anything else to add: it looks pretty good to me.
I double checked the package and the moduble, everything builds and ofBorgs is happy.
Thank you for adding a test: it will make future changes easier to review.

I'll wait a bit for the other reviewers if the have anything else to say, before merging.

@Mic92 Mic92 merged commit 4c3f1d3 into NixOS:master Apr 13, 2020
@jokogr jokogr deleted the u/traefik-2.1.1 branch April 13, 2020 16:52
@flokli flokli mentioned this pull request Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Traefik 2.0
7 participants