Commit graph

84 commits

Author SHA1 Message Date
Cole Helbling 0a64d2c632 Make source of IO errors more obvious 2024-06-06 08:02:47 -07:00
Cole Helbling 6a58908c6b Make store diffing optional 2024-05-22 09:27:04 -07:00
Cole Helbling 67647c9997 Don't skip -source when diffing store 2024-05-22 09:14:47 -07:00
Cole Helbling 5cc7e808dc Bring back store diffing 2024-05-22 09:14:47 -07:00
Cole Helbling 6f3c6309e4 Record and print tracing logs in debug mode 2024-05-21 12:43:01 -07:00
Luc Perkins 1bb6c86f5d
Remove unused import 2024-05-17 15:49:20 -03:00
Luc Perkins d1c5d5203b
Don't run server in tokio::spawn 2024-05-17 15:41:45 -03:00
Luc Perkins 5da333f97b
Add missing pkg-config dependency to dev shell 2024-05-17 14:32:40 -03:00
Luc Perkins 736bd0c019
Delete notification file if server fails to start up 2024-05-17 14:22:01 -03:00
Luc Perkins d67f330397
Spawn daemon in separate process 2024-05-17 14:07:12 -03:00
Luc Perkins c0b7181ddc
Allow for both startup options to be None 2024-05-17 13:32:43 -03:00
Luc Perkins cfe5cb78c5
Add file-based notification mechanism 2024-05-17 13:22:58 -03:00
Luc Perkins ab6bb9c47a
Restore info statement in GHA 2024-05-16 15:05:45 -03:00
Luc Perkins 1eb6003444
Derive Copy for Environment 2024-05-16 15:05:11 -03:00
Luc Perkins c1c6574b30
Check only for GITLAB_CI variable 2024-05-16 15:04:40 -03:00
Luc Perkins 1ee5b1eec8
Provide more ergonomic env var checking
Co-authored-by: Cole Helbling <cole.helbling@determinate.systems>
2024-05-16 15:04:04 -03:00
Luc Perkins 06fb14658c
Reformat use statement
Co-authored-by: Cole Helbling <cole.helbling@determinate.systems>
2024-05-16 15:02:28 -03:00
Luc Perkins a6e08a2a14
Remove info statement when not in GHA 2024-05-16 14:54:44 -03:00
Luc Perkins 8ad3089e93
Remove unnecessary determine func 2024-05-16 14:50:28 -03:00
Luc Perkins 41327e96b5
Address Clippy issues 2024-05-16 14:46:17 -03:00
Luc Perkins 136a3d43d6
Periodically fetch JWT only in GHA 2024-05-16 14:29:20 -03:00
Luc Perkins 90180e31ef
Add logic for determining environment 2024-05-16 13:53:46 -03:00
Cole Helbling 3d9bcd16a4 Make flakehub-flake-name truly optional 2024-05-09 14:29:14 -07:00
Graham Christensen 389a63ce68
Ignore post-build-hook errors 2024-05-06 12:00:24 -04:00
Cole Helbling 0434d467d3 Refresh GitHub Actions JWT in the background
GitHub Actions JWTs are only valid for 5 minutes after being issued.

FlakeHub uses these JWTs for authentication, which means that after
those 5 minutes have passed and the token is expired, FlakeHub (and
by extension FlakeHub Cache) will no longer allow requests using this
token.

However, GitHub gives us a way to repeatedly request new tokens, so we
utilize that and refresh the token every 2 minutes (less than half of
the lifetime of the token).
2024-04-19 08:32:45 -07:00
Eelco Dolstra fd6db08ef0
Merge pull request #52 from DeterminateSystems/build-hook-in-store
Move the post-build hook script to the Nix store
2024-04-12 10:37:39 +02:00
Luc Perkins 415818d147
Merge pull request #48 from DeterminateSystems/fix-dev-shells
Fix dev shell upload to cache
2024-04-11 23:23:35 -03:00
Graham Christensen b64bf3f4e5
Merge pull request #53 from DeterminateSystems/correlation
Use detsys_correlation if it is set
2024-04-11 22:11:18 -04:00
Graham Christensen 2d747212b0 Use detsys_correlation if it is set 2024-04-11 20:15:52 -04:00
Eelco Dolstra 4d66c1f308 Move the post-build hook script to the Nix store
In self-hosted GHA runners on NixOS, the runner has a different /tmp
than the Nix daemon, so the daemon would get "file not found" trying
to execute the post-build hook. As a workaround, move the script to
the Nix store so we can be sure that the daemon can access it.
2024-04-11 18:10:56 +02:00
Luc Perkins 974048fcd6
Fix Clippy issues 2024-03-29 17:19:44 -03:00
Eelco Dolstra 150468c70d Fix post-build hook
"exec" needs to come after the environment variables.
2024-03-27 16:32:14 +01:00
Graham Christensen fa32a1bad7 ? 2024-03-11 12:07:15 -04:00
Graham Christensen 64de95e342 0.2.0 2024-03-09 10:51:56 -05:00
Graham Christensen d0115f624f
Merge branch 'main' into flakehub-cache 2024-03-06 09:38:44 -05:00
Eelco Dolstra fbf0bbed94
Merge pull request #35 from Kiskae/pass-through-429
Pass through HTTP 429 to the nix daemon
2024-03-04 18:04:20 +01:00
Cole Helbling 619a6346c0 Merge remote-tracking branch 'origin/eelcodolstra/fh-224-magic-nix-cache-use-post-build-hook-for-the-gha-cache-as' into merge-against-upstream 2024-03-01 08:40:20 -08:00
Eelco Dolstra 9bf26f0680 Invalidate negative narinfo cache entries 2024-03-01 11:55:59 +01:00
Eelco Dolstra b53876db25 Typo 2024-02-29 22:48:51 +01:00
Eelco Dolstra e99ef6ba61 Log upload 2024-02-29 22:31:07 +01:00
Eelco Dolstra f16e3c292a Make NAR upload streaming 2024-02-29 21:22:44 +01:00
Eelco Dolstra 334bcc7df9 Compress 2024-02-29 20:45:12 +01:00
Eelco Dolstra 625e95f484 Trigger GHA cache uploads from the post-build hook
Also, a worker task now does the uploads directly rather than having
magic-nix-cache invoke "nix copy" via HTTP to itself.
2024-02-29 16:31:29 +01:00
Eelco Dolstra e5513406df Update to latest attic 2024-02-29 16:26:48 +01:00
Cole Helbling 8ce3c6cafb fixup: Cargo.toml 2024-02-27 09:57:20 -08:00
Cole Helbling 531387f66f Allow configuring the FlakeHub flake name 2024-02-27 09:47:46 -08:00
Cole Helbling bf8c52586b Merge remote-tracking branch 'upstream/main' into merge-against-upstream 2024-02-27 08:51:49 -08:00
Cole Helbling 3b8363028d just hack in an unsafe way to turn a string into a cache name without validation 2024-02-27 08:49:21 -08:00
Cole Helbling 34956e86bb checkpoint 2024-02-27 08:30:35 -08:00
Eelco Dolstra 1f46e11aa7 Cleanup 2024-02-24 10:28:18 +01:00