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

Add Nix CI workflow #141

Closed
1 task done
rszamszur opened this issue Sep 12, 2022 · 3 comments · Fixed by #145
Closed
1 task done

Add Nix CI workflow #141

rszamszur opened this issue Sep 12, 2022 · 3 comments · Fixed by #145
Assignees
Labels
automation Related to project CI/CD

Comments

@rszamszur
Copy link
Member

rszamszur commented Sep 12, 2022

  • I have searched the issues of this repo and believe that this is not a duplicate.

Feature Request

I need to play a bit with nix in GH actions prior deciding whether to implement this.

Clarify/test:

  • nix setup in actions
  • Steps needed to refactor current actions
  • /nix/store caching?

Resources:

@rszamszur rszamszur added triage This issue needs to be triaged automation Related to project CI/CD labels Sep 12, 2022
@rszamszur rszamszur self-assigned this Sep 12, 2022
@rszamszur
Copy link
Member Author

rszamszur commented Sep 13, 2022

The initial try (https://github.com/rszamszur/fastapi-mvc/actions/runs/3044476889) worked surprisingly well (first try 🚀).

The biggest overhead is at:

  • Building custom Nix expressions (but this will be done once, and afterward, it will be fetched from Cachix <3)
  • Overall time of fetching nix binaries from cache (both nixos and Cachix). Since each job is a a separate VM runner. Now, number of jobs times matrics executions, and the fetch overhead gets heavy.
  • A bit of delay on spawning nix-shell (?)

To minimalize fetch overhead, one could:

  • Merge all python version-specific jobs into one. Ex: (metrics 3.9, unit tests 3.9, integration tests 3.9). However, I quite like the granularity of separate jobs. One can see at a quick glance what failed. Moreover, this would require some additional configuration/logic to say what stages are allowed to fail (for instance, if some metrics fail, proceed with the rest of the checks, so at the end, there will be a complete picture of what is wrong).
  • Use GitHub cache for caching /nix/store (although I don't think this will be that much faster)
  • ?

@rszamszur rszamszur removed the triage This issue needs to be triaged label Sep 13, 2022
@rszamszur rszamszur changed the title Improve/refactor GH actions to use nix Add Nix CI workflow Sep 14, 2022
@rszamszur
Copy link
Member Author

After extensive experiments with the current GH action automation, I've decided that the nix CI workflow will be an additional one instead of refactoring. Therefore it can take a bit different implementation, which should resolve the above-mentioned pinpoints. Moreover, having two similar CI workflows alongside can give a good overview of their performance, issues, and reproducibility, to see what's better or verify if Nix expressions are working as expected.

@rszamszur rszamszur added the copier: project Related to copier template label Sep 16, 2022
@rszamszur
Copy link
Member Author

Because of: #146. Changes regarding the project template will be done already in its separate repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation Related to project CI/CD
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant