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.

Advice for how to cache the conda installation?

See original GitHub issue

We use this action for Manubot, see workflow and example build. It’s great, thanks for making it! Our current configuration is:

      - name: Install Environment
        uses: goanpeca/setup-miniconda@v1
        with:
          activate-environment: manubot
          environment-file: build/environment.yml
          auto-activate-base: false
          miniconda-version: 'latest'

In https://github.com/manubot/rootstock/pull/316, I’m looking into using actions/cache to cache a directory of data created during action runtime.

However, the slowest part of our build is often installing the conda environment, which currently takes about 100 seconds of the 200 second total time. So I was wondering if the conda environment would be cacheable.

For example what about the following:

      - name: Cache Conda
        id: cache-conda
        uses: actions/cache@v1
        with:
          path: WHAT_GOES_HERE
          key: conda-cache-${{ hashFiles('build/environment.yml') }}
      - name: Some conditional set here?
        if: steps.cache-conda.outputs.cache-hit != 'true'
        uses: goanpeca/setup-miniconda@v1

Basically our goal is use a pre-existing conda installation unless our environment.yml specification is changed. @goanpeca does that sound like a good idea? Any advice on what directory we should cache and how to configure this action to use a cached directory?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
goanpecacommented, Mar 23, 2020

Correct do not specify miniconda versión at all and dont activate the conda autoupdate version. That will use all that is installed with the container.

0reactions
wasdeecommented, Mar 23, 2020

what is the guideline to enable cache? From my understanding, don’t specify miniconda to latest, right

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring a shared package cache — Anaconda ...
Normal installation sets a package cache relative to the install directory. This can be found with the following command listed under package cache:...
Read more >
Clean the conda cache - Nicole Janeway
Clean the conda cache. First, a quick note about the difference between pip and conda. pip is the Python Packaging Authority's recommended tool...
Read more >
conda clean — Conda documentation
-a, --all Remove index cache, lock files, tarballs, unused cache packages, and source cache. -i, --index-cache Remove index cache. -l, --lock Remove all...
Read more >
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 >
Cache conda packages for offline installation - HackMD
One common approach is to conda-pack your environment, transfer the pack, then “unpack” it on the other computer - link.
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