Skip to content

Use shareable calculate-docker-image GHA#105372

Closed
huydhn wants to merge 13 commits intopytorch:mainfrom
huydhn:shareable-gha-calculate-docker-image
Closed

Use shareable calculate-docker-image GHA#105372
huydhn wants to merge 13 commits intopytorch:mainfrom
huydhn:shareable-gha-calculate-docker-image

Conversation

@huydhn
Copy link
Contributor

@huydhn huydhn commented Jul 17, 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.

@pytorch-bot
Copy link

pytorch-bot bot commented Jul 17, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/105372

Note: Links to docs will display an error until the docs builds have been completed.

✅ 1 Unrelated Failure

As of commit 5532210:

UNSTABLE - The following job failed but was likely due to flakiness present on trunk and has been marked as unstable:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Jul 17, 2023
@huydhn huydhn requested a review from seemethere July 18, 2023 16:30
@huydhn huydhn marked this pull request as ready for review July 18, 2023 16:30
@huydhn huydhn requested review from a team and jeffdaily as code owners July 18, 2023 16:30
@huydhn huydhn marked this pull request as draft July 18, 2023 20:16
huydhn added a commit to pytorch/test-infra that referenced this pull request Jul 19, 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

* Use the GHA on Nova Linux job
#4399
* Use the GHA on PyTorch pytorch/pytorch#105372
* Executorch
  * Publish Docker image: pytorch/executorch#11
* Use Docker image in Linux job:
pytorch/executorch#12
@huydhn huydhn marked this pull request as ready for review July 19, 2023 01:02
@huydhn huydhn added the ciflow/trunk Trigger trunk jobs on your pull request label Jul 19, 2023
@malfet
Copy link
Contributor

malfet commented Jul 19, 2023

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@malfet
Copy link
Contributor

malfet commented Jul 19, 2023

@pytorchbot merge -f "Don't want to wait for ROCM"

@pytorchmergebot
Copy link
Collaborator

The merge job was canceled. If you believe this is a mistake,then you can re trigger it through pytorch-bot.

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

huydhn added a commit to pytorch/test-infra that referenced this pull request Jul 20, 2023
Add a step in Linux job to calculate and build Docker image if needed.
This is similar to how PyTorch CI rebuilds its Docker images atm.

### Testing

pytorch/pytorch#105372, PyTorch Lint job uses
Linux jobs.
pytorchmergebot pushed a commit 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

ciflow/trunk Trigger trunk jobs on your pull request Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants