question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cache conda packages for Windows builds

See original GitHub issue

It should be possible to cache the conda packages which are always installed on AppVeyor to speed up the build. AppVeyor provides documentation on using a build cache.

My current plan on how to implements this is to cache all the packages which are downloaded and install by the following lines of the appveyor.yml file

    - cmd: conda update --yes --quiet conda
    - cmd: set PYTHONUNBUFFERED=1
    - cmd: conda config --add channels conda-forge
    - cmd: conda install --yes --quiet obvious-ci conda-build-all

These packages come out to ~30 MB for both win-32 and win-64, so ~60 MB total which is under the 100 MB max cache recommendation from AppVeyor. On though would be to add a file backed channel to the conda configuration and then copy the bz2 files from the Miniconda package cache into this directory after installing conda-build-all. The packages would still need to be extracted from this directory.

AppVeyor allows cache-invalidation by watching for changes to a specified files in the repository. Adding two files for invalidating the win-32 and win-64 caches would be prudent. We could roll a cache number in these files whenever new packages are released which are installed by these commands. This would require someone to watch for this to occur but it may be possible to automate this process.

I’ll try to put together a example PR on this topic in the coming week.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:4
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
jjhelmuscommented, Jun 23, 2016

@jakirkham I love the idea of using constructor to create a conda-forge installer which includes all the packages that would normally be install prior to a build. Caching this installer on each platform will probably be easier than caching the packages themselves. A few questions on the idea that should be fleshed out:

  • Should we only use packages from the conda-forge channel or would including packages from the defaults channel be acceptable.
  • Where would we host such an installer? One option would be a GitHub repo with each installer being a released. Where-ever this is hosted it will need to be reliable as the CI services will be downloading from it quite regularly, although caching would reduce this burden.
  • How often would this installer need to be updated with new packages? Would newer packages be conda install-ed on top of this installer or would this also pin a particular set of packages.

I see that this proposal is included in the agenda for tomorrow’s call, perhapes we can work some of these issues out then.

1reaction
jjhelmuscommented, May 13, 2016

After a bit more thinking and googling it should be possible sync the the bz2 files between the two folders so that new packages are automatically copied over to the cache and unused packages are deleted. To manual cache invalidation should be required! robocopy and this SO question should help with the syncing. Also, the documentation on custom conda channels will be helpful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

conda clean
Remove unused packages from writable package caches. WARNING: This does not check for packages installed using symlinks back to the package cache.
Read more >
Reduce your build times on GitHub Actions by caching ...
1 Reduce your build times on GitHub Actions by caching Anaconda environments 2 Deploy your package documentation on GitHub Pages in the RTD ......
Read more >
Configuring a shared package cache — Anaconda ...
This can be found with the following command listed under package cache: conda info. The normal path to the package cache is: Windows...
Read more >
conda/conda-build - Gitter
Would it be possible to cache their parsed contents somewhere? ... I manage to compile it locally, create the conda package, push it...
Read more >
Pipeline caching - Azure - Microsoft Learn
Pipeline caching can help reduce build time by allowing the outputs or downloaded dependencies from one run to be reused in later runs, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found