Skip to content

Commit e38c86e

Browse files
committed
use composite action
Signed-off-by: sirutBuasai <sirutbuasai27@outlook.com>
1 parent 7569bb0 commit e38c86e

File tree

3 files changed

+64
-18
lines changed

3 files changed

+64
-18
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Container Pull
2+
description: Login to ECR, get image URI from current workflow artifacts, then pull the image onto host runner.
3+
4+
inputs:
5+
aws_region:
6+
required: true
7+
default: ${{ secrets.AWS_REGION }}
8+
aws_account_id:
9+
required: true
10+
default: ${{ secrets.AWS_ACCOUNT_ID }}
11+
artifact_name:
12+
description: Docker image URI that is built and saved as artifact within workflows
13+
required: true
14+
type: string
15+
16+
runs:
17+
using: composite
18+
steps:
19+
20+
- name: ECR login
21+
run: |
22+
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
23+
24+
- name: Download image URI artifact
25+
uses: actions/download-artifact@v4
26+
with:
27+
name: ${{ inputs.artifact_name }}
28+
29+
- name: Resolve image URI for test
30+
run: |
31+
IMAGE_URI=$(cat image_uri.txt)
32+
echo "Resolved image URI: $IMAGE_URI"
33+
echo "IMAGE_URI=$IMAGE_URI" >> $GITHUB_ENV
34+
35+
- name: Pull image
36+
run: |
37+
docker pull $IMAGE_URI

.github/actions/pr-permission-gate/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
name: PR Permission Gate
22
description: Fails the workflow if the PR sender lacks the required repository permission
3+
34
inputs:
45
required-level:
56
description: Minimum permission level required (read|triage|write|maintain|admin)
67
default: write
8+
79
runs:
8-
using: "composite"
10+
using: composite
911
steps:
1012
- name: Check PR sender permission
1113
uses: actions/github-script@v7

.github/workflows/pr-sglang.yml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,29 @@ jobs:
8787
- name: Checkout DLC source
8888
uses: actions/checkout@v5
8989

90-
- name: ECR login
91-
run: |
92-
aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username AWS --password-stdin ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com
93-
94-
- name: Download image URI artifact
95-
uses: actions/download-artifact@v4
90+
- name: Container pull
91+
uses: ./.github/actions/container-pull
9692
with:
97-
name: sglang-sagemaker-image-uri
98-
99-
- name: Resolve image URI for test
100-
run: |
101-
IMAGE_URI=$(cat image_uri.txt)
102-
echo "Resolved image URI: $IMAGE_URI"
103-
echo "IMAGE_URI=$IMAGE_URI" >> $GITHUB_ENV
104-
105-
- name: Pull image
106-
run: |
107-
docker pull $IMAGE_URI
93+
artifact_name: sglang-sagemaker-image-uri
94+
95+
# - name: ECR login
96+
# run: |
97+
# aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username AWS --password-stdin ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com
98+
#
99+
# - name: Download image URI artifact
100+
# uses: actions/download-artifact@v4
101+
# with:
102+
# name: sglang-sagemaker-image-uri
103+
#
104+
# - name: Resolve image URI for test
105+
# run: |
106+
# IMAGE_URI=$(cat image_uri.txt)
107+
# echo "Resolved image URI: $IMAGE_URI"
108+
# echo "IMAGE_URI=$IMAGE_URI" >> $GITHUB_ENV
109+
#
110+
# - name: Pull image
111+
# run: |
112+
# docker pull $IMAGE_URI
108113

109114
- name: Checkout SGLang Tests
110115
uses: actions/checkout@v5
@@ -138,6 +143,8 @@ jobs:
138143
-e HF_TOKEN=${{ secrets.HUGGING_FACE_HUB_TOKEN }} \
139144
${IMAGE_URI})
140145
echo "CONTAINER_ID=$CONTAINER_ID" >> $GITHUB_ENV
146+
echo "Printing container startup logs ..."
147+
docker logs ${CONTAINER_ID}
141148
142149
- name: Setup for SGLang Test
143150
run: |

0 commit comments

Comments
 (0)