tweag / monad-bayes

A library for probabilistic programming in Haskell.
MIT License
404 stars 62 forks source link

Fix cachix #277

Closed turion closed 1 year ago

turion commented 1 year ago

Fixes #273

turion commented 1 year ago

This seems to actually push objects to the cache.

Post job cleanup.
Cachix: push
  /home/runner/work/_actions/cachix/cachix-action/v12/dist/main/push-paths.sh cachix  tweag-monad-bayes  
  compressing using zstd and pushing /nix/store/4w4b4mxfhdc9lf3rsf4qqa9z8xnijbxl-source (26.27 KiB)
  compressing using zstd and pushing /nix/store/7rvyhm99h13ddfwblbixhr7iy9mzr4zj-cabal-fmt-0.1.6 (6.79 MiB)
  compressing using zstd and pushing /nix/store/5lzm0zkydfl9bs19zs0lbr7y0qsxh613-source (8.03 KiB)
  compressing using zstd and pushing /nix/store/9p17l6hmyz32hjma72nw6dfqxfnqk8x8-source (53.46 KiB)
  compressing using zstd and pushing /nix/store/gsslxw2mhiygis23y7nrizbpjl1pgbaq-source (162.64 KiB)
  compressing using zstd and pushing /nix/store/kz15p1pxm5dw3hnay3bnqhz4mvsg8jyl-source (34.86 MiB)
  compressing using zstd and pushing /nix/store/plcgf3d938380z6qaim2fa22gna3c12l-pre-commit-run (112.00 B)
  compressing using zstd and pushing /nix/store/fxf5927vw1wl2ap0lhr72fx3jbj1wmwj-source (127.23 KiB)
  compressing using zstd and pushing /nix/store/qwk3nqcb5k3y51k1kbrqamgcp83544zl-pre-commit-config.json (1.60 KiB)
  compressing using zstd and pushing /nix/store/ymdgrjb15pg6w0dhwx006kyzngrmnv4y-cabal-fmt-0.1.6-bin (3.94 MiB)
  All done.
turion commented 1 year ago

And it can read as well:

Run nix --print-build-logs build .#pre-commit --accept-flake-config
  nix --print-build-logs build .#pre-commit --accept-flake-config
  shell: /usr/bin/bash -e {0}
  env:
    NIX_PATH: nixpkgs=channel:nixos-unstable

copying path '/nix/store/4w4b4mxfhdc9lf3rsf4qqa9z8xnijbxl-source' from 'https://tweag-monad-bayes.cachix.org/'...
copying path '/nix/store/fxf5927vw1wl2ap0lhr72fx3jbj1wmwj-source' from 'https://tweag-monad-bayes.cachix.org/'...
copying path '/nix/store/zjpd6dn9kza8zl3l17cwgyifsxbvi3nb-source' from 'https://cache.nixos.org/'...
turion commented 1 year ago

Now the question is whether the common nix setup already worked in the first place. And if yes, if --accept-flake-config is needed at all. And if no, why we never saw a benefit of caching before. Maybe we simply never populated the cache. To do so, we could for example run master after every PR when it's merged.

turion commented 1 year ago

Now the question is whether the common nix setup already worked in the first place

Yes it does, see https://github.com/tweag/monad-bayes/actions/runs/5004889063/jobs/8968073752?pr=277.

turion commented 1 year ago

And if yes, if --accept-flake-config is needed at all.

warning: ignoring untrusted flake configuration setting 'extra-substituters'.
Pass '--accept-flake-config' to trust it
warning: ignoring untrusted flake configuration setting 'extra-trusted-public-keys'.
Pass '--accept-flake-config' to trust it
copying path '/nix/store/4w4b4mxfhdc9lf3rsf4qqa9z8xnijbxl-source' from 'https://tweag-monad-bayes.cachix.org/'...
copying path '/nix/store/fxf5927vw1wl2ap0lhr72fx3jbj1wmwj-source' from 'https://tweag-monad-bayes.cachix.org/'...

So no, it isn't.

And if no, why we never saw a benefit of caching before. Maybe we simply never populated the cache.

Yes, I forgot that the cachix action part was commented all the time.

turion commented 1 year ago

@idontgetoutmuch @reubenharry can you review?

reubenharry commented 1 year ago

I'll defer to @idontgetoutmuch , since I don't know any nix.

idontgetoutmuch commented 1 year ago

I'll defer to @idontgetoutmuch , since I don't know any nix.

In the kingdom of the blind...

@turion can we talk for 10 minutes? It looks fine but I really don't know much about CI.