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

Fix dependency caching in Docker image build #49

Closed
zsusswein opened this issue Sep 27, 2024 · 2 comments · Fixed by #54
Closed

Fix dependency caching in Docker image build #49

zsusswein opened this issue Sep 27, 2024 · 2 comments · Fixed by #54
Labels
bug Something isn't working CI/CD

Comments

@zsusswein
Copy link
Collaborator

zsusswein commented Sep 27, 2024

In #41, I add a dependency on the tidybayes package. This is causing the Docker image build to fail because the dependency can't be found.

I think this is an issue with the cache hit? The dependency is successfully updated in the package manifest, so the base "dependency" image should have been refreshed.

As a separate but related question, should this action be running in the PR? Is the idea to have the PR image also in ACR and linked to a pool for testing? Or for running tests in GHA in the built image? If I'm reading this action correctly, it's updating "latest" in ACR off this in-development PR which is perhaps not what we want?

@jkislin -- can you take a look at this?

@zsusswein zsusswein added the bug Something isn't working label Sep 27, 2024
@gvegayon
Copy link
Member

gvegayon commented Oct 2, 2024

For reference (may not be the solution, but still adding it): we could have workflows calling each other. A caller workflow (e.g., R CMD check) could explicitly call the Dockerimage builder workflow. Here is a link with information about it https://docs.github.com/en/actions/sharing-automations/reusing-workflows#creating-a-reusable-workflow.

@gvegayon
Copy link
Member

gvegayon commented Oct 2, 2024

OK, the resuable workflows are fancy, but too much for this time. We are doing the following (after talking to @zsusswein):

  1. Merge workflow 1 into workflow 2.
  2. Remove the path condition for triggering the workflow 1 (this is actually solved by step 1).
  3. Use the Pr number as the single tag for the image. The tag will change to latest only on merge to main.

I'm branching off main to work on this solution.

@gvegayon gvegayon linked a pull request Oct 2, 2024 that will close this issue
@zsusswein zsusswein added the CI/CD label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CI/CD
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants