Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add caching #428

Open
dudicoco opened this issue May 10, 2023 · 4 comments
Open

Add caching #428

dudicoco opened this issue May 10, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@dudicoco
Copy link

Rather than downloading all binaries on every run it would be more efficient and faster if the action would cache the aqua binary and all of the packages binaries.

https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows
https://github.com/actions/cache

@suzuki-shunsuke suzuki-shunsuke added the enhancement New feature or request label May 10, 2023
@suzuki-shunsuke
Copy link
Member

aqua-installer doesn't support caching, but you can cache binaries using actions/cache.

e.g.

- uses: actions/cache@v3.3.1
  with:
    path: ~/.local/share/aquaproj-aqua
    key: v1-aqua-installer-${{runner.os}}-${{runner.arch}}-${{hashFiles('aqua.yaml')}}
    restore-keys: |
      v1-aqua-installer-${{runner.os}}-${{runner.arch}}-
- uses: aquaproj/aqua-installer@v2.1.1
  with:
    aqua_version: v2.6.0

Please fix parameters properly.

e.g.

- uses: actions/cache@v3.3.1
  with:
    path: ~/.local/share/aquaproj-aqua
    key: v1-aqua-installer-${{runner.os}}-${{runner.arch}}-${{hashFiles('.aqua/*.yaml')}} # Change key
    restore-keys: |
      v1-aqua-installer-${{runner.os}}-${{runner.arch}}-

It's a bit difficult to run actions/cache in aqua-installer because it is a bit difficult to decide parameters.

@suzuki-shunsuke
Copy link
Member

Note that by default aqua-installer runs aqua with -l option so packages that aren't run in the workflow aren't cached.
If you want to cache all packages, please set aqua_opts to unset -l option.

- uses: aquaproj/aqua-installer@v2.1.1
  with:
    aqua_version: v2.6.0
    aqua_opts: "" # Unset `-l` option

But note that if -l isn't set, aqua installs packages that aren't run in the workflow uselessly.

So caching of aqua-installer is more complicated than you expect.

@suzuki-shunsuke
Copy link
Member

@dudicoco
Copy link
Author

Thanks @suzuki-shunsuke.

Perhaps the action could just cache the aqua binary by default then? The parameters for that could be static.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants