NWChemEx / .github

GitHub Settings for the NWChemEx Organization
https://nwchemex.github.io/.github/
Apache License 2.0
1 stars 2 forks source link

Reducing build times #24

Open keceli opened 2 years ago

keceli commented 2 years ago

Building NWChemEx from scratch takes 2 to 3 hours on the CI servers. There are different ways we can reduce this time through Github actions by caching and/or using Docker images with cached stages. I don't see any issue on the CI project board directly on this topic , so I wanted to create an issue to align efforts and get feedback.

Currently, I am looking into these solutions:

  1. Using ninja instead of make:
    • ninja reduces the build time significantly. i.e. libint build on the CI server reduces to 42 minutes from 80. With PR NWChemEx-Project/DeveloperTools#117, we can now enable it on all the repos. The only exception is currently TAMM, which requires make.
  2. Enabling ccache:
    • There is a Github action that enables saving the ccache data between the builds. I tested it on the Benchmarks repo and it gets 45% hit rate.
  3. Github cache action:
  4. Using a Docker image with libint and other dependencies installed.
    • Instead of starting from a plain Ubuntu image, we could start the build with an image with all the dependencies particularly libint installed.
    • We can also put all the build into a Dockerfile (we already have one, but needs to be updated) and use a Github action that enables cached layers for building the image. This can replace the current build workflow, but I guess it will be better to have it as a separate action. We can also push these images to docker hub and/or make them downloadable as artifacts of the workflow. Maybe I should create another issue related to this action.

I have seen that with the addition of ninja and ccache build time goes down to 30 minutes. If this sounds reasonable, I can submit PRs for 1 and 2 to implement these changes and work on 3 and 4.