Skip to content

Commit fff75f9

Browse files
committed
update: code review
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
1 parent 8fabb89 commit fff75f9

File tree

4 files changed

+23
-13
lines changed

4 files changed

+23
-13
lines changed

.github/actions/docker-build-and-push/action.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,37 @@ runs:
2828
uses: docker/setup-buildx-action@v3
2929

3030
- name: Login to GitHub Container Registry
31-
run: echo "${{ inputs.github-token }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
31+
run: echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin
3232
shell: bash
33+
env:
34+
GITHUB_TOKEN: ${{ inputs.github-token }}
3335

3436
- name: Print image info
3537
run: |
36-
echo "Image name: ${{ inputs.image-name }}"
37-
echo "Tag: ${{ inputs.tag }}"
38-
echo "Registry: ${{ inputs.registry }}"
38+
echo "Image name: ${IMAGE_NAME}"
39+
echo "Tag: ${TAG}"
40+
echo "Registry: ${REGISTRY}"
3941
shell: bash
42+
env:
43+
IMAGE_NAME: ${{ inputs.image-name }}
44+
TAG: ${{ inputs.tag }}
45+
REGISTRY: ${{ inputs.registry }}
4046

4147
- name: Build image and push
4248
run: |
4349
DOCKERFILE_ARG=""
44-
if [ -n "${{ inputs.dockerfile }}" ]; then
45-
DOCKERFILE_ARG="-f ${{ inputs.dockerfile }}"
50+
if [ -n "${DOCKERFILE}" ]; then
51+
DOCKERFILE_ARG="-f ${DOCKERFILE}"
4652
fi
4753
docker buildx build \
4854
--platform linux/amd64 \
4955
${DOCKERFILE_ARG} \
50-
-t ${{ inputs.registry }}/${{ inputs.image-name }}:${{ inputs.tag }} \
51-
--push ${{ inputs.context }}
56+
-t "${REGISTRY}/${IMAGE_NAME}:${TAG}" \
57+
--push "${CONTEXT}"
5258
shell: bash
59+
env:
60+
DOCKERFILE: ${{ inputs.dockerfile }}
61+
REGISTRY: ${{ inputs.registry }}
62+
IMAGE_NAME: ${{ inputs.image-name }}
63+
TAG: ${{ inputs.tag }}
64+
CONTEXT: ${{ inputs.context }}

.github/workflows/ci-release-uds-tokenizer.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: actions/checkout@v6
1717

1818
- name: Set up Docker Buildx
19-
uses: docker/setup-buildx-action@v4
19+
uses: docker/setup-buildx-action@v3
2020

2121
- name: Login to GitHub Container Registry
2222
if: github.event_name == 'push'
@@ -30,7 +30,7 @@ jobs:
3030
SHA="${{ github.sha }}"
3131
SHORT_SHA="${SHA:0:7}"
3232
echo "tag=${SHORT_SHA}" >> "$GITHUB_OUTPUT"
33-
echo "image=ghcr.io/llm-d/llm-d-uds-tokenizer:${SHORT_SHA}" >> "$GITHUB_OUTPUT"
33+
echo "image=ghcr.io/${{ github.repository_owner }}/llm-d-uds-tokenizer:${SHORT_SHA}" >> "$GITHUB_OUTPUT"
3434
else
3535
echo "tag=pr-${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
3636
echo "image=llm-d-uds-tokenizer:pr-${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"

services/uds_tokenizer/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ FROM --platform=$TARGETPLATFORM python:3.10-slim as builder
1717

1818
# Set build arguments
1919
ARG TARGETPLATFORM
20-
ARG BUILDPLATFORM
2120

2221
# Set working directory
2322
WORKDIR /app
@@ -32,7 +31,7 @@ FROM --platform=$TARGETPLATFORM python:3.10-slim
3231
# Set working directory
3332
WORKDIR /app
3433

35-
RUN apt-get update && apt-get upgrade -y && rm -rf /var/cache/apt/
34+
RUN apt-get update && apt-get upgrade -y && apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/*
3635

3736
# Copy installed dependencies from build stage
3837
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages

services/uds_tokenizer/Dockerfile.konflux

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ FROM --platform=$TARGETPLATFORM registry.access.redhat.com/ubi9/python-312:9.7 a
1717

1818
# Set build arguments
1919
ARG TARGETPLATFORM
20-
ARG BUILDPLATFORM
2120

2221
# Set working directory
2322
WORKDIR /app

0 commit comments

Comments
 (0)