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

cache conflict? #55

Open
gotson opened this issue Aug 23, 2021 · 6 comments · May be fixed by #56 or #100
Open

cache conflict? #55

gotson opened this issue Aug 23, 2021 · 6 comments · May be fixed by #56 or #100

Comments

@gotson
Copy link

gotson commented Aug 23, 2021

Hi, it seems the name of the container generated after install steps for caching is ghcr.io/<github_user>/<github_repo>/run-on-arch-<github_user>-<github_repo>-<workflow_name>-<arch>-<distro>.

I am trying to build different images for the same arch/distro, for instance i am using a different version of the JDK inside the image.

My understanding is that all 3 jobs will try to push/pull the same container, which will probably generate conflict.

Can you confirm if that's the case, and if yes, is there something we can do about it?

@gotson gotson linked a pull request Aug 23, 2021 that will close this issue
@gotson
Copy link
Author

gotson commented Aug 23, 2021

@giggio
Copy link

giggio commented Mar 6, 2022

I'm having the same problem. It does not fail but the cache is invalidated and rebuilt because of different node versions coming from the matrix.
Example: https://github.com/giggio/node-chromedriver/runs/5439981596?check_suite_focus=true

@martin-g
Copy link
Contributor

I experience the same problem: https://github.com/apache/avro/blob/a6c82ac6f4d316e769059adab39a9b39b5ea9f8c/.github/workflows/test-arm64.yml

My workflow has several jobs which run the action in their steps. Since all jobs share the same Docker image they invalidate the image for each other.

martin-g added a commit to martin-g/run-on-arch-action that referenced this issue Oct 25, 2022
@martin-g
Copy link
Contributor

I have worked around this issue by overwriting GITHUB_WORKFLOW env var: apache/avro@c635b9a

giggio added a commit to giggio/node-chromedriver that referenced this issue Oct 25, 2022
giggio added a commit to giggio/node-chromedriver that referenced this issue Oct 25, 2022
@giggio
Copy link

giggio commented Oct 25, 2022

I have worked around this issue by overwriting GITHUB_WORKFLOW env var: apache/avro@c635b9a

@martin-g this worked! I am using a matrix, so I had to use matrix values when setting GITHUB_WORKFLOW. Thanks for the tip!
giggio/node-chromedriver@8255bb5

@Grub4K
Copy link

Grub4K commented Feb 22, 2023

On the contrary I would like to use the same cache for different workflows. Instead of overwriting GITHUB_WORKFLOW I would want to allow specifying the full container name:

diff --git a/src/run-on-arch.js b/src/run-on-arch.js
index aeca1b2..ab4362c 100644
--- a/src/run-on-arch.js
+++ b/src/run-on-arch.js
@@ -100,7 +100,7 @@ async function main() {
   }
 
   // Generate a container name slug unique to this workflow
-  const containerName = slug([
+  const containerName = slug(core.getInput('containerName') || [
     'run-on-arch', env.GITHUB_REPOSITORY, env.GITHUB_WORKFLOW,
     arch, distro,
   ].join('-'));

That way more complex usecases could always specify the exact name they want to use and less complex ones can use the default. This solution should go well with #100 and allow a lot more flexibility.

felfert added a commit to felfert/run-on-arch-action that referenced this issue May 1, 2023
…tainer-name

Fixes uraimo#55 - Use both the workflow and job names in the container name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants