generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 527
chore: add composite action for container pull and cleanup #5487
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9b712d2
chore: add composite action for container pull
sirutBuasai 1b01eb4
chore: use composite for docker pull
sirutBuasai ca1e03d
chore: remove -it
sirutBuasai 6c9e47a
chore: fix names
sirutBuasai 7a529d8
chore: add cleanup
sirutBuasai f89ef36
Merge branch 'chore' of https://github.com/aws/deep-learning-containe…
sirutBuasai 148e639
chore: fix cleanup
sirutBuasai 0ef7d18
Merge branch 'main' into chore
sirutBuasai 9c5e60b
add -it
sirutBuasai b40aeec
cleanup use env
sirutBuasai 016e81e
update action
sirutBuasai 9d03e82
test vllm
sirutBuasai 50a0fbf
change hf token name
sirutBuasai 3c99deb
change cache refresh
sirutBuasai f653b0f
revert vllm uri
sirutBuasai 95547bc
revert docker
sirutBuasai 4d51e77
use ecr authenticate
sirutBuasai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| name: Container Cleanup | ||
| description: Remove container and clean up image caches. | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Cleanup container and images | ||
| shell: bash | ||
| run: | | ||
| docker rm -f ${CONTAINER_ID} || true | ||
| docker image prune -a --force --filter "until=24h" | ||
| docker system df | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: Container Pull | ||
| description: Login to ECR, get image URI from current workflow artifacts, then pull the image onto host runner. | ||
|
|
||
| inputs: | ||
| aws_region: | ||
| description: AWS Region for docker image repository | ||
| required: true | ||
| aws_account_id: | ||
| description: AWS Account ID for docker image registry | ||
| required: true | ||
| artifact_name: | ||
| description: Docker image URI that is built and saved as artifact within workflows | ||
| required: true | ||
| type: string | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
|
|
||
| - name: ECR login | ||
| shell: bash | ||
| run: | | ||
| aws ecr get-login-password --region ${{ inputs.aws_region }} | docker login --username AWS --password-stdin ${{ inputs.aws_account_id }}.dkr.ecr.${{ inputs.aws_region }}.amazonaws.com | ||
|
|
||
| - name: Download image URI artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: ${{ inputs.artifact_name }} | ||
|
|
||
| - name: Resolve image URI for test | ||
| shell: bash | ||
| run: | | ||
| IMAGE_URI=$(cat image_uri.txt) | ||
sirutBuasai marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| echo "Resolved image URI: $IMAGE_URI" | ||
| echo "IMAGE_URI=$IMAGE_URI" >> $GITHUB_ENV | ||
|
|
||
| - name: Pull image | ||
| shell: bash | ||
| run: | | ||
| docker pull $IMAGE_URI | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.