Open jake-arkinstall opened 7 months ago
And it would be nice if you could add something to the changelog?
For some reason my github app isnt letting my reply in thread, so:
I case I am doing the update, is there anything else I need to do besides updating the version in this file as well?
If the new version requires to change to the setup process, then this is my usual update process:
The nix build log will then emit a warning along the lines of: "Empty hash provided, assuming sha256 AAAAAAAA...."
Once it has built the package it will calculate the actual hash. It will emit an error along the lines of:
Incorrect hash.
Specified: AAAAAAAA.....
Got: "ABCDEF1234....."
What I do then is add the provided hash back into the nix file and run nix build again.
It should immediately notice that it has already seen a derivation with this source, build instructions, and output hash, and resolve to the package it previously built.
The hash thing is annoying but extremely useful. If Nix can verify the hash then it knows if it has seen it before and lets it skip steps.
Likewise, subsequent runs on that machine will serve that result immediately. If we get a cachix subscription, we can upload the resulting derivation there, and any user that needs it (as specified by the matching source, build instructions and output hash) will be offered a ready-to-go downloadable package instead of going through the build and test process.
Will you do the same with other packages?
Indeed! I was asked to look at pytket-quantinuum and pytket-qir is a dependency of it (in the testing pipeline) so I started here.
This, with the above about the caching possibilities, is quite exciting.
Cachix is when the real benefit of the nix integration will kick in: users will be able to run nix develop github:CQCL/pytket-foo
on any Linux or Mac Silicon machine and everything from symengine to tket, pyket to pyqir, and everything they need, will be served over a download with no additional building or configuration required. One command and after a few seconds they'll be ready to go.
It doesn't stop at environments, but can also launch tools. So we could possibly have a one-liner to launch a Jupiter notebook pre-filled with demo code, with the environment all loaded up, ready to showcase. But this is all future ifs and maybes, and I don't want to push it in a direction you don't want to take it in.
Thank you for all the information! I think it would be helpful if you could just copy this into a readme file and add this to the repo as well. Just to make sure this is documented somewhere.
Happy to review your PR on pytket-quantinuum as well.
Maybe it would be good if we could add this to pytket-qiskit as well? As they are both the most used extensions?
That is my next challenge after I've got pytket-quantinuum in.
There are qiskit libraries already available on the nix store, however they are marked as broken due to conflicts with symengine. So the qiskit integration PR might be a bit more substantial of a PR than this one, depending on how it goes.
On Tue, 30 Jan 2024, 14:59 cqc-melf, @.***> wrote:
Maybe it would be good if we could add this to pytket-qiskit as well? As they are both the most used extensions?
— Reply to this email directly, view it on GitHub https://github.com/CQCL/pytket-qir/pull/120#issuecomment-1917078615, or unsubscribe https://github.com/notifications/unsubscribe-auth/APSUR26F3C7Q6DHU2OZTNMDYREDDTAVCNFSM6AAAAABCPZQNWKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJXGA3TQNRRGU . You are receiving this because you authored the thread.Message ID: @.***>
@jake-arkinstall is this ready for re-review?
@jake-arkinstall is this ready for re-review?
Yes, it is! Although as some movement looks to have been made on the cachix side it might be worth waiting for that to land in tket itself, as it'll speed things up considerably (this repo can then rely on the tket's cached outputs instead of forcing a build).
Please rebase and retarget to main
which is now the default branch.
I have rebased to main
, and I have also updated the flake and workflow to utilise the TKET cachix (binary cache).
For the workflow to succeed, CACHIX_AUTH_TOKEN will need to be available in the workflow environment, as in the tket repository.
I have also run nix flake check
locally (x86_64-linux) and everything passes.
(Additionally, I set nixpkgs to follow TKET's - this will help with possible cache misses if the two disagree on nixpkgs. As more weight is on TKET's build, doing it this way around seems to make the most sense)
I added CACHIX_AUTH_TOKEN
to the repo.
Closing and reopening to trigger CI...
Description
Added nix support, The nix flake fetches the pytket flake to fetch pytket, and uses a custom derivation to generate pyqir. mypy and pytest are run as part of
nix flake check
, which is performed in CI (currently set to every sunday at 2am).At the moment, tket and pytket will be built. The speed of performing the flake check will be improved significantly if we use cachix.
To try out this flake:
Then invoke python.
pytket.qir
is importable and working, e.g.:After the merge of this PR, the development shell will be accessible with
nix develop github:CQCL/pytket-qir
Checklist