Skip to content

Conversation

huydhn
Copy link
Contributor

@huydhn huydhn commented Jul 17, 2023

This refactors the logic in PyTorch https://github.com/pytorch/pytorch/blob/main/.github/actions/calculate-docker-image/action.yml to a shareable GHA. Notably, the changes include:

  • Accept a docker build directory input, i.e. .ci/docker, with a build.sh script entry. The usage is build.sh "${IMAGE_NAME}" -t "${DOCKER_IMAGE}" as how it's used in PyTorch atm
  • Accept a working directory input because Nova Linux job could checkout the repo in a different directory
  • Simplify the list of configurable options to only 2 always-rebuild and push (set to true to push the image to ECR)

One hidden caveat is that calculate-docker-image requires a full checkout to work as it tries to figure out the Docker tag of the base commit. This means that fetch-depth: 0 is needed to use this action.

This action can then be used in the upcoming CI change on Executorch where the repo could build and use its own Docker image(s).

Testing

@vercel
Copy link

vercel bot commented Jul 17, 2023

@huydhn is attempting to deploy a commit to the Meta Open Source Team on Vercel.

A member of the Team first needs to authorize it.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 17, 2023
@vercel
Copy link

vercel bot commented Jul 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
torchci ⬜️ Ignored (Inspect) Jul 18, 2023 8:45pm

@huydhn huydhn requested review from seemethere, a team and clee2000 July 18, 2023 02:26
@huydhn huydhn marked this pull request as ready for review July 18, 2023 02:26
@huydhn
Copy link
Contributor Author

huydhn commented Jul 18, 2023

These testing PRs show how this action is used across PyTorch and Executorch, both in docker-build workflow and shareable Linux jobs.

@huydhn huydhn changed the title Add shareable calculate-docker-image GHA [BE] Add shareable calculate-docker-image GHA Jul 18, 2023
@huydhn huydhn requested a review from osalpekar July 18, 2023 16:34
@huydhn huydhn merged commit 6c2fe3a into pytorch:main Jul 19, 2023
pytorchmergebot pushed a commit to pytorch/pytorch that referenced this pull request Jul 19, 2023
Switch from PyTorch `calculate-docker-image` GHA to its shareable version on test-infra pytorch/test-infra#4397.

I will clean up PyTorch `calculate-docker-image` GHA in a separate PR after landing this one.
Pull Request resolved: #105372
Approved by: https://github.com/malfet
pytorchmergebot pushed a commit to pytorch/pytorch that referenced this pull request Jul 24, 2023
As this has been replaced by the more generic calculate-docker-image on test-infra pytorch/test-infra#4397 in:

* pytorch/test-infra#4399
* and #105372
Pull Request resolved: #105752
Approved by: https://github.com/Skylion007
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants