From a0f8affd795665283150d7dd61a04bb2db89c12a Mon Sep 17 00:00:00 2001 From: "hanzhi.421" Date: Tue, 2 Sep 2025 19:37:08 +0800 Subject: [PATCH 01/10] chore: mirror registry workflow --- .github/Dockerfile | 6 +++ .github/workflows/mirror-to-registry.yaml | 48 +++++++++++++++++++++++ .gitignore | 5 ++- 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .github/Dockerfile create mode 100644 .github/workflows/mirror-to-registry.yaml diff --git a/.github/Dockerfile b/.github/Dockerfile new file mode 100644 index 00000000..ff51c394 --- /dev/null +++ b/.github/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3.12-slim + +# # Install git and install veadk-python via git +RUN apt-get update && apt-get install -y git && \ + pip3 install --no-cache-dir git+https://github.com/volcengine/veadk-python.git && \ + apt-get clean && rm -rf /var/lib/apt/lists/* diff --git a/.github/workflows/mirror-to-registry.yaml b/.github/workflows/mirror-to-registry.yaml new file mode 100644 index 00000000..84cfdb2d --- /dev/null +++ b/.github/workflows/mirror-to-registry.yaml @@ -0,0 +1,48 @@ +name: Mirror to Registry + +on: + push: + branches: [ main ] + workflow_dispatch: + +jobs: + build-and-push: + runs-on: ubuntu-latest + # This job is executed only when the repository is the main repository. + if: github.repository == 'zakahan/veadk-python' + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Volcengine Container Registry + uses: docker/login-action@v3 + with: + registry: test-veadk-cn-beijing.cr.volces.com + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: test-veadk-cn-beijing.cr.volces.com/veadk/veadk-python312 + tags: | + type=sha,format=short + type=ref,event=branch + latest + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: .github/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file diff --git a/.gitignore b/.gitignore index a311a991..9ac92e7b 100644 --- a/.gitignore +++ b/.gitignore @@ -185,4 +185,7 @@ cython_debug/ **/node_modules/ # 忽略所有 .temp 目录 -**/.temp/ \ No newline at end of file +**/.temp/ + +# secrets +.secrets \ No newline at end of file From 2ae6add3e022477e6ad9dd039068dc5744d9cc1c Mon Sep 17 00:00:00 2001 From: "hanzhi.421" Date: Tue, 2 Sep 2025 19:53:29 +0800 Subject: [PATCH 02/10] test: test slim mirror only --- .github/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/Dockerfile b/.github/Dockerfile index ff51c394..207c5253 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -1,6 +1,6 @@ FROM python:3.12-slim # # Install git and install veadk-python via git -RUN apt-get update && apt-get install -y git && \ - pip3 install --no-cache-dir git+https://github.com/volcengine/veadk-python.git && \ - apt-get clean && rm -rf /var/lib/apt/lists/* +# RUN apt-get update && apt-get install -y git && \ +# pip3 install --no-cache-dir git+https://github.com/volcengine/veadk-python.git && \ +# apt-get clean && rm -rf /var/lib/apt/lists/* From a69c8ff491c9e92af4fa7334bdadd79c50717f94 Mon Sep 17 00:00:00 2001 From: "hanzhi.421" Date: Tue, 2 Sep 2025 20:48:14 +0800 Subject: [PATCH 03/10] test: test workflow with python312 --- .github/Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/Dockerfile b/.github/Dockerfile index 207c5253..5828a7ec 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -1,6 +1,6 @@ -FROM python:3.12-slim +FROM python:3.12 -# # Install git and install veadk-python via git -# RUN apt-get update && apt-get install -y git && \ -# pip3 install --no-cache-dir git+https://github.com/volcengine/veadk-python.git && \ -# apt-get clean && rm -rf /var/lib/apt/lists/* +# Install git and install veadk-python via git +RUN apt-get install -y git && \ + pip3 install --no-cache-dir git+https://github.com/volcengine/veadk-python.git && \ + apt-get clean && rm -rf /var/lib/apt/lists/* From 31f50bdf20e04d332ddd86701a6bbb7a1c011d43 Mon Sep 17 00:00:00 2001 From: "hanzhi.421" Date: Wed, 3 Sep 2025 09:57:26 +0800 Subject: [PATCH 04/10] fix: repository to volcengine --- .github/workflows/mirror-to-registry.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mirror-to-registry.yaml b/.github/workflows/mirror-to-registry.yaml index 84cfdb2d..3e5d02b8 100644 --- a/.github/workflows/mirror-to-registry.yaml +++ b/.github/workflows/mirror-to-registry.yaml @@ -9,7 +9,7 @@ jobs: build-and-push: runs-on: ubuntu-latest # This job is executed only when the repository is the main repository. - if: github.repository == 'zakahan/veadk-python' + if: github.repository == 'volcengine/veadk-python' steps: - name: Checkout code uses: actions/checkout@v4 From 970997982f0e1671fbb6ad9e92965069101b803b Mon Sep 17 00:00:00 2001 From: "hanzhi.421" Date: Wed, 3 Sep 2025 10:12:39 +0800 Subject: [PATCH 05/10] fix ignore --- .gitignore | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 9ac92e7b..a311a991 100644 --- a/.gitignore +++ b/.gitignore @@ -185,7 +185,4 @@ cython_debug/ **/node_modules/ # 忽略所有 .temp 目录 -**/.temp/ - -# secrets -.secrets \ No newline at end of file +**/.temp/ \ No newline at end of file From 91cb76ebfce755b5357bd8a6b9b2b661f32c2a88 Mon Sep 17 00:00:00 2001 From: "hanzhi.421" Date: Wed, 3 Sep 2025 10:18:06 +0800 Subject: [PATCH 06/10] rename: lastest image to ark cr --- .../{mirror-to-registry.yaml => lastest-image-to-ark-cr.yaml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{mirror-to-registry.yaml => lastest-image-to-ark-cr.yaml} (96%) diff --git a/.github/workflows/mirror-to-registry.yaml b/.github/workflows/lastest-image-to-ark-cr.yaml similarity index 96% rename from .github/workflows/mirror-to-registry.yaml rename to .github/workflows/lastest-image-to-ark-cr.yaml index 3e5d02b8..729bfa3a 100644 --- a/.github/workflows/mirror-to-registry.yaml +++ b/.github/workflows/lastest-image-to-ark-cr.yaml @@ -1,4 +1,4 @@ -name: Mirror to Registry +name: Push Lastest Image to ARK Registry on: push: From 2f61bffeb9ea86d86c0edd7904aa1e2ff1825543 Mon Sep 17 00:00:00 2001 From: "hanzhi.421" Date: Wed, 3 Sep 2025 11:52:56 +0800 Subject: [PATCH 07/10] fix: registry latest and preview --- .github/Dockerfile | 6 -- .github/Dockerfile.latest | 20 ++++++ .github/Dockerfile.preview | 20 ++++++ .github/workflows/latest-image-to-ark-cr.yaml | 64 +++++++++++++++++++ ...k-cr.yaml => preview-image-to-ark-cr.yaml} | 26 ++++++-- 5 files changed, 123 insertions(+), 13 deletions(-) delete mode 100644 .github/Dockerfile create mode 100644 .github/Dockerfile.latest create mode 100644 .github/Dockerfile.preview create mode 100644 .github/workflows/latest-image-to-ark-cr.yaml rename .github/workflows/{lastest-image-to-ark-cr.yaml => preview-image-to-ark-cr.yaml} (58%) diff --git a/.github/Dockerfile b/.github/Dockerfile deleted file mode 100644 index 5828a7ec..00000000 --- a/.github/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM python:3.12 - -# Install git and install veadk-python via git -RUN apt-get install -y git && \ - pip3 install --no-cache-dir git+https://github.com/volcengine/veadk-python.git && \ - apt-get clean && rm -rf /var/lib/apt/lists/* diff --git a/.github/Dockerfile.latest b/.github/Dockerfile.latest new file mode 100644 index 00000000..1a717e83 --- /dev/null +++ b/.github/Dockerfile.latest @@ -0,0 +1,20 @@ +# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM python:3.12 + +# Install git and install veadk-python via git +RUN apt-get install -y git && \ + pip3 install --no-cache-dir git+https://github.com/volcengine/veadk-python.git && \ + apt-get clean && rm -rf /var/lib/apt/lists/* diff --git a/.github/Dockerfile.preview b/.github/Dockerfile.preview new file mode 100644 index 00000000..1a717e83 --- /dev/null +++ b/.github/Dockerfile.preview @@ -0,0 +1,20 @@ +# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM python:3.12 + +# Install git and install veadk-python via git +RUN apt-get install -y git && \ + pip3 install --no-cache-dir git+https://github.com/volcengine/veadk-python.git && \ + apt-get clean && rm -rf /var/lib/apt/lists/* diff --git a/.github/workflows/latest-image-to-ark-cr.yaml b/.github/workflows/latest-image-to-ark-cr.yaml new file mode 100644 index 00000000..ecb89918 --- /dev/null +++ b/.github/workflows/latest-image-to-ark-cr.yaml @@ -0,0 +1,64 @@ +# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Push Lastest Image to ARK Registry + +on: + push: + # Trigger only when pushing tags + tags: + - '*' + workflow_dispatch: + +jobs: + build-and-push: + runs-on: ubuntu-latest + # This job is executed only when the repository is the main repository. + if: github.repository == 'zakahan/veadk-python' + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Volcengine Container Registry + uses: docker/login-action@v3 + with: + registry: test-veadk-cn-beijing.cr.volces.com + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: test-veadk-cn-beijing.cr.volces.com/veadk/veadk-python + tags: | + latest + type=ref,event=tag + + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: .github/Dockerfile.latest + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file diff --git a/.github/workflows/lastest-image-to-ark-cr.yaml b/.github/workflows/preview-image-to-ark-cr.yaml similarity index 58% rename from .github/workflows/lastest-image-to-ark-cr.yaml rename to .github/workflows/preview-image-to-ark-cr.yaml index 729bfa3a..e5402379 100644 --- a/.github/workflows/lastest-image-to-ark-cr.yaml +++ b/.github/workflows/preview-image-to-ark-cr.yaml @@ -1,4 +1,18 @@ -name: Push Lastest Image to ARK Registry +# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Push Preview Image to ARK Registry on: push: @@ -9,7 +23,7 @@ jobs: build-and-push: runs-on: ubuntu-latest # This job is executed only when the repository is the main repository. - if: github.repository == 'volcengine/veadk-python' + if: github.repository == 'zakahan/veadk-python' steps: - name: Checkout code uses: actions/checkout@v4 @@ -30,17 +44,15 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: test-veadk-cn-beijing.cr.volces.com/veadk/veadk-python312 + images: test-veadk-cn-beijing.cr.volces.com/veadk/veadk-python tags: | - type=sha,format=short - type=ref,event=branch - latest + preview - name: Build and push uses: docker/build-push-action@v5 with: context: . - file: .github/Dockerfile + file: .github/Dockerfile.preview push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From 9411cd12a2a83123acae917b3691c1022861f7f3 Mon Sep 17 00:00:00 2001 From: "hanzhi.421" Date: Wed, 3 Sep 2025 11:53:55 +0800 Subject: [PATCH 08/10] fix: repo volcengine --- .github/workflows/latest-image-to-ark-cr.yaml | 2 +- .github/workflows/preview-image-to-ark-cr.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/latest-image-to-ark-cr.yaml b/.github/workflows/latest-image-to-ark-cr.yaml index ecb89918..cccee730 100644 --- a/.github/workflows/latest-image-to-ark-cr.yaml +++ b/.github/workflows/latest-image-to-ark-cr.yaml @@ -25,7 +25,7 @@ jobs: build-and-push: runs-on: ubuntu-latest # This job is executed only when the repository is the main repository. - if: github.repository == 'zakahan/veadk-python' + if: github.repository == 'volcengine/veadk-python' steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/preview-image-to-ark-cr.yaml b/.github/workflows/preview-image-to-ark-cr.yaml index e5402379..fffe0bf1 100644 --- a/.github/workflows/preview-image-to-ark-cr.yaml +++ b/.github/workflows/preview-image-to-ark-cr.yaml @@ -23,7 +23,7 @@ jobs: build-and-push: runs-on: ubuntu-latest # This job is executed only when the repository is the main repository. - if: github.repository == 'zakahan/veadk-python' + if: github.repository == 'volcengine/veadk-python' steps: - name: Checkout code uses: actions/checkout@v4 From 99408ac848ec03a7ffff8ed39b19d43d306f43f3 Mon Sep 17 00:00:00 2001 From: "hanzhi.421" Date: Wed, 3 Sep 2025 15:17:31 +0800 Subject: [PATCH 09/10] fix: latest --- .github/workflows/latest-image-to-ark-cr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/latest-image-to-ark-cr.yaml b/.github/workflows/latest-image-to-ark-cr.yaml index cccee730..c0d02008 100644 --- a/.github/workflows/latest-image-to-ark-cr.yaml +++ b/.github/workflows/latest-image-to-ark-cr.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: Push Lastest Image to ARK Registry +name: Push Latest Image to ARK Registry on: push: From 1f5254b3055f1e8b47aa5ebbac259ba3bd77c1eb Mon Sep 17 00:00:00 2001 From: "hanzhi.421" Date: Wed, 3 Sep 2025 15:40:39 +0800 Subject: [PATCH 10/10] fix: secrets param --- .github/workflows/latest-image-to-ark-cr.yaml | 8 ++++---- .github/workflows/preview-image-to-ark-cr.yaml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/latest-image-to-ark-cr.yaml b/.github/workflows/latest-image-to-ark-cr.yaml index c0d02008..b7f41792 100644 --- a/.github/workflows/latest-image-to-ark-cr.yaml +++ b/.github/workflows/latest-image-to-ark-cr.yaml @@ -38,15 +38,15 @@ jobs: - name: Login to Volcengine Container Registry uses: docker/login-action@v3 with: - registry: test-veadk-cn-beijing.cr.volces.com - username: ${{ secrets.REGISTRY_USERNAME }} - password: ${{ secrets.REGISTRY_PASSWORD }} + registry: veadk-cn-beijing.cr.volces.com + username: ${{ secrets.ARK_CR_USERNAME }} + password: ${{ secrets.ARK_CR_PASSWORD }} - name: Extract metadata id: meta uses: docker/metadata-action@v5 with: - images: test-veadk-cn-beijing.cr.volces.com/veadk/veadk-python + images: veadk-cn-beijing.cr.volces.com/veadk/veadk-python tags: | latest type=ref,event=tag diff --git a/.github/workflows/preview-image-to-ark-cr.yaml b/.github/workflows/preview-image-to-ark-cr.yaml index fffe0bf1..206f68b7 100644 --- a/.github/workflows/preview-image-to-ark-cr.yaml +++ b/.github/workflows/preview-image-to-ark-cr.yaml @@ -36,15 +36,15 @@ jobs: - name: Login to Volcengine Container Registry uses: docker/login-action@v3 with: - registry: test-veadk-cn-beijing.cr.volces.com - username: ${{ secrets.REGISTRY_USERNAME }} - password: ${{ secrets.REGISTRY_PASSWORD }} + registry: veadk-cn-beijing.cr.volces.com + username: ${{ secrets.ARK_CR_USERNAME }} + password: ${{ secrets.ARK_CR_PASSWORD }} - name: Extract metadata id: meta uses: docker/metadata-action@v5 with: - images: test-veadk-cn-beijing.cr.volces.com/veadk/veadk-python + images: veadk-cn-beijing.cr.volces.com/veadk/veadk-python tags: | preview