|
| 1 | +name: Sync vLLM Image |
| 2 | +run-name: Sync vLLM Image ${{ inputs.imageVersion }} |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + imageVersion: |
| 8 | + description: "Source and Docker Hub image tag" |
| 9 | + default: "v0.32.0-optimized-for-ds-4.1-flash" |
| 10 | + required: true |
| 11 | + type: string |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + |
| 16 | +concurrency: |
| 17 | + group: vllm-release |
| 18 | + cancel-in-progress: false |
| 19 | + |
| 20 | +env: |
| 21 | + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" |
| 22 | + SOURCE_IMAGE: swr.cn-south-1.myhuaweicloud.com/vllm/vllm/vllm-openai |
| 23 | + IMAGE_NAME: 1panel/vllm |
| 24 | + |
| 25 | +jobs: |
| 26 | + docker: |
| 27 | + runs-on: ubuntu-24.04 |
| 28 | + steps: |
| 29 | + - name: Install Skopeo |
| 30 | + run: | |
| 31 | + sudo apt-get update |
| 32 | + sudo apt-get install -y --no-install-recommends skopeo |
| 33 | +
|
| 34 | + - name: Login to Docker Hub |
| 35 | + uses: docker/login-action@v4 |
| 36 | + with: |
| 37 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 38 | + password: ${{ secrets.DOCKERHUB_PASSWORD }} |
| 39 | + |
| 40 | + - name: Copy amd64 image to Docker Hub |
| 41 | + shell: bash |
| 42 | + env: |
| 43 | + IMAGE_VERSION: ${{ inputs.imageVersion }} |
| 44 | + run: | |
| 45 | + set -euo pipefail |
| 46 | +
|
| 47 | + if [[ ! "${IMAGE_VERSION}" =~ ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}$ ]]; then |
| 48 | + echo "::error::Invalid image tag: ${IMAGE_VERSION}" |
| 49 | + exit 1 |
| 50 | + fi |
| 51 | +
|
| 52 | + source="docker://${SOURCE_IMAGE}:${IMAGE_VERSION}" |
| 53 | + destination="docker://${IMAGE_NAME}:${IMAGE_VERSION}" |
| 54 | + platform="$(skopeo --override-os linux --override-arch amd64 inspect \ |
| 55 | + --no-tags --format '{{.Os}}/{{.Architecture}}' "${source}")" |
| 56 | + if [ "${platform}" != "linux/amd64" ]; then |
| 57 | + echo "::error::Expected linux/amd64, got ${platform}" |
| 58 | + exit 1 |
| 59 | + fi |
| 60 | +
|
| 61 | + skopeo --override-os linux --override-arch amd64 copy \ |
| 62 | + --preserve-digests \ |
| 63 | + --dest-authfile "${HOME}/.docker/config.json" \ |
| 64 | + "${source}" "${destination}" |
| 65 | +
|
| 66 | + skopeo inspect --no-tags \ |
| 67 | + --authfile "${HOME}/.docker/config.json" \ |
| 68 | + "${destination}" |
0 commit comments