setup-rye icon indicating copy to clipboard operation
setup-rye copied to clipboard

Enabling cache but it redownloads and reinstalls rye and python

Open my1e5 opened this issue 9 months ago • 7 comments

I'm using this action with a self-hosted runner. I'm using Gitea actions with a Docker-in-Docker approach (https://github.com/vegardit/docker-gitea-act-runner). This is my .yaml:

name: CI/CD
run-name: CI/CD
on: [push, pull_request]

jobs:
  checks:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: eifinger/setup-rye@v2
        id: setup-rye
        with:
          enable-cache: true
          cache-local-storage-path: '/opt/hostedtoolcache'
      - name: Install dependencies
        if: steps.setup-rye.outputs.cache-hit != 'true'
        run: |
          rye sync --no-lock
      - name: Lint
        run: |
          rye run lint

I can get the whole action to run successfully. The only thing that I'm struggling with is getting the cache to work. Looking at the logs it seemed like it would look for a cached version at /opt/hostedtoolcache. And indeed if I set this as my cache-local-storage-path it will say Cache restored from key. I don't know if I'm doing this correctly? It will then skip installing dependencies, but when it runs rye run lint it will take time to re-download [email protected] - is this expected behaviour? Also everytime I run the action it re-downloads the latest Rye and re-installs it - and the installation step itself takes around 20 seconds. I've attached a screenshot of the logs and the full log text.

image

10:09:41 ⭐ Run Main eifinger/setup-rye@v2
10:09:41 [DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0
10:09:41 [DEBUG] Writing entry to tarball workflow/statecmd.txt len:0
10:09:41 [DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0
10:09:41 [DEBUG] Writing entry to tarball workflow/envs.txt len:0
10:09:41 [DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0
10:09:41 [DEBUG] Extracting content to '/var/run/act'
10:09:41 [DEBUG] type=remote-action actionDir=/data/cache/actions/eifinger-setup-rye@v2 actionPath= workdir=/workspace/my1e5/Test actionCacheDir=/data/cache/actions actionName=eifinger-setup-rye@v2 containerActionDir=/var/run/act/actions/eifinger-setup-rye@v2
10:09:41 [DEBUG] /var/run/act/actions/eifinger-setup-rye@v2
10:09:41 [DEBUG] Removing /data/cache/actions/eifinger-setup-rye@v2/.gitignore before docker cp
10:09:41   🐳  docker cp src=/data/cache/actions/eifinger-setup-rye@v2/ dst=/var/run/act/actions/eifinger-setup-rye@v2/
10:09:41 [DEBUG] Writing tarball /tmp/act180939727 from /data/cache/actions/eifinger-setup-rye@v2/
10:09:41 [DEBUG] Stripping prefix:/data/cache/actions/eifinger-setup-rye@v2/ src:/data/cache/actions/eifinger-setup-rye@v2/
10:09:41 [DEBUG] Extracting content from '/tmp/act180939727' to '/var/run/act/actions/eifinger-setup-rye@v2/'
10:09:41 [DEBUG] executing remote job container: [node /var/run/act/actions/eifinger-setup-rye@v2/dist/setup/index.js]
10:09:41   🐳  docker exec cmd=[node /var/run/act/actions/eifinger-setup-rye@v2/dist/setup/index.js] user= workdir=
10:09:41 [DEBUG] Exec command '[node /var/run/act/actions/eifinger-setup-rye@v2/dist/setup/index.js]'
10:09:41 [DEBUG] Working directory '/workspace/my1e5/Test'
10:09:42   | Downloading Rye from "https://github.com/astral-sh/rye/releases/latest/download/rye-x86_64-linux.gz" ...
10:09:42 ::debug::Downloading https://github.com/astral-sh/rye/releases/latest/download/rye-x86_64-linux.gz
10:09:42   | ::debug::Downloading https://github.com/astral-sh/rye/releases/latest/download/rye-x86_64-linux.gz
10:09:42 ::debug::Destination /tmp/a84d8c2c-dab3-486c-8dae-24c74c3dfb7c
10:09:42   | ::debug::Destination /tmp/a84d8c2c-dab3-486c-8dae-24c74c3dfb7c
10:09:44 ::debug::download complete
10:09:44   | ::debug::download complete
10:09:44   | Extracting downloaded archive...
10:09:44   | [command]/usr/bin/gunzip /tmp/a84d8c2c-dab3-486c-8dae-24c74c3dfb7c.gz
10:09:45   | [command]/usr/bin/chmod +x /tmp/a84d8c2c-dab3-486c-8dae-24c74c3dfb7c
10:09:45 ::debug::Checksum not provided. Checking known checksums.
10:09:45   | ::debug::Checksum not provided. Checking known checksums.
10:09:45 ::debug::Checking checksum for x86_64-linux-0.33.0.
10:09:45   | ::debug::Checking checksum for x86_64-linux-0.33.0.
10:09:45 ::debug::Checksum for /tmp/a84d8c2c-dab3-486c-8dae-24c74c3dfb7c_for_validation.gz is valid.
10:09:45   | ::debug::Checksum for /tmp/a84d8c2c-dab3-486c-8dae-24c74c3dfb7c_for_validation.gz is valid.
10:09:45 ::debug::Created temporary directory /tmp/rye_temp_home
10:09:45   | ::debug::Created temporary directory /tmp/rye_temp_home
10:09:45 ::debug::Caching tool setup-rye-2024-03-04 0.33.0 x86_64
10:09:45   | ::debug::Caching tool setup-rye-2024-03-04 0.33.0 x86_64
10:09:45 ::debug::source dir: /tmp/rye_temp_home
10:09:45   | ::debug::source dir: /tmp/rye_temp_home
10:09:45 ::debug::destination /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64
10:09:45   | ::debug::destination /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64
10:09:46 ::debug::finished caching tool
10:09:46   | ::debug::finished caching tool
10:09:46   | Installing Rye into /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64
10:10:07   | Added /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64/shims to the path
10:10:07   | Set RYE_HOME to /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64
10:10:07 ##[add-matcher]/run/act/actions/eifinger-setup-rye@v2/.github/python.json
10:10:07   | ##[add-matcher]/run/act/actions/eifinger-setup-rye@v2/.github/python.json
10:10:07   | Backed up /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64/config.toml
10:10:07 ::debug::followSymbolicLinks 'true'
10:10:07   | ::debug::followSymbolicLinks 'true'
10:10:07 ::debug::followSymbolicLinks 'true'
10:10:07   | ::debug::followSymbolicLinks 'true'
10:10:07 ::debug::implicitDescendants 'true'
10:10:07   | ::debug::implicitDescendants 'true'
10:10:07 ::debug::matchDirectories 'true'
10:10:07   | ::debug::matchDirectories 'true'
10:10:07 ::debug::omitBrokenSymbolicLinks 'true'
10:10:07   | ::debug::omitBrokenSymbolicLinks 'true'
10:10:07 ::debug::Search path '/workspace/my1e5/Test'
10:10:07   | ::debug::Search path '/workspace/my1e5/Test'
10:10:07 ::debug::/workspace/my1e5/Test/requirements-dev.lock
10:10:07   | ::debug::/workspace/my1e5/Test/requirements-dev.lock
10:10:07 ::debug::/workspace/my1e5/Test/requirements.lock
10:10:07   | ::debug::/workspace/my1e5/Test/requirements.lock
10:10:07 ::debug::Found 2 files to hash.
10:10:07   | ::debug::Found 2 files to hash.
10:10:10   | Cache restored from key: setup-rye-5-Linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b
10:10:10   ✅  Success - Main eifinger/setup-rye@v2
10:10:10 ::set-env:: RYE_HOME=/opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64
10:10:10 ::set-output:: rye-version=0.33.0
10:10:10 ::set-output:: cache-hit=true
10:10:10 ::add-path:: /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64/shims
10:10:11 [DEBUG] evaluating expression 'steps.setup-rye.outputs.cache-hit != 'true''
10:10:11 [DEBUG] expression 'steps.setup-rye.outputs.cache-hit != 'true'' evaluated to 'false'
10:10:11 [DEBUG] Skipping step 'Install dependencies' due to 'steps.setup-rye.outputs.cache-hit != 'true''
10:10:11 [DEBUG] evaluating expression ''
10:10:11 [DEBUG] expression '' evaluated to 'true'
10:10:11 ⭐ Run Main Lint
10:10:11 [DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0
10:10:11 [DEBUG] Writing entry to tarball workflow/statecmd.txt len:0
10:10:11 [DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0
10:10:11 [DEBUG] Writing entry to tarball workflow/envs.txt len:0
10:10:11 [DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0
10:10:11 [DEBUG] Extracting content to '/var/run/act'
10:10:11 [DEBUG] Wrote command 
10:10:11 
10:10:11 rye run lint
10:10:11 
10:10:11  to 'workflow/3'
10:10:11 [DEBUG] Writing entry to tarball workflow/3 len:14
10:10:11 [DEBUG] Extracting content to '/var/run/act'
10:10:11   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3] user= workdir=
10:10:11 [DEBUG] Exec command '[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3]'
10:10:11 [DEBUG] Working directory '/workspace/my1e5/Test'
10:10:12   | Downloading [email protected]
10:10:30   | Checking checksum
10:10:30   | Unpacking
10:10:32   | Downloaded [email protected]
10:10:32   | 1 file left unchanged
10:10:32   | All checks passed!
10:10:32   ✅  Success - Main Lint
10:10:33 [DEBUG] evaluating expression 'always()'
10:10:33 [DEBUG] expression 'always()' evaluated to 'true'
10:10:33 ⭐ Run Post eifinger/setup-rye@v2
10:10:33 [DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0
10:10:33 [DEBUG] Writing entry to tarball workflow/statecmd.txt len:0
10:10:33 [DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0
10:10:33 [DEBUG] Writing entry to tarball workflow/envs.txt len:0
10:10:33 [DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0
10:10:33 [DEBUG] Extracting content to '/var/run/act'
10:10:33 [DEBUG] run post step for 'eifinger/setup-rye@v2'
10:10:33 [DEBUG] executing remote job container: [node /var/run/act/actions/eifinger-setup-rye@v2/dist/save-cache/index.js]
10:10:33   🐳  docker exec cmd=[node /var/run/act/actions/eifinger-setup-rye@v2/dist/save-cache/index.js] user= workdir=
10:10:33 [DEBUG] Exec command '[node /var/run/act/actions/eifinger-setup-rye@v2/dist/save-cache/index.js]'
10:10:33 [DEBUG] Working directory '/workspace/my1e5/Test'
10:10:33   | Cache hit occurred on key setup-rye-5-Linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b, not saving cache.
10:10:33   | Restored /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64/config.toml
10:10:33   ✅  Success - Post eifinger/setup-rye@v2

my1e5 avatar May 08 '24 09:05 my1e5

Hi. You are mixing up two things.

This action will save the downloaded rye executable to RUNNER_TOOL_CACHE which on most runners is set to /opt/hostedtoolcache.

If you want to use the latest version of rye, this action will always download the latest available version without checking what the latest version is and if it is maybe already in the tools cache. This is done for a lot of reasons.

If you want to avoid that I suggest to use a specific version of rye: https://github.com/eifinger/setup-rye?tab=readme-ov-file#install-specific-version

The arguments enable-cache and cache-local-storage-path are only used for storing the .venv dir and not the tool itself. I would actually strongly advise against setting cache-local-storage-path to the same value as RUNNER_TOOL_CACHE as you have done. While it should work in general I cannot guarantee that some unforeseen things happen. I usualy set cache-local-storage-path to something like /tmp/setup-rye-cache

eifinger avatar May 08 '24 11:05 eifinger

Thanks a lot for your explanations. I would like to always use the latest version of rye rather than fix a specific version. I guess I'm a bit confused why the installation step takes around 20 seconds on my runner when I've seen the whole Run eifinger/setup-rye@v2 process take ~3 seconds on the astral/rye actions for example (https://github.com/astral-sh/rye/actions/runs/8974958137/job/24648487311). I guess it's something to do with my self-hosted runner.

10:09:46   | Installing Rye into /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64
10:10:07   | Added /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64/shims to the path

I've just tried omitting cache-local-storage-path and just setting enable-cache: true.

- uses: eifinger/setup-rye@v2
  id: setup-rye
  with:
    enable-cache: true

Interestingly the logs seem to show that the Cache restored successfully but then a few lines later it shows cache-hit=false? Is this right?

I note that in the Install dependencies step shown below it downloads and unpacks [email protected] which takes around 10 seconds. But then it doesn't redownload any of the dependencies (e.g. ruff, numpy etc) which it only did on the first run, is this the cache working correctly? Or is this unrelated to the enable-cache setting? I guess my question is - is it right that it has to redownload [email protected] everytime? Shouldn't that be in the cached .venv? Sorry if I'm completely getting this wrong. Appreciate your help.

12:46:42::debug::Found 2 files to hash.
12:46:42  | ::debug::Found 2 files to hash.
12:46:42::debug::Resolved Keys:
12:46:42  | ::debug::Resolved Keys:
12:46:42::debug::["setup-rye-5-Linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b"]
12:46:42  | ::debug::["setup-rye-5-Linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b"]
12:46:42::debug::Checking zstd --quiet --version
12:46:42  | ::debug::Checking zstd --quiet --version
12:46:42::debug::1.4.8
12:46:42  | ::debug::1.4.8
12:46:42::debug::zstd version: 1.4.8
12:46:42  | ::debug::zstd version: 1.4.8
12:46:42::debug::Resource Url: http://172.17.0.2:45661/_apis/artifactcache/cache?keys=setup-rye-5-Linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b&version=75639defedb47c6d3bace66dae998d295b4f1af95badcd588d98af9e58a91544
12:46:42  | ::debug::Resource Url: http://172.17.0.2:45661/_apis/artifactcache/cache?keys=setup-rye-5-Linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b&version=75639defedb47c6d3bace66dae998d295b4f1af95badcd588d98af9e58a91544
12:46:42***
12:46:42  | ::add-mask::***
12:46:42::debug::Cache Result:
12:46:42  | ::debug::Cache Result:
12:46:42::debug::{"archiveLocation":"***","cacheKey":"setup-rye-5-linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b","result":"hit"}
12:46:42  | ::debug::{"archiveLocation":"***","cacheKey":"setup-rye-5-linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b","result":"hit"}
12:46:42::debug::Archive Path: /tmp/d220303c-7d11-45d6-874d-13fdc45d92ce/cache.tzst
12:46:42  | ::debug::Archive Path: /tmp/d220303c-7d11-45d6-874d-13fdc45d92ce/cache.tzst
12:46:42::debug::Use Azure SDK: false
12:46:42  | ::debug::Use Azure SDK: false
12:46:42::debug::Download concurrency: 8
12:46:42  | ::debug::Download concurrency: 8
12:46:42::debug::Request timeout (ms): 30000
12:46:42  | ::debug::Request timeout (ms): 30000
12:46:42::debug::Cache segment download timeout mins env var: undefined
12:46:42  | ::debug::Cache segment download timeout mins env var: undefined
12:46:42::debug::Segment download timeout (ms): 600000
12:46:42  | ::debug::Segment download timeout (ms): 600000
12:46:42::debug::Lookup only: false
12:46:42  | ::debug::Lookup only: false
12:46:42  | Cache Size: ~62 MB (64679030 B)
12:46:42  | [command]/usr/bin/tar -xf /tmp/d220303c-7d11-45d6-874d-13fdc45d92ce/cache.tzst -P -C /workspace/my1e5/Test --use-compress-program unzstd
12:46:43  | Cache restored successfully
12:46:43  | Cache restored from key: setup-rye-5-linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b
12:46:43  ✅  Success - Main eifinger/setup-rye@v2
12:46:43::set-env:: RYE_HOME=/opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64
12:46:43::set-output:: rye-version=0.33.0
12:46:43::set-output:: cache-hit=false
12:46:43::add-path:: /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64/shims
12:46:43[DEBUG] evaluating expression 'steps.setup-rye.outputs.cache-hit != 'true''
12:46:43[DEBUG] expression 'steps.setup-rye.outputs.cache-hit != 'true'' evaluated to 'true'
12:46:43⭐ Run Main Install dependencies
12:46:43[DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0
12:46:43[DEBUG] Writing entry to tarball workflow/statecmd.txt len:0
12:46:43[DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0
12:46:43[DEBUG] Writing entry to tarball workflow/envs.txt len:0
12:46:43[DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0
12:46:43[DEBUG] Extracting content to '/var/run/act'
12:46:43[DEBUG] Wrote command 
2024-05-08 12:46:43 
2024-05-08 12:46:43 rye sync --no-lock
2024-05-08 12:46:43 
2024-05-08 12:46:43 
2024-05-08 12:46:43  to 'workflow/2'
12:46:43[DEBUG] Writing entry to tarball workflow/2 len:21
12:46:43[DEBUG] Extracting content to '/var/run/act'
12:46:43  🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/2] user= workdir=
12:46:43[DEBUG] Exec command '[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/2]'
12:46:43[DEBUG] Working directory '/workspace/my1e5/Test'
12:46:44  | Downloading [email protected]
12:46:52  | Checking checksum
12:46:53  | Unpacking
12:46:54  | Downloaded [email protected]
12:46:54  | Reusing already existing virtualenv
12:46:54  | Installing dependencies
12:46:54  | Creating virtualenv for pip-tools
12:47:04  | Found existing installation: myproject 0.1.0
12:47:04  | Uninstalling myproject-0.1.0:
12:47:04  |   Successfully uninstalled myproject-0.1.0
12:47:04  | Looking in indexes: https://pypi.org/simple/
12:47:04  | Obtaining file:///. (from -r /tmp/tmpke_41dk_ (line 1))
12:47:04  |   Installing build dependencies: started
12:47:06  |   Installing build dependencies: finished with status 'done'
12:47:06  |   Checking if build backend supports build_editable: started
12:47:06  |   Checking if build backend supports build_editable: finished with status 'done'
12:47:06  |   Getting requirements to build editable: started
12:47:06  |   Getting requirements to build editable: finished with status 'done'
12:47:06  |   Installing backend dependencies: started
12:47:07  |   Installing backend dependencies: finished with status 'done'
12:47:07  |   Preparing editable metadata (pyproject.toml): started
12:47:07  |   Preparing editable metadata (pyproject.toml): finished with status 'done'
12:47:07  | Building wheels for collected packages: myproject
12:47:07  |   Building editable for myproject (pyproject.toml): started
12:47:07  |   Building editable for myproject (pyproject.toml): finished with status 'done'
12:47:07  |   Created wheel for myproject: filename=myproject-0.1.0-py3-none-any.whl size=1080 sha256=b83a2be13e2d5fd61ceed923799d096ca1439ff57979ad5e8f8513bf3124236d
12:47:07  |   Stored in directory: /tmp/pip-ephem-wheel-cache-4h9mvnvu/wheels/8b/19/c8/73a63a20645e0f1ed9aae9dd5d459f0f7ad2332bb27cba6c0f
12:47:07  | Successfully built myproject
12:47:07  | Installing collected packages: myproject
12:47:07  | Successfully installed myproject-0.1.0
12:47:07  | Done!
12:47:07  ✅  Success - Main Install dependencies
12:47:07[DEBUG] evaluating expression ''
12:47:07[DEBUG] expression '' evaluated to 'true'
12:47:07⭐ Run Main Lint
12:47:07[DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0
12:47:07[DEBUG] Writing entry to tarball workflow/statecmd.txt len:0
12:47:07[DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0
12:47:07[DEBUG] Writing entry to tarball workflow/envs.txt len:0
12:47:07[DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0
12:47:07[DEBUG] Extracting content to '/var/run/act'
12:47:08[DEBUG] Wrote command 
2024-05-08 12:47:08 
2024-05-08 12:47:08 rye run lint
2024-05-08 12:47:08 
2024-05-08 12:47:08  to 'workflow/3'
12:47:08[DEBUG] Writing entry to tarball workflow/3 len:14
12:47:08[DEBUG] Extracting content to '/var/run/act'
12:47:08  🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3] user= workdir=
12:47:08[DEBUG] Exec command '[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3]'
12:47:08[DEBUG] Working directory '/workspace/my1e5/Test'
12:47:08  | 1 file left unchanged
12:47:08  | All checks passed!
12:47:08  ✅  Success - Main Lint
12:47:08[DEBUG] evaluating expression 'always()'
12:47:08[DEBUG] expression 'always()' evaluated to 'true'
12:47:08⭐ Run Post eifinger/setup-rye@v2
12:47:08[DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0
12:47:08[DEBUG] Writing entry to tarball workflow/statecmd.txt len:0
12:47:08[DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0
12:47:08[DEBUG] Writing entry to tarball workflow/envs.txt len:0
12:47:08[DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0
12:47:08[DEBUG] Extracting content to '/var/run/act'
12:47:08[DEBUG] run post step for 'eifinger/setup-rye@v2'
12:47:08[DEBUG] executing remote job container: [node /var/run/act/actions/eifinger-setup-rye@v2/dist/save-cache/index.js]
12:47:08  🐳  docker exec cmd=[node /var/run/act/actions/eifinger-setup-rye@v2/dist/save-cache/index.js] user= workdir=
12:47:08[DEBUG] Exec command '[node /var/run/act/actions/eifinger-setup-rye@v2/dist/save-cache/index.js]'
12:47:08[DEBUG] Working directory '/workspace/my1e5/Test'
12:47:08  | Saving .venv path: /workspace/my1e5/Test/.venv
12:47:08::debug::Checking zstd --quiet --version
12:47:08  | ::debug::Checking zstd --quiet --version
12:47:08::debug::1.4.8
12:47:08  | ::debug::1.4.8
12:47:08::debug::zstd version: 1.4.8
12:47:08  | ::debug::zstd version: 1.4.8
12:47:08::debug::implicitDescendants 'false'
12:47:08  | ::debug::implicitDescendants 'false'
12:47:08::debug::followSymbolicLinks 'true'
12:47:08  | ::debug::followSymbolicLinks 'true'
12:47:08::debug::implicitDescendants 'false'
12:47:08  | ::debug::implicitDescendants 'false'
12:47:08::debug::omitBrokenSymbolicLinks 'true'
12:47:08  | ::debug::omitBrokenSymbolicLinks 'true'
12:47:08::debug::Search path '/workspace/my1e5/Test/.venv'
12:47:08  | ::debug::Search path '/workspace/my1e5/Test/.venv'
12:47:08::debug::Matched: .venv
12:47:08  | ::debug::Matched: .venv
12:47:08::debug::Cache Paths:
12:47:08  | ::debug::Cache Paths:
12:47:08::debug::[".venv"]
12:47:08  | ::debug::[".venv"]
12:47:08::debug::Archive Path: /tmp/4967e949-2444-454f-a2b6-4a7a1c63acfb/cache.tzst
12:47:08  | ::debug::Archive Path: /tmp/4967e949-2444-454f-a2b6-4a7a1c63acfb/cache.tzst
12:47:08  | [command]/usr/bin/tar --posix -cf cache.tzst --exclude cache.tzst -P -C /workspace/my1e5/Test --files-from manifest.txt --use-compress-program zstdmt
12:47:09::debug::File Size: 64678301
12:47:09  | ::debug::File Size: 64678301
12:47:09::debug::Reserving Cache
12:47:09  | ::debug::Reserving Cache
12:47:09::debug::Resource Url: http://172.17.0.2:45661/_apis/artifactcache/caches
12:47:09  | ::debug::Resource Url: http://172.17.0.2:45661/_apis/artifactcache/caches
12:47:09::debug::Saving Cache (ID: 6)
12:47:09  | ::debug::Saving Cache (ID: 6)
12:47:09::debug::Upload cache
12:47:09  | ::debug::Upload cache
12:47:09::debug::Resource Url: http://172.17.0.2:45661/_apis/artifactcache/caches/6
12:47:09  | ::debug::Resource Url: http://172.17.0.2:45661/_apis/artifactcache/caches/6
12:47:09::debug::Upload concurrency: 4
12:47:09  | ::debug::Upload concurrency: 4
12:47:09::debug::Upload chunk size: 33554432
12:47:09  | ::debug::Upload chunk size: 33554432
12:47:09::debug::Awaiting all uploads
12:47:09  | ::debug::Awaiting all uploads
12:47:09::debug::Uploading chunk of size 33554432 bytes at offset 0 with content range: bytes 0-33554431/*
12:47:09  | ::debug::Uploading chunk of size 33554432 bytes at offset 0 with content range: bytes 0-33554431/*
12:47:09::debug::Uploading chunk of size 31123869 bytes at offset 33554432 with content range: bytes 33554432-64678300/*
12:47:09  | ::debug::Uploading chunk of size 31123869 bytes at offset 33554432 with content range: bytes 33554432-64678300/*
12:47:09::debug::Commiting cache
12:47:09  | ::debug::Commiting cache
12:47:09  | Cache Size: ~62 MB (64678301 B)
12:47:09::debug::Resource Url: http://172.17.0.2:45661/_apis/artifactcache/caches/6
12:47:09  | ::debug::Resource Url: http://172.17.0.2:45661/_apis/artifactcache/caches/6
12:47:09  | Cache saved successfully
12:47:09  | Cache saved with the key: setup-rye-5-Linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b
12:47:09  | Restored /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64/config.toml
12:47:09  ✅  Success - Post eifinger/setup-rye@v2

my1e5 avatar May 08 '24 13:05 my1e5

Tried setting version: '0.33.0' and cache-local-storage-path: /tmp/setup-rye-cache

- uses: eifinger/setup-rye@v2
  id: setup-rye
  with:
    version: '0.33.0'
    enable-cache: true
    cache-local-storage-path: /tmp/setup-rye-cache

And eifinger/setup-rye@v2 took 1s! Would be really interested to know if there was a way to use the cache if it is latest version otherwise install again (only because my installation step seems to be so slow).

image

Interestingly though, Local cache is not found: /tmp/setup-rye-cache/. I've tried multiple runs and it is never found. It then proceeds to install all dependencies from scratch (redownloads ruff, numpy etc). Is this a bug with cache-local-storage-path? Or with my runner?

This is the post logs

⭐ Run Post eifinger/setup-rye@v2
Writing entry to tarball workflow/outputcmd.txt len:0
Writing entry to tarball workflow/statecmd.txt len:0
Writing entry to tarball workflow/pathcmd.txt len:0
Writing entry to tarball workflow/envs.txt len:0
Writing entry to tarball workflow/SUMMARY.md len:0
Extracting content to '/var/run/act'
run post step for 'eifinger/setup-rye@v2'
executing remote job container: [node /var/run/act/actions/eifinger-setup-rye@v2/dist/save-cache/index.js]
  🐳  docker exec cmd=[node /var/run/act/actions/eifinger-setup-rye@v2/dist/save-cache/index.js] user= workdir=
Exec command '[node /var/run/act/actions/eifinger-setup-rye@v2/dist/save-cache/index.js]'
Working directory '/workspace/my1e5/Test'
Saving .venv path: /workspace/my1e5/Test/.venv
Cache saved with the key: setup-rye-5-Linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b
Restored /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64/config.toml
  ✅  Success - Post eifinger/setup-rye@v2

my1e5 avatar May 08 '24 13:05 my1e5

Given that it finds the tool somewhere in /opt but not the cache under /tmp I strongly suspect the Docker setup at fault here. I have the exact same configuration running successfully with a self hosted runner on baremetal

eifinger avatar May 08 '24 14:05 eifinger

Thanks for your help. Yes, if I set a specific version of rye it is able to find the cached tool in /opt/hostedtoolcache. But it's only able to find the cached .venv if it's also stored in /opt/hostedtoolcache. I guess the problem is with my Docker-in-Docker approach. The location I put for cache-local-storage-path needs to somehow be persistent between runs, because it's spinning up a new docker instance for each run. But /opt/hostedtoolcache is persistent between runs so if you set it to that it works (but as you say is unadvisable). I must admit I'm not an expert in using this runner or with using this Docker-in-Docker approach so will investigate further.

my1e5 avatar May 08 '24 19:05 my1e5

Try setting it to opt/hostedtoolcache/setup-rye-cache can't think of a reason why this should break something. But if you find something outside of opt/hostedtoolcache that works it would still be preferable

eifinger avatar May 09 '24 08:05 eifinger

FYI: https://github.com/eifinger/setup-rye/releases/tag/v3.0.0

eifinger avatar May 12 '24 08:05 eifinger

setup-rye@v3 has made a big improvement. Now using this minimal config everything works nicely out the box.

    - uses: eifinger/setup-rye@v3
      id: setup-rye
      with:
        enable-cache: true

The eifinger/setup-rye@v3 step takes 2 seconds and restores 0.33.0 from cache.

 Found Rye in cache for 0.33.0
Added /opt/hostedtoolcache/setup-rye-[2](http://mygiteaserver/my1e5/Test/actions/runs/59#jobstep-2-2)024-03-04/0.33.0/x86_64/shims to the path
Set RYE_HOME to /opt/hostedtoolcache/setup-rye-2024-0[3](http://mygiteaserver/my1e5/Test/actions/runs/59#jobstep-2-3)-04/0.33.0/x86_64
##[add-matcher]/run/act/actions/eifinger-setup-rye@v3/.github/python.json
Backed up /opt/hostedtoolcache/setup-rye-202[4](http://mygiteaserver/my1e5/Test/actions/runs/59#jobstep-2-4)-03-04/0.33.0/x86_64/config.toml
Cache Size: ~62 MB (64693337 B)
[command]/usr/bin/tar -xf /tmp/ad69cbdf-9cee-4bb7-b927-61876b64b9d4/cache.tzst -P -C /workspace/my1e5/Test --use-compress-program unzstd
Cache restored successfully
Cache restored from key: setup-rye-[5](http://mygiteaserver/my1e5/Test/actions/runs/59#jobstep-2-5)-linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b

When it says cache restored in the above step - does that mean cache-hit should be true? Because I'm finding it is false and the 'Install dependencies' step triggers as a result. Is this correct?

10:45:51 ::set-env:: RYE_HOME=/opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64
10:45:51 ::set-output:: rye-version=0.33.0
10:45:51 ::set-output:: cache-hit=false
10:45:51 ::add-path:: /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64/shims
10:45:51 [DEBUG] evaluating expression 'steps.setup-rye.outputs.cache-hit != 'true''
10:45:51 [DEBUG] expression 'steps.setup-rye.outputs.cache-hit != 'true'' evaluated to 'true'

However, unlike before when it would redownload python, using setup-rye@v3 it doesn't redownload python. It says it is reusing the already existing virtualenv and this step only takes 5 seconds.

Reusing already existing virtualenv
Installing dependencies
Found existing installation: myproject 0.1.0
Uninstalling myproject-0.1.0:
  Successfully uninstalled myproject-0.1.0
Looking in indexes: https://pypi.org/simple/
Obtaining file:///. (from -r /tmp/tmph1zavsye (line 1))
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Checking if build backend supports build_editable: started
  Checking if build backend supports build_editable: finished with status 'done'
  Getting requirements to build editable: started
  Getting requirements to build editable: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
  Preparing editable metadata (pyproject.toml): started
  Preparing editable metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: myproject
  Building editable for myproject (pyproject.toml): started
  Building editable for myproject (pyproject.toml): finished with status 'done'
  Created wheel for myproject: filename=myproject-0.1.0-py3-none-any.whl size=1080 sha256=b83a2be13e2d5fd61ceed923799d096ca1439ff57979ad5e8f8513bf3124236d
  Stored in directory: /tmp/pip-ephem-wheel-cache-rjs98r8o/wheels/8b/19/c8/73a63a20645e0f1ed9aae9dd5d459f0f7ad2332bb27cba6c0f
Successfully built myproject
Installing collected packages: myproject
Successfully installed myproject-0.1.0
Done!

If this all expected behaviour then that's fine. But overall, setup-rye@v3 has basically solved my issue. The setup-rye stage no longer takes 20+ seconds. And python doesn't redownload and install itself every time. My workflow runs super fast now. (And I'm also hoping the cache will take care of itself and I don't need to clean it up manually). Thanks for your help! image

my1e5 avatar May 13 '24 10:05 my1e5

@my1e5 that looks strange.

Can you please provide me the full log of the setup-rye and the Post setup-rye step? There is some cache-key mismatch

eifinger avatar May 13 '24 11:05 eifinger

Using

jobs:
  checks:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: eifinger/setup-rye@v3
        id: setup-rye
        with:
          enable-cache: true
      - name: Install dependencies
        if: steps.setup-rye.outputs.cache-hit != 'true'
        run: |
          rye sync --no-lock
      - name: Lint
        run: |
          rye run lint

First run on a new runner

image

Logs

Run Main eifinger/setup-rye@v3
13:47:21 ⭐ Run Main eifinger/setup-rye@v3
13:47:21 [DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0
13:47:21 [DEBUG] Writing entry to tarball workflow/statecmd.txt len:0
13:47:21 [DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0
13:47:21 [DEBUG] Writing entry to tarball workflow/envs.txt len:0
13:47:21 [DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0
13:47:21 [DEBUG] Extracting content to '/var/run/act'
13:47:21 [DEBUG] type=remote-action actionDir=/data/cache/actions/eifinger-setup-rye@v3 actionPath= workdir=/workspace/my1e5/Test actionCacheDir=/data/cache/actions actionName=eifinger-setup-rye@v3 containerActionDir=/var/run/act/actions/eifinger-setup-rye@v3
13:47:21 [DEBUG] /var/run/act/actions/eifinger-setup-rye@v3
13:47:21 [DEBUG] Removing /data/cache/actions/eifinger-setup-rye@v3/.gitignore before docker cp
13:47:21   🐳  docker cp src=/data/cache/actions/eifinger-setup-rye@v3/ dst=/var/run/act/actions/eifinger-setup-rye@v3/
13:47:21 [DEBUG] Writing tarball /tmp/act3764954418 from /data/cache/actions/eifinger-setup-rye@v3/
13:47:21 [DEBUG] Stripping prefix:/data/cache/actions/eifinger-setup-rye@v3/ src:/data/cache/actions/eifinger-setup-rye@v3/
13:47:21 [DEBUG] Extracting content from '/tmp/act3764954418' to '/var/run/act/actions/eifinger-setup-rye@v3/'
13:47:21 [DEBUG] executing remote job container: [node /var/run/act/actions/eifinger-setup-rye@v3/dist/setup/index.js]
13:47:21   🐳  docker exec cmd=[node /var/run/act/actions/eifinger-setup-rye@v3/dist/setup/index.js] user= workdir=
13:47:21 [DEBUG] Exec command '[node /var/run/act/actions/eifinger-setup-rye@v3/dist/setup/index.js]'
13:47:21 [DEBUG] Working directory '/workspace/my1e5/Test'
13:47:21 ::debug::Trying to get rye from tool cache for 0.33.0...
13:47:21   | ::debug::Trying to get rye from tool cache for 0.33.0...
13:47:21 ::debug::Cached versions: 
13:47:21   | ::debug::Cached versions: 
13:47:21 ::debug::isExplicit: 0.33.0
13:47:21   | ::debug::isExplicit: 0.33.0
13:47:21 ::debug::explicit? true
13:47:21   | ::debug::explicit? true
13:47:21 ::debug::checking cache: /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64
13:47:21   | ::debug::checking cache: /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64
13:47:21 ::debug::not found
13:47:21   | ::debug::not found
13:47:21   | Downloading Rye from "https://github.com/astral-sh/rye/releases/download/0.33.0/rye-x86_64-linux.gz" ...
13:47:21 ::debug::Downloading https://github.com/astral-sh/rye/releases/download/0.33.0/rye-x86_64-linux.gz
13:47:21   | ::debug::Downloading https://github.com/astral-sh/rye/releases/download/0.33.0/rye-x86_64-linux.gz
13:47:21 ::debug::Destination /tmp/29043a49-25dc-4ba2-bb1d-44fb9bf414bd
13:47:21   | ::debug::Destination /tmp/29043a49-25dc-4ba2-bb1d-44fb9bf414bd
13:47:23 ::debug::download complete
13:47:23   | ::debug::download complete
13:47:23 ::debug::Checksum not provided. Checking known checksums.
13:47:23   | ::debug::Checksum not provided. Checking known checksums.
13:47:23 ::debug::Checking checksum for x86_64-linux-0.33.0.
13:47:23   | ::debug::Checking checksum for x86_64-linux-0.33.0.
13:47:23 ::debug::Checksum for /tmp/29043a49-25dc-4ba2-bb1d-44fb9bf414bd is valid.
13:47:23   | ::debug::Checksum for /tmp/29043a49-25dc-4ba2-bb1d-44fb9bf414bd is valid.
13:47:23   | Extracting downloaded archive...
13:47:23   | [command]/usr/bin/gunzip /tmp/29043a49-25dc-4ba2-bb1d-44fb9bf414bd.gz
13:47:24   | [command]/usr/bin/chmod +x /tmp/29043a49-25dc-4ba2-bb1d-44fb9bf414bd
13:47:24 ::debug::Created temporary directory /tmp/rye_temp_home
13:47:24   | ::debug::Created temporary directory /tmp/rye_temp_home
13:47:24 ::debug::Caching tool setup-rye-2024-03-04 0.33.0 x86_64
13:47:24   | ::debug::Caching tool setup-rye-2024-03-04 0.33.0 x86_64
13:47:24 ::debug::source dir: /tmp/rye_temp_home
13:47:24   | ::debug::source dir: /tmp/rye_temp_home
13:47:24 ::debug::destination /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64
13:47:24   | ::debug::destination /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64
13:47:24 ::debug::finished caching tool
13:47:24   | ::debug::finished caching tool
13:47:24   | Installing Rye into /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64
13:47:48   | Added /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64/shims to the path
13:47:48   | Set RYE_HOME to /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64
13:47:48 ##[add-matcher]/run/act/actions/eifinger-setup-rye@v3/.github/python.json
13:47:48   | ##[add-matcher]/run/act/actions/eifinger-setup-rye@v3/.github/python.json
13:47:48   | Backed up /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64/config.toml
13:47:48 ::debug::followSymbolicLinks 'true'
13:47:48   | ::debug::followSymbolicLinks 'true'
13:47:48 ::debug::followSymbolicLinks 'true'
13:47:48   | ::debug::followSymbolicLinks 'true'
13:47:48 ::debug::implicitDescendants 'true'
13:47:48   | ::debug::implicitDescendants 'true'
13:47:48 ::debug::matchDirectories 'true'
13:47:48   | ::debug::matchDirectories 'true'
13:47:48 ::debug::omitBrokenSymbolicLinks 'true'
13:47:48   | ::debug::omitBrokenSymbolicLinks 'true'
13:47:48 ::debug::Search path '/workspace/my1e5/Test'
13:47:48   | ::debug::Search path '/workspace/my1e5/Test'
13:47:48 ::debug::/workspace/my1e5/Test/requirements-dev.lock
13:47:48   | ::debug::/workspace/my1e5/Test/requirements-dev.lock
13:47:48 ::debug::/workspace/my1e5/Test/requirements.lock
13:47:48   | ::debug::/workspace/my1e5/Test/requirements.lock
13:47:48 ::debug::Found 2 files to hash.
13:47:48   | ::debug::Found 2 files to hash.
13:47:48 ::debug::Resolved Keys:
13:47:48   | ::debug::Resolved Keys:
13:47:48 ::debug::["setup-rye-5-Linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b"]
13:47:48   | ::debug::["setup-rye-5-Linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b"]
13:47:48 ::debug::Checking zstd --quiet --version
13:47:48   | ::debug::Checking zstd --quiet --version
13:47:48 ::debug::1.4.8
13:47:48   | ::debug::1.4.8
13:47:48 ::debug::zstd version: 1.4.8
13:47:48   | ::debug::zstd version: 1.4.8
13:47:48 ::debug::Resource Url: http://172.17.0.2:34689/_apis/artifactcache/cache?keys=setup-rye-5-Linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b&version=75639defedb47c6d3bace66dae998d295b4f1af95badcd588d98af9e58a91544
13:47:48   | ::debug::Resource Url: http://172.17.0.2:34689/_apis/artifactcache/cache?keys=setup-rye-5-Linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b&version=75639defedb47c6d3bace66dae998d295b4f1af95badcd588d98af9e58a91544
13:47:48 ::debug::Failed to delete archive: Error: ENOENT: no such file or directory, unlink ''
13:47:48   | ::debug::Failed to delete archive: Error: ENOENT: no such file or directory, unlink ''
13:47:48   | No cache found for key: setup-rye-5-Linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b
13:47:48   ✅  Success - Main eifinger/setup-rye@v3
13:47:48 ::set-env:: RYE_HOME=/opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64
13:47:48 ::set-output:: cache-hit=false
13:47:48 ::set-output:: rye-version=0.33.0
13:47:48 ::add-path:: /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64/shims
13:47:48 [DEBUG] evaluating expression 'steps.setup-rye.outputs.cache-hit != 'true''
13:47:48 [DEBUG] expression 'steps.setup-rye.outputs.cache-hit != 'true'' evaluated to 'true'
13:47:48 ⭐ Run Main Install dependencies
Run Post eifinger/setup-rye@v3
13:48:43 ⭐ Run Post eifinger/setup-rye@v3
13:48:43 [DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0
13:48:43 [DEBUG] Writing entry to tarball workflow/statecmd.txt len:0
13:48:43 [DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0
13:48:43 [DEBUG] Writing entry to tarball workflow/envs.txt len:0
13:48:43 [DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0
13:48:43 [DEBUG] Extracting content to '/var/run/act'
13:48:43 [DEBUG] run post step for 'eifinger/setup-rye@v3'
13:48:43 [DEBUG] executing remote job container: [node /var/run/act/actions/eifinger-setup-rye@v3/dist/save-cache/index.js]
13:48:43   🐳  docker exec cmd=[node /var/run/act/actions/eifinger-setup-rye@v3/dist/save-cache/index.js] user= workdir=
13:48:43 [DEBUG] Exec command '[node /var/run/act/actions/eifinger-setup-rye@v3/dist/save-cache/index.js]'
13:48:43 [DEBUG] Working directory '/workspace/my1e5/Test'
13:48:43   | Saving .venv path: /workspace/my1e5/Test/.venv
13:48:43 ::debug::Checking zstd --quiet --version
13:48:43   | ::debug::Checking zstd --quiet --version
13:48:43 ::debug::1.4.8
13:48:43   | ::debug::1.4.8
13:48:43 ::debug::zstd version: 1.4.8
13:48:43   | ::debug::zstd version: 1.4.8
13:48:43 ::debug::implicitDescendants 'false'
13:48:43   | ::debug::implicitDescendants 'false'
13:48:43 ::debug::followSymbolicLinks 'true'
13:48:43   | ::debug::followSymbolicLinks 'true'
13:48:43 ::debug::implicitDescendants 'false'
13:48:43   | ::debug::implicitDescendants 'false'
13:48:43 ::debug::omitBrokenSymbolicLinks 'true'
13:48:43   | ::debug::omitBrokenSymbolicLinks 'true'
13:48:43 ::debug::Search path '/workspace/my1e5/Test/.venv'
13:48:43   | ::debug::Search path '/workspace/my1e5/Test/.venv'
13:48:43 ::debug::Matched: .venv
13:48:43   | ::debug::Matched: .venv
13:48:43 ::debug::Cache Paths:
13:48:43   | ::debug::Cache Paths:
13:48:43 ::debug::[".venv"]
13:48:43   | ::debug::[".venv"]
13:48:43 ::debug::Archive Path: /tmp/133e92eb-da8c-4775-90cb-c7adc6819a96/cache.tzst
13:48:43   | ::debug::Archive Path: /tmp/133e92eb-da8c-4775-90cb-c7adc6819a96/cache.tzst
13:48:43   | [command]/usr/bin/tar --posix -cf cache.tzst --exclude cache.tzst -P -C /workspace/my1e5/Test --files-from manifest.txt --use-compress-program zstdmt
13:48:44 ::debug::File Size: 64694535
13:48:44   | ::debug::File Size: 64694535
13:48:44 ::debug::Reserving Cache
13:48:44   | ::debug::Reserving Cache
13:48:44 ::debug::Resource Url: http://172.17.0.2:34689/_apis/artifactcache/caches
13:48:44   | ::debug::Resource Url: http://172.17.0.2:34689/_apis/artifactcache/caches
13:48:44 ::debug::Saving Cache (ID: 1)
13:48:44   | ::debug::Saving Cache (ID: 1)
13:48:44 ::debug::Upload cache
13:48:44   | ::debug::Upload cache
13:48:44 ::debug::Resource Url: http://172.17.0.2:34689/_apis/artifactcache/caches/1
13:48:44   | ::debug::Resource Url: http://172.17.0.2:34689/_apis/artifactcache/caches/1
13:48:44 ::debug::Upload concurrency: 4
13:48:44   | ::debug::Upload concurrency: 4
13:48:44 ::debug::Upload chunk size: 33554432
13:48:44   | ::debug::Upload chunk size: 33554432
13:48:44 ::debug::Awaiting all uploads
13:48:44   | ::debug::Awaiting all uploads
13:48:44 ::debug::Uploading chunk of size 33554432 bytes at offset 0 with content range: bytes 0-33554431/*
13:48:44   | ::debug::Uploading chunk of size 33554432 bytes at offset 0 with content range: bytes 0-33554431/*
13:48:44 ::debug::Uploading chunk of size 31140103 bytes at offset 33554432 with content range: bytes 33554432-64694534/*
13:48:44   | ::debug::Uploading chunk of size 31140103 bytes at offset 33554432 with content range: bytes 33554432-64694534/*
13:48:44 ::debug::Commiting cache
13:48:44   | ::debug::Commiting cache
13:48:44   | Cache Size: ~62 MB (64694535 B)
13:48:44 ::debug::Resource Url: http://172.17.0.2:34689/_apis/artifactcache/caches/1
13:48:44   | ::debug::Resource Url: http://172.17.0.2:34689/_apis/artifactcache/caches/1
13:48:44   | Cache saved successfully
13:48:44   | Cache saved with the key: setup-rye-5-Linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b
13:48:44   | Restored /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64/config.toml
13:48:44   ✅  Success - Post eifinger/setup-rye@v3

Second run

image

Logs

Run Main eifinger/setup-rye@v3
13:50:09 ⭐ Run Main eifinger/setup-rye@v3
13:50:09 [DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0
13:50:09 [DEBUG] Writing entry to tarball workflow/statecmd.txt len:0
13:50:09 [DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0
13:50:09 [DEBUG] Writing entry to tarball workflow/envs.txt len:0
13:50:09 [DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0
13:50:09 [DEBUG] Extracting content to '/var/run/act'
13:50:09 [DEBUG] type=remote-action actionDir=/data/cache/actions/eifinger-setup-rye@v3 actionPath= workdir=/workspace/my1e5/Test actionCacheDir=/data/cache/actions actionName=eifinger-setup-rye@v3 containerActionDir=/var/run/act/actions/eifinger-setup-rye@v3
13:50:09 [DEBUG] /var/run/act/actions/eifinger-setup-rye@v3
13:50:09 [DEBUG] Removing /data/cache/actions/eifinger-setup-rye@v3/.gitignore before docker cp
13:50:09   🐳  docker cp src=/data/cache/actions/eifinger-setup-rye@v3/ dst=/var/run/act/actions/eifinger-setup-rye@v3/
13:50:09 [DEBUG] Writing tarball /tmp/act4168481143 from /data/cache/actions/eifinger-setup-rye@v3/
13:50:09 [DEBUG] Stripping prefix:/data/cache/actions/eifinger-setup-rye@v3/ src:/data/cache/actions/eifinger-setup-rye@v3/
13:50:09 [DEBUG] Extracting content from '/tmp/act4168481143' to '/var/run/act/actions/eifinger-setup-rye@v3/'
13:50:09 [DEBUG] executing remote job container: [node /var/run/act/actions/eifinger-setup-rye@v3/dist/setup/index.js]
13:50:09   🐳  docker exec cmd=[node /var/run/act/actions/eifinger-setup-rye@v3/dist/setup/index.js] user= workdir=
13:50:09 [DEBUG] Exec command '[node /var/run/act/actions/eifinger-setup-rye@v3/dist/setup/index.js]'
13:50:09 [DEBUG] Working directory '/workspace/my1e5/Test'
13:50:09 ::debug::Trying to get rye from tool cache for 0.33.0...
13:50:09   | ::debug::Trying to get rye from tool cache for 0.33.0...
13:50:09 ::debug::isExplicit: 0.33.0
13:50:09   | ::debug::isExplicit: 0.33.0
13:50:09 ::debug::explicit? true
13:50:09   | ::debug::explicit? true
13:50:09 ::debug::Cached versions: 0.33.0
13:50:09   | ::debug::Cached versions: 0.33.0
13:50:09 ::debug::isExplicit: 0.33.0
13:50:09   | ::debug::isExplicit: 0.33.0
13:50:09 ::debug::explicit? true
13:50:09   | ::debug::explicit? true
13:50:09 ::debug::checking cache: /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64
13:50:09   | ::debug::checking cache: /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64
13:50:09 ::debug::Found tool in cache setup-rye-2024-03-04 0.33.0 x86_64
13:50:09   | ::debug::Found tool in cache setup-rye-2024-03-04 0.33.0 x86_64
13:50:09   | Found Rye in cache for 0.33.0
13:50:09   | Added /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64/shims to the path
13:50:09   | Set RYE_HOME to /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64
13:50:09 ##[add-matcher]/run/act/actions/eifinger-setup-rye@v3/.github/python.json
13:50:09   | ##[add-matcher]/run/act/actions/eifinger-setup-rye@v3/.github/python.json
13:50:09   | Backed up /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64/config.toml
13:50:09 ::debug::followSymbolicLinks 'true'
13:50:09   | ::debug::followSymbolicLinks 'true'
13:50:09 ::debug::followSymbolicLinks 'true'
13:50:09   | ::debug::followSymbolicLinks 'true'
13:50:09 ::debug::implicitDescendants 'true'
13:50:09   | ::debug::implicitDescendants 'true'
13:50:09 ::debug::matchDirectories 'true'
13:50:09   | ::debug::matchDirectories 'true'
13:50:09 ::debug::omitBrokenSymbolicLinks 'true'
13:50:09   | ::debug::omitBrokenSymbolicLinks 'true'
13:50:09 ::debug::Search path '/workspace/my1e5/Test'
13:50:09   | ::debug::Search path '/workspace/my1e5/Test'
13:50:09 ::debug::/workspace/my1e5/Test/requirements-dev.lock
13:50:09   | ::debug::/workspace/my1e5/Test/requirements-dev.lock
13:50:09 ::debug::/workspace/my1e5/Test/requirements.lock
13:50:09   | ::debug::/workspace/my1e5/Test/requirements.lock
13:50:09 ::debug::Found 2 files to hash.
13:50:09   | ::debug::Found 2 files to hash.
13:50:09 ::debug::Resolved Keys:
13:50:09   | ::debug::Resolved Keys:
13:50:09 ::debug::["setup-rye-5-Linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b"]
13:50:09   | ::debug::["setup-rye-5-Linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b"]
13:50:09 ::debug::Checking zstd --quiet --version
13:50:09   | ::debug::Checking zstd --quiet --version
13:50:09 ::debug::1.4.8
13:50:09   | ::debug::1.4.8
13:50:09 ::debug::zstd version: 1.4.8
13:50:09   | ::debug::zstd version: 1.4.8
13:50:09 ::debug::Resource Url: http://172.17.0.2:34689/_apis/artifactcache/cache?keys=setup-rye-5-Linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b&version=75639defedb47c6d3bace66dae998d295b4f1af95badcd588d98af9e58a91544
13:50:09   | ::debug::Resource Url: http://172.17.0.2:34689/_apis/artifactcache/cache?keys=setup-rye-5-Linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b&version=75639defedb47c6d3bace66dae998d295b4f1af95badcd588d98af9e58a91544
13:50:09 ***
13:50:09   | ::add-mask::***
13:50:09 ::debug::Cache Result:
13:50:09   | ::debug::Cache Result:
13:50:09 ::debug::{"archiveLocation":"***","cacheKey":"setup-rye-5-linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b","result":"hit"}
13:50:09   | ::debug::{"archiveLocation":"***","cacheKey":"setup-rye-5-linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b","result":"hit"}
13:50:09 ::debug::Archive Path: /tmp/ab278976-b8aa-4170-a79e-404e4228b410/cache.tzst
13:50:09   | ::debug::Archive Path: /tmp/ab278976-b8aa-4170-a79e-404e4228b410/cache.tzst
13:50:09 ::debug::Use Azure SDK: false
13:50:09   | ::debug::Use Azure SDK: false
13:50:09 ::debug::Download concurrency: 8
13:50:09   | ::debug::Download concurrency: 8
13:50:09 ::debug::Request timeout (ms): 30000
13:50:09   | ::debug::Request timeout (ms): 30000
13:50:09 ::debug::Cache segment download timeout mins env var: undefined
13:50:09   | ::debug::Cache segment download timeout mins env var: undefined
13:50:09 ::debug::Segment download timeout (ms): 600000
13:50:09   | ::debug::Segment download timeout (ms): 600000
13:50:09 ::debug::Lookup only: false
13:50:09   | ::debug::Lookup only: false
13:50:10   | Cache Size: ~62 MB (64694535 B)
13:50:10   | [command]/usr/bin/tar -xf /tmp/ab278976-b8aa-4170-a79e-404e4228b410/cache.tzst -P -C /workspace/my1e5/Test --use-compress-program unzstd
13:50:10   | Cache restored successfully
13:50:10   | Cache restored from key: setup-rye-5-linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b
13:50:10   ✅  Success - Main eifinger/setup-rye@v3
13:50:10 ::set-env:: RYE_HOME=/opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64
13:50:11 ::set-output:: rye-version=0.33.0
13:50:11 ::set-output:: cache-hit=false
13:50:11 ::add-path:: /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64/shims
13:50:11 [DEBUG] evaluating expression 'steps.setup-rye.outputs.cache-hit != 'true''
13:50:11 [DEBUG] expression 'steps.setup-rye.outputs.cache-hit != 'true'' evaluated to 'true'
13:50:11 ⭐ Run Main Install dependencies
Run Post eifinger/setup-rye@v3
13:50:18 ⭐ Run Post eifinger/setup-rye@v3
13:50:18 [DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0
13:50:18 [DEBUG] Writing entry to tarball workflow/statecmd.txt len:0
13:50:18 [DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0
13:50:18 [DEBUG] Writing entry to tarball workflow/envs.txt len:0
13:50:18 [DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0
13:50:18 [DEBUG] Extracting content to '/var/run/act'
13:50:18 [DEBUG] run post step for 'eifinger/setup-rye@v3'
13:50:18 [DEBUG] executing remote job container: [node /var/run/act/actions/eifinger-setup-rye@v3/dist/save-cache/index.js]
13:50:18   🐳  docker exec cmd=[node /var/run/act/actions/eifinger-setup-rye@v3/dist/save-cache/index.js] user= workdir=
13:50:18 [DEBUG] Exec command '[node /var/run/act/actions/eifinger-setup-rye@v3/dist/save-cache/index.js]'
13:50:18 [DEBUG] Working directory '/workspace/my1e5/Test'
13:50:18   | Saving .venv path: /workspace/my1e5/Test/.venv
13:50:18 ::debug::Checking zstd --quiet --version
13:50:18   | ::debug::Checking zstd --quiet --version
13:50:18 ::debug::1.4.8
13:50:18   | ::debug::1.4.8
13:50:18 ::debug::zstd version: 1.4.8
13:50:18   | ::debug::zstd version: 1.4.8
13:50:18 ::debug::implicitDescendants 'false'
13:50:18   | ::debug::implicitDescendants 'false'
13:50:18 ::debug::followSymbolicLinks 'true'
13:50:18   | ::debug::followSymbolicLinks 'true'
13:50:18 ::debug::implicitDescendants 'false'
13:50:18   | ::debug::implicitDescendants 'false'
13:50:18 ::debug::omitBrokenSymbolicLinks 'true'
13:50:18   | ::debug::omitBrokenSymbolicLinks 'true'
13:50:18 ::debug::Search path '/workspace/my1e5/Test/.venv'
13:50:18   | ::debug::Search path '/workspace/my1e5/Test/.venv'
13:50:18 ::debug::Matched: .venv
13:50:18   | ::debug::Matched: .venv
13:50:18 ::debug::Cache Paths:
13:50:18   | ::debug::Cache Paths:
13:50:18 ::debug::[".venv"]
13:50:18   | ::debug::[".venv"]
13:50:18 ::debug::Archive Path: /tmp/6ded90ea-3c40-4115-a967-6be2132b1de9/cache.tzst
13:50:18   | ::debug::Archive Path: /tmp/6ded90ea-3c40-4115-a967-6be2132b1de9/cache.tzst
13:50:18   | [command]/usr/bin/tar --posix -cf cache.tzst --exclude cache.tzst -P -C /workspace/my1e5/Test --files-from manifest.txt --use-compress-program zstdmt
13:50:19 ::debug::File Size: 64679479
13:50:19   | ::debug::File Size: 64679479
13:50:19 ::debug::Reserving Cache
13:50:19   | ::debug::Reserving Cache
13:50:19 ::debug::Resource Url: http://172.17.0.2:34689/_apis/artifactcache/caches
13:50:19   | ::debug::Resource Url: http://172.17.0.2:34689/_apis/artifactcache/caches
13:50:19 ::debug::Saving Cache (ID: 2)
13:50:19   | ::debug::Saving Cache (ID: 2)
13:50:19 ::debug::Upload cache
13:50:19   | ::debug::Upload cache
13:50:19 ::debug::Resource Url: http://172.17.0.2:34689/_apis/artifactcache/caches/2
13:50:19   | ::debug::Resource Url: http://172.17.0.2:34689/_apis/artifactcache/caches/2
13:50:19 ::debug::Upload concurrency: 4
13:50:19   | ::debug::Upload concurrency: 4
13:50:19 ::debug::Upload chunk size: 33554432
13:50:19   | ::debug::Upload chunk size: 33554432
13:50:19 ::debug::Awaiting all uploads
13:50:19   | ::debug::Awaiting all uploads
13:50:19 ::debug::Uploading chunk of size 33554432 bytes at offset 0 with content range: bytes 0-33554431/*
13:50:19   | ::debug::Uploading chunk of size 33554432 bytes at offset 0 with content range: bytes 0-33554431/*
13:50:19 ::debug::Uploading chunk of size 31125047 bytes at offset 33554432 with content range: bytes 33554432-64679478/*
13:50:19   | ::debug::Uploading chunk of size 31125047 bytes at offset 33554432 with content range: bytes 33554432-64679478/*
13:50:19 ::debug::Commiting cache
13:50:19   | ::debug::Commiting cache
13:50:19   | Cache Size: ~62 MB (64679479 B)
13:50:19 ::debug::Resource Url: http://172.17.0.2:34689/_apis/artifactcache/caches/2
13:50:19   | ::debug::Resource Url: http://172.17.0.2:34689/_apis/artifactcache/caches/2
13:50:19   | Cache saved successfully
13:50:19   | Cache saved with the key: setup-rye-5-Linux-x86_64-rye-0.33.0-bda4ca0d6567ae4648f6c76c0c4db389288003120eb31da3949b5987f2bdde5b
13:50:19   | Restored /opt/hostedtoolcache/setup-rye-2024-03-04/0.33.0/x86_64/config.toml
13:50:19   ✅  Success - Post eifinger/setup-rye@v3

my1e5 avatar May 13 '24 12:05 my1e5

Thank you. I pushed a fix that will set cache-hit to true. I started out this action by copying the setup-python action which handles partial cache matches. That is not usable for rye. So we can ignore if Typescript thinks the matched key does not exactly match the desired key. What counts is that we have a desired key.

eifinger avatar May 13 '24 17:05 eifinger