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

grafana-loki: 1.6.1 -> 2.0.0 #101986

Merged
merged 1 commit into from Oct 31, 2020
Merged

grafana-loki: 1.6.1 -> 2.0.0 #101986

merged 1 commit into from Oct 31, 2020

Conversation

@mweinelt
Copy link
Member

@mweinelt mweinelt commented Oct 29, 2020

Motivation for this change

ALERTING!

Convert to use buildGoModule and add a patch (by @andir) for a test failing on
golang>=1.15.

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.
Convert to use buildGoModule and add a patch for a test failing on
golang>=1.15.
@dasJ
dasJ approved these changes Oct 29, 2020
Copy link
Member

@dasJ dasJ left a comment

That's an ALERTING change

@SuperSandro2000
Copy link
Member

@SuperSandro2000 SuperSandro2000 commented Oct 29, 2020

Result of nixpkgs-review pr 101986 run on x86_64-darwin 1

1 package failed to build:
  • grafana-loki
@andir
Copy link
Member

@andir andir commented Oct 29, 2020

Result of nixpkgs-review pr 101986 run on x86_64-darwin 1
1 package failed to build:

* grafana-loki

Did it work previously?

@mweinelt
Copy link
Member Author

@mweinelt mweinelt commented Oct 29, 2020

Result of nixpkgs-review pr 101986 run on x86_64-darwin 1
1 package failed to build:

* grafana-loki

Can you be more specific about the failure?

@SuperSandro2000
Copy link
Member

@SuperSandro2000 SuperSandro2000 commented Oct 29, 2020

Have a little patience. The tests are running in the background.

I am not sure which test failed and why so I just uploaded the entire log:

https://termbin.com/b1gn

@mweinelt
Copy link
Member Author

@mweinelt mweinelt commented Oct 29, 2020

All errors about something network related not working on Darwin. The tests cannot bind to 127.0.0.1:0 (random port) and cannot lookup localhost. 😞

=== RUN   TestPromtail
    promtail_test.go:92: error creating promtail listen tcp: lookup localhost: no such host
    promtail_test.go:79: Failed to start web server to receive logs: listen tcp: lookup localhost: no such host
--- FAIL: TestPromtail (0.00s)
--- FAIL: TestClient_Handle (0.00s)
    --- FAIL: TestClient_Handle/batch_log_entries_together_until_the_batch_size_is_reached (0.00s)
panic: httptest: failed to listen on a port: listen tcp6 [::1]:0: bind: operation not permitted [recovered]
	panic: httptest: failed to listen on a port: listen tcp6 [::1]:0: bind: operation not permitted
=== RUN   TestPushTarget
    pushtarget_test.go:37: 
        	Error Trace:	pushtarget_test.go:37
        	Error:      	Received unexpected error:
        	            	listen tcp 127.0.0.1:0: bind: operation not permitted
        	Test:       	TestPushTarget
--- FAIL: TestPushTarget (0.00s)
@marsam
Copy link
Contributor

@marsam marsam commented Oct 29, 2020

@SuperSandro2000 I think it's failing because nixpkgs-review uses --option build-use-sandbox by default, and sanboxing is not fully functional on darwin

@SuperSandro2000
Copy link
Member

@SuperSandro2000 SuperSandro2000 commented Oct 29, 2020

Maybe we just disable the tests on Darwin? I don't want to block this update nor break darwin with updates.

@mweinelt
Copy link
Member Author

@mweinelt mweinelt commented Oct 29, 2020

Maybe we just disable the tests on Darwin? I don't want to block this update nor break darwin with updates.

You could just retry building this without sandboxing, as @marsam indicated this could be the culprit.

@mweinelt
Copy link
Member Author

@mweinelt mweinelt commented Oct 29, 2020

Similarly localhost is not namespaced either, if multiple builds try to listen on the same port at the same time one of them will fail. Because of this the nix sandbox needs explicit whitelisting of builds that are allowed to do this with __darwinAllowLocalNetworking = true;.

#58147 (comment)

I could try adding this one as well.

@SuperSandro2000
Copy link
Member

@SuperSandro2000 SuperSandro2000 commented Oct 29, 2020

Building without sandbox results in a success. Learned something again.

I am currently running a newer version of nixpkgs-review to have the platform indication. Maybe thats the culprit?

Anyway how should I handle sandbox fails on Darwin?

Copy link
Member

@WilliButz WilliButz left a comment

I think disabling the check phase on Darwin is ok, though I am not familiar enough with that ecosystem to know what the optimal solution would be. Otherwise LGTM 👍

@andir
Copy link
Member

@andir andir commented Oct 30, 2020

@WilliButz
Copy link
Member

@WilliButz WilliButz commented Oct 30, 2020

@andir yeah that was the first thing I checked ^^. They have tarballs for darwin in their release assets (for example: https://github.com/grafana/loki/releases/tag/v2.0.0).

@marsam
Copy link
Contributor

@marsam marsam commented Oct 31, 2020

Anyway how should I handle sandbox fails on Darwin?

IMHO it's okay if a test fails wanting networking with loopback on darwin, because it's the only networking allowed within a sandboxed build.
Personally, I don't want to add __darwinAllowLocalNetworking = true; because it doesn't seem to be documented anywhere.

@marsam marsam merged commit 2faef82 into NixOS:master Oct 31, 2020
19 checks passed
19 checks passed
@github-actions
tests
Details
@github-actions
action
Details
@ofborg
Evaluation Performance Report Evaluator Performance Report
Details
@github-actions
Wait for ofborg
Details
@ofborg
grafana-loki, grafana-loki.passthru.tests on aarch64-linux Success
Details
@ofborg
grafana-loki, grafana-loki.passthru.tests on x86_64-linux Success
Details
@ofborg
grahamcofborg-eval ^.^!
Details
@ofborg
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
@ofborg
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
@ofborg
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="09bbd40"; rev="09bbd4017fa5a6c76cc586b331a439c2ab7c9556"; } ./pkgs/t
Details
@ofborg
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
@ofborg
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="09bbd40"; rev="09bbd4017fa5a6c76cc586b331a439c2ab7c9556"; } ./nixos/
Details
@ofborg
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="09bbd40"; rev="09bbd4017fa5a6c76cc586b331a439c2ab7c9556"; } ./nixos/
Details
@ofborg
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="09bbd40"; rev="09bbd4017fa5a6c76cc586b331a439c2ab7c9556"; } ./nixos/
Details
@ofborg
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="09bbd40"; rev="09bbd4017fa5a6c76cc586b331a439c2ab7c9556"; } ./pkgs/t
Details
@ofborg
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="09bbd40"; rev="09bbd4017fa5a6c76cc586b331a439c2ab7c9556"; } ./pkgs/t
Details
@ofborg
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="09bbd40"; rev="09bbd4017fa5a6c76cc586b331a439c2ab7c9556"; } ./pkgs/t
Details
@ofborg
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
@ofborg
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@SuperSandro2000
Copy link
Member

@SuperSandro2000 SuperSandro2000 commented Oct 31, 2020

Personally, I don't want to add __darwinAllowLocalNetworking = true; because it doesn't seem to be documented anywhere.

And it does not need to be honored by the sandbox.

@marsam
Copy link
Contributor

@marsam marsam commented Oct 31, 2020

it's honored within sandboxed builds on Darwin NixOS/nix@4a4a009, but not documented

@mweinelt mweinelt deleted the mweinelt:loki2 branch Oct 31, 2020
@mweinelt mweinelt mentioned this pull request Dec 25, 2020
2 of 10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants