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 size always 0MB (caching pip)

See original GitHub issue
jobs:
  e2e-job:
    runs-on: ubuntu-latest
    container: python:3.9
    services:
      elasticsearch:
        image: elasticsearch:7.14.1
        env:
          'discovery.type': single-node
    steps:
      - name: Check out repository code
        uses: actions/checkout@v2
      - name: Set up Python 3.9
        uses: actions/setup-python@v2
        with:
          python-version: 3.9
      - name: Cache pip dependencies
        uses: actions/cache@v2
        env:
          cache-name: cache-pip-dependencies
        with:
          path: ~/.cache/pip
          key: ${{ runner.os }}-pip-${{ env.cache-name }}-${{ hashFiles('**/requirements.txt') }}
          restore-keys: |
            ${{ runner.os }}-pip-
      - name: Install dependencies
        run: python -m pip install -r requirements.txt
      - name: Run tests
        env:
          ELASTICSEARCH_HOST: elasticsearch
        run: make dev-test

I’ve tried a few variations of this but I don’t think I fundamentally understand how things work, so apologies if this is obvious.

This is the type of logs I see in the post cache step:

Post job cleanup.
/usr/bin/docker exec  eac2516d441d567f76438f7860e3596fc47664738d835124085fb1566a3bf375 sh -c "cat /etc/*release | grep ^ID"
/bin/tar --posix -z -cf cache.tgz -P -C /__w/second/second --files-from manifest.txt
Cache Size: ~0 MB (45 B)
Cache saved successfully
Cache saved with key: Linux-pip-cache-pip-dependencies-787fe77abdcacba9f6abe78e00209fe63740ffd3b12252ab9ce569e07a7cfcb0

I’ve tried running it on other containers too but I get similar results. I have run into oddities like with the container ubuntu:16.04 where pip wasn’t found. I’m not entirely sure what may be causing that but I’ve run out of variations to try.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ivankprodcommented, Nov 25, 2021

Try this:

jobs:
  e2e-job:
    runs-on: ubuntu-latest
    container: python:3.9
    services:
      elasticsearch:
        image: elasticsearch:7.14.1
        env:
          'discovery.type': single-node
    steps:
      - name: Check out repository code
        uses: actions/checkout@v2
      - name: Set up Python 3.9
        uses: actions/setup-python@v2
        with:
          python-version: 3.9
      - name: Cache pip dependencies
        uses: actions/cache@v2
        id: cache
        env:
          cache-name: cache-pip-dependencies
        with:
          path: ~/.cache/pip
          key: ${{ runner.os }}-pip-${{ env.cache-name }}-${{ hashFiles('**/requirements.txt') }}
          restore-keys: |
            ${{ runner.os }}-pip-
      - name: Install dependencies
        if: steps.cache.outputs.cache-hit != 'true'
        run: python -m pip install -r requirements.txt
      - name: Run tests
        env:
          ELASTICSEARCH_HOST: elasticsearch
        run: make dev-test

0reactions
Phantsurecommented, May 9, 2022

@rbhalla Closing this issue for now. You may re-open this if you would like to ask anything else.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Excessive memory use when caching large packages #2984
New argument, pip cache purge --max-size=1GB . This would purge the least-recently-used files from all caches, using the access time ( atime on ......
Read more >
pip uses incorrect cached package version, instead of the user ...
Since pip 20.1, pip has a pip cache command to manage the contents of pip's ... the cache and always access PyPI by...
Read more >
Caching - pip documentation v22.3.1
pip provides an on-by-default caching, designed to reduce the amount of time spent on duplicate downloads and builds.
Read more >
Integrated caching | Citrix ADC 13.1
The memory limit is set to 0 MB and no memory is allocated to the integrated caching feature. Set the memory limits to...
Read more >
Speed up pip downloads in Docker with BuildKit's new caching
Every time you change your Python pip requirements and rebuild your ... now supports a new caching mechanism that can cache these downloads....
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