From b8fb9f1510cae09448ce5f40e5a8d59cc39b2455 Mon Sep 17 00:00:00 2001 From: wyp311395 Date: Mon, 11 Nov 2024 18:51:56 +0800 Subject: [PATCH 01/15] feat: update workflow --- .github/workflows/docker-image.yml | 51 +++++++++++++++----- .github/workflows/test.yaml | 76 ------------------------------ Dockerfile_gh | 9 ++++ 3 files changed, 47 insertions(+), 89 deletions(-) delete mode 100644 .github/workflows/test.yaml create mode 100644 Dockerfile_gh diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 409aaed..8a3bc7d 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,13 +1,11 @@ -name: Docker Image CI +name: Docker Image CI Test + on: workflow_dispatch: # 允许手动触发工作流 jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - architecture: [amd64, arm64] steps: - name: Checkout code @@ -26,26 +24,53 @@ jobs: username: ${{ github.actor }} # 使用当前 GitHub 用户名 password: ${{ secrets.CR_TOKEN }} # 使用您刚刚添加的个人访问令牌 + - name: show local dir + run: | + pwd + ls -l + ls -l ./runtime + - name: Build and push uses: docker/build-push-action@v2 with: - context: . - file: ./Dockerfile_frontend + context: ./runtime + file: ./runtime/Dockerfile.no-package push: true - tags: ghcr.io/codefuse-ai/ekgfrontend:0.1.0 + tags: ghcr.io/lightislost/runtime:0.1.0 + platforms: | + linux/amd64 + linux/arm64 - name: Build and push uses: docker/build-push-action@v2 with: context: . - file: ./Dockerfile + file: ./Dockerfile_frontend push: true - tags: ghcr.io/codefuse-ai/ekgservice:0.1.0 - + tags: ghcr.io/lightislost/ekgfrontend:0.1.0 + platforms: | + linux/amd64 + linux/arm64 + - name: Build and push uses: docker/build-push-action@v2 with: - context: ./runtime - file: Dockerfile.no-package + context: . + file: ./Dockerfile_gh push: true - tags: ghcr.io/codefuse-ai/runtime:0.1.0 + tags: ghcr.io/lightislost/ekgservice:0.1.0 + platforms: | + linux/amd64 + linux/arm64 + + + # - name: Build and push + # uses: docker/build-push-action@v2 + # with: + # context: . + # file: ./Dockerfile_frontend + # push: true + # tags: ghcr.io/lightislost/ekgfrontend:latest + # platforms: | + # linux/amd64 + # linux/arm64 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index 0bd0582..0000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -1,76 +0,0 @@ -name: Docker Image CI Test - -on: - workflow_dispatch: # 允许手动触发工作流 - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Buildx - uses: docker/setup-buildx-action@v1 - - - name: Log in to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} # 使用当前 GitHub 用户名 - password: ${{ secrets.CR_TOKEN }} # 使用您刚刚添加的个人访问令牌 - - - name: show local dir - run: | - pwd - ls -l - ls -l ./runtime - - - name: Build and push - uses: docker/build-push-action@v2 - with: - context: ./runtime - file: ./runtime/Dockerfile.no-package - push: true - tags: ghcr.io/lightislost/runtime:0.1.0 - platforms: | - linux/amd64 - linux/arm64 - - - name: Build and push - uses: docker/build-push-action@v2 - with: - context: . - file: ./Dockerfile_frontend - push: true - tags: ghcr.io/lightislost/ekgfrontend:0.1.0 - platforms: | - linux/amd64 - linux/arm64 - - - name: Build and push - uses: docker/build-push-action@v2 - with: - context: . - file: ./Dockerfile - push: true - tags: ghcr.io/lightislost/ekgservice:0.1.0 - platforms: | - linux/amd64 - linux/arm64 - - - # - name: Build and push - # uses: docker/build-push-action@v2 - # with: - # context: . - # file: ./Dockerfile_frontend - # push: true - # tags: ghcr.io/lightislost/ekgfrontend:latest - # platforms: | - # linux/amd64 - # linux/arm64 diff --git a/Dockerfile_gh b/Dockerfile_gh new file mode 100644 index 0000000..3ec8241 --- /dev/null +++ b/Dockerfile_gh @@ -0,0 +1,9 @@ +FROM python:3.9-bookworm + +WORKDIR /home/user + +COPY ./requirements.txt /home/user/docker_requirements.txt + +RUN pip install -r /home/user/docker_requirements.txt --retries 5 --timeout 120 + +CMD ["bash"] \ No newline at end of file From ce26c9a0c4bb173a5d7845286cb1bc9a468610fc Mon Sep 17 00:00:00 2001 From: wyp311395 Date: Mon, 11 Nov 2024 19:16:26 +0800 Subject: [PATCH 02/15] workflow: add image_pull --- .github/workflows/docker-image-pull.yml | 29 +++++++++++++++ .github/workflows/docker-image.yml | 47 +++++++++++++------------ 2 files changed, 54 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/docker-image-pull.yml diff --git a/.github/workflows/docker-image-pull.yml b/.github/workflows/docker-image-pull.yml new file mode 100644 index 0000000..c77bb98 --- /dev/null +++ b/.github/workflows/docker-image-pull.yml @@ -0,0 +1,29 @@ +name: Docker Image CI Pull + +on: + workflow_dispatch: # 允许手动触发工作流 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Buildx + uses: docker/setup-buildx-action@v1 + + - name: Build the Docker image + run: | + # 登录阿里云镜像仓库 + docker login --username=${{ secrets.ALIYUN_USERNAME }} --password=${{ secrets.ALIYUN_PASSWORD }} registry.cn-hangzhou.aliyuncs.com + # 使用Dockerfile构建镜像 + docker pull --platform linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 + docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-amd + # 推送镜像到镜像仓库 + docker pull --platform linux/arm64 ghcr.io/codefuse-ai/runtime:0.1.0 + docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm \ No newline at end of file diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 8a3bc7d..9e67cce 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -5,7 +5,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 # 或者指定其他版本 steps: - name: Checkout code @@ -30,28 +30,31 @@ jobs: ls -l ls -l ./runtime - - name: Build and push - uses: docker/build-push-action@v2 - with: - context: ./runtime - file: ./runtime/Dockerfile.no-package - push: true - tags: ghcr.io/lightislost/runtime:0.1.0 - platforms: | - linux/amd64 - linux/arm64 + # - name: Build and push + # uses: docker/build-push-action@v2 + # with: + # context: ./runtime + # file: ./runtime/Dockerfile.no-package + # push: true + # tags: ghcr.io/lightislost/runtime:0.1.0 + # platforms: | + # linux/amd64 + # linux/arm64 - - name: Build and push - uses: docker/build-push-action@v2 - with: - context: . - file: ./Dockerfile_frontend - push: true - tags: ghcr.io/lightislost/ekgfrontend:0.1.0 - platforms: | - linux/amd64 - linux/arm64 - + # - name: Build and push + # uses: docker/build-push-action@v2 + # with: + # context: . + # file: ./Dockerfile_frontend + # push: true + # tags: ghcr.io/lightislost/ekgfrontend:0.1.0 + # platforms: | + # linux/amd64 + # linux/arm64 + + - name: Check disk space + run: df -h + - name: Build and push uses: docker/build-push-action@v2 with: From 70551644259af8126a68ff067cc0a2761ffffa43 Mon Sep 17 00:00:00 2001 From: wyp311395 Date: Mon, 11 Nov 2024 19:55:57 +0800 Subject: [PATCH 03/15] workflow: use litte python image --- .github/workflows/docker-image-pull.yml | 42 ++++++++++++++-- .github/workflows/docker-image.yml | 66 ++++++++++--------------- Dockerfile | 2 +- Dockerfile_frontend | 2 +- 4 files changed, 65 insertions(+), 47 deletions(-) diff --git a/.github/workflows/docker-image-pull.yml b/.github/workflows/docker-image-pull.yml index c77bb98..164cb37 100644 --- a/.github/workflows/docker-image-pull.yml +++ b/.github/workflows/docker-image-pull.yml @@ -6,6 +6,11 @@ on: jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + architecture: [amd64, arm64] + os: [linux] + service: [runtime:0.1.0, ekgservice:0.1.0, ekgfrontend:0.1.0] steps: - name: Checkout code @@ -21,9 +26,38 @@ jobs: run: | # 登录阿里云镜像仓库 docker login --username=${{ secrets.ALIYUN_USERNAME }} --password=${{ secrets.ALIYUN_PASSWORD }} registry.cn-hangzhou.aliyuncs.com + # 使用Dockerfile构建镜像 - docker pull --platform linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 - docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-amd - # 推送镜像到镜像仓库 + docker pull --platform ${{ matrix.os }}/${{ matrix.architecture }} ghcr.io/codefuse-ai/runtime:0.1.0 + docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-${{ matrix.architecture }} + docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-${{ matrix.architecture }} + docker pull --platform linux/arm64 ghcr.io/codefuse-ai/runtime:0.1.0 - docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm \ No newline at end of file + + docker pull --platform linux/amd64 ghcr.io/codefuse-ai/ekgservice:0.1.0 + docker pull --platform linux/arm64 ghcr.io/codefuse-ai/ekgservice:0.1.0 + + docker pull --platform linux/amd64 ghcr.io/codefuse-ai/ekgfrontend:0.1.0 + docker pull --platform linux/arm64 ghcr.io/codefuse-ai/ekgfrontend:0.1.0 + + # 推送镜像到镜像仓库 + ## runtime-amd + docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-amd + docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-amd + ## runtime-arm + docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm + docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm + + ## runtime-amd + docker tag linux/amd64 ghcr.io/codefuse-ai/ekgservice:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/ekgservice:0.1.0-amd + docker push registry.cn-hangzhou.aliyuncs.com/muagent/ekgservice:0.1.0-amd + ## runtime-arm + docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm + docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm + + ## runtime-amd + docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-amd + docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-amd + ## runtime-arm + docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm + docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm \ No newline at end of file diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 9e67cce..185b80c 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -6,6 +6,21 @@ on: jobs: build: runs-on: ubuntu-20.04 # 或者指定其他版本 + strategy: + matrix: + image: + - name: runtime + context: ./runtime + dockerfile: ./runtime/Dockerfile.no-package + tag: ghcr.io/codefuse-ai/runtime:0.1.0 + - name: ekgfrontend + context: . + dockerfile: ./Dockerfile_frontend + tag: ghcr.io/codefuse-ai/ekgfrontend:0.1.0 + - name: ekgservice + context: . + dockerfile: ./Dockerfile_gh + tag: ghcr.io/codefuse-ai/ekgservice:0.1.0 steps: - name: Checkout code @@ -24,56 +39,25 @@ jobs: username: ${{ github.actor }} # 使用当前 GitHub 用户名 password: ${{ secrets.CR_TOKEN }} # 使用您刚刚添加的个人访问令牌 - - name: show local dir - run: | - pwd - ls -l - ls -l ./runtime - - # - name: Build and push - # uses: docker/build-push-action@v2 - # with: - # context: ./runtime - # file: ./runtime/Dockerfile.no-package - # push: true - # tags: ghcr.io/lightislost/runtime:0.1.0 - # platforms: | - # linux/amd64 - # linux/arm64 + - name: Check disk space + run: df -h - # - name: Build and push - # uses: docker/build-push-action@v2 - # with: - # context: . - # file: ./Dockerfile_frontend - # push: true - # tags: ghcr.io/lightislost/ekgfrontend:0.1.0 - # platforms: | - # linux/amd64 - # linux/arm64 + - name: Clean up Docker + run: docker system prune -af - name: Check disk space run: df -h - + - name: Build and push uses: docker/build-push-action@v2 with: - context: . - file: ./Dockerfile_gh + context: ${{ matrix.image.context }} + file: ${{ matrix.image.dockerfile }} push: true - tags: ghcr.io/lightislost/ekgservice:0.1.0 + tags: ${{ matrix.image.tag }} platforms: | linux/amd64 linux/arm64 - - # - name: Build and push - # uses: docker/build-push-action@v2 - # with: - # context: . - # file: ./Dockerfile_frontend - # push: true - # tags: ghcr.io/lightislost/ekgfrontend:latest - # platforms: | - # linux/amd64 - # linux/arm64 + - name: Check disk space + run: df -h \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 2c2540b..100c46d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9-bookworm +FROM python:3.9-slim-bookworm WORKDIR /home/user diff --git a/Dockerfile_frontend b/Dockerfile_frontend index acb7a23..5753814 100644 --- a/Dockerfile_frontend +++ b/Dockerfile_frontend @@ -1,4 +1,4 @@ -From node:20.18.0-bookworm +FROM node:20.18.0-bookworm WORKDIR /home/user From c2d6e4b773192abc0fae08e3d18a4f492f77d5d0 Mon Sep 17 00:00:00 2001 From: wyp311395 Date: Mon, 11 Nov 2024 20:23:52 +0800 Subject: [PATCH 04/15] test: docker buildx --- .github/workflows/docker-image-pull.yml | 36 ++----------------- .github/workflows/docker-image.yml | 47 +++++++++++++++++++------ Dockerfile_gh | 2 +- 3 files changed, 41 insertions(+), 44 deletions(-) diff --git a/.github/workflows/docker-image-pull.yml b/.github/workflows/docker-image-pull.yml index 164cb37..e3146ce 100644 --- a/.github/workflows/docker-image-pull.yml +++ b/.github/workflows/docker-image-pull.yml @@ -28,36 +28,6 @@ jobs: docker login --username=${{ secrets.ALIYUN_USERNAME }} --password=${{ secrets.ALIYUN_PASSWORD }} registry.cn-hangzhou.aliyuncs.com # 使用Dockerfile构建镜像 - docker pull --platform ${{ matrix.os }}/${{ matrix.architecture }} ghcr.io/codefuse-ai/runtime:0.1.0 - docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-${{ matrix.architecture }} - docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-${{ matrix.architecture }} - - docker pull --platform linux/arm64 ghcr.io/codefuse-ai/runtime:0.1.0 - - docker pull --platform linux/amd64 ghcr.io/codefuse-ai/ekgservice:0.1.0 - docker pull --platform linux/arm64 ghcr.io/codefuse-ai/ekgservice:0.1.0 - - docker pull --platform linux/amd64 ghcr.io/codefuse-ai/ekgfrontend:0.1.0 - docker pull --platform linux/arm64 ghcr.io/codefuse-ai/ekgfrontend:0.1.0 - - # 推送镜像到镜像仓库 - ## runtime-amd - docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-amd - docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-amd - ## runtime-arm - docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm - docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm - - ## runtime-amd - docker tag linux/amd64 ghcr.io/codefuse-ai/ekgservice:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/ekgservice:0.1.0-amd - docker push registry.cn-hangzhou.aliyuncs.com/muagent/ekgservice:0.1.0-amd - ## runtime-arm - docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm - docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm - - ## runtime-amd - docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-amd - docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-amd - ## runtime-arm - docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm - docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm \ No newline at end of file + docker pull --platform ${{ matrix.os }}/${{ matrix.architecture }} ghcr.io/codefuse-ai/${{ matrix.service }} + docker tag ghcr.io/codefuse-ai/${{ matrix.service }} registry.cn-hangzhou.aliyuncs.com/muagent/${{ matrix.service }}-${{ matrix.architecture }} + docker push registry.cn-hangzhou.aliyuncs.com/muagent/${{ matrix.service }}-${{ matrix.architecture }} \ No newline at end of file diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 185b80c..a81fde3 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -48,16 +48,43 @@ jobs: - name: Check disk space run: df -h - - name: Build and push - uses: docker/build-push-action@v2 - with: - context: ${{ matrix.image.context }} - file: ${{ matrix.image.dockerfile }} - push: true - tags: ${{ matrix.image.tag }} - platforms: | - linux/amd64 - linux/arm64 + - name: docker image + run: | + docker images + docker pull --platform linux/amd64 python:3.9-slim-bookworm + docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 + + docker pull --platform linux/arm64 python:3.9-slim-bookworm + docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 + + docker buildx imagetools create -t ghcr.io/lightislost/python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 + + + # - name: Build and push + # uses: docker/build-push-action@v2 + # with: + # context: ${{ matrix.image.context }} + # file: ${{ matrix.image.dockerfile }} + # push: true + # tags: ${{ matrix.image.tag }}-amd64 + # platforms: linux/amd64 + + # - name: Build and push + # uses: docker/build-push-action@v2 + # with: + # context: ${{ matrix.image.context }} + # file: ${{ matrix.image.dockerfile }} + # push: true + # tags: ${{ matrix.image.tag }}-arm64 + # platforms: linux/arm64 + # # platforms: | + # # linux/amd64 + # # linux/arm64 + + # - name: docker image + # run: | + # docker images + # docker buildx imagetools create -t ${{ matrix.image.tag }} ${{ matrix.image.tag }}-arm64 ${{ matrix.image.tag }}-amd64 - name: Check disk space run: df -h \ No newline at end of file diff --git a/Dockerfile_gh b/Dockerfile_gh index 3ec8241..28e22d6 100644 --- a/Dockerfile_gh +++ b/Dockerfile_gh @@ -1,4 +1,4 @@ -FROM python:3.9-bookworm +FROM python:3.9-slim-bookworm WORKDIR /home/user From 3e091ac4665aec95d54a7e60ea0062331f5ddf46 Mon Sep 17 00:00:00 2001 From: wyp311395 Date: Mon, 11 Nov 2024 20:26:47 +0800 Subject: [PATCH 05/15] test: docker buildx2 --- .github/workflows/docker-image.yml | 41 ++++++++++++++++-------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index a81fde3..ff75816 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -6,21 +6,21 @@ on: jobs: build: runs-on: ubuntu-20.04 # 或者指定其他版本 - strategy: - matrix: - image: - - name: runtime - context: ./runtime - dockerfile: ./runtime/Dockerfile.no-package - tag: ghcr.io/codefuse-ai/runtime:0.1.0 - - name: ekgfrontend - context: . - dockerfile: ./Dockerfile_frontend - tag: ghcr.io/codefuse-ai/ekgfrontend:0.1.0 - - name: ekgservice - context: . - dockerfile: ./Dockerfile_gh - tag: ghcr.io/codefuse-ai/ekgservice:0.1.0 + # strategy: + # matrix: + # image: + # - name: runtime + # context: ./runtime + # dockerfile: ./runtime/Dockerfile.no-package + # tag: ghcr.io/codefuse-ai/runtime:0.1.0 + # - name: ekgfrontend + # context: . + # dockerfile: ./Dockerfile_frontend + # tag: ghcr.io/codefuse-ai/ekgfrontend:0.1.0 + # - name: ekgservice + # context: . + # dockerfile: ./Dockerfile_gh + # tag: ghcr.io/codefuse-ai/ekgservice:0.1.0 steps: - name: Checkout code @@ -51,14 +51,17 @@ jobs: - name: docker image run: | docker images - docker pull --platform linux/amd64 python:3.9-slim-bookworm - docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 - docker pull --platform linux/arm64 python:3.9-slim-bookworm docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 - docker buildx imagetools create -t ghcr.io/lightislost/python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 + - name: docker image + run: | + docker images + docker pull --platform linux/amd64 python:3.9-slim-bookworm + docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 + + docker buildx imagetools create -t ghcr.io/lightislost/python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 # - name: Build and push # uses: docker/build-push-action@v2 From 6c5dd8908d788ce445ba7b5a7a76a6b65ae1012d Mon Sep 17 00:00:00 2001 From: wyp311395 Date: Mon, 11 Nov 2024 20:28:57 +0800 Subject: [PATCH 06/15] test: docker buildx3 --- .github/workflows/docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index ff75816..2048c5e 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -53,14 +53,14 @@ jobs: docker images docker pull --platform linux/arm64 python:3.9-slim-bookworm docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 - + docker images - name: docker image run: | docker images docker pull --platform linux/amd64 python:3.9-slim-bookworm docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 - + docker images docker buildx imagetools create -t ghcr.io/lightislost/python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 # - name: Build and push From 5191f2da4e5cebff4c45a04b377b4a972511f783 Mon Sep 17 00:00:00 2001 From: wyp311395 Date: Mon, 11 Nov 2024 20:32:32 +0800 Subject: [PATCH 07/15] test: docker buildx4 --- .github/workflows/docker-image.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 2048c5e..5b708ad 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -53,13 +53,15 @@ jobs: docker images docker pull --platform linux/arm64 python:3.9-slim-bookworm docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 - docker images + docker rmi python:3.9-slim-bookworm + docker images - name: docker image run: | docker images docker pull --platform linux/amd64 python:3.9-slim-bookworm docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 + docker rmi python:3.9-slim-bookworm docker images docker buildx imagetools create -t ghcr.io/lightislost/python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 From 44215fd4f8a0e586a7682b9ca254d2b1303b5be6 Mon Sep 17 00:00:00 2001 From: wyp311395 Date: Mon, 11 Nov 2024 20:37:29 +0800 Subject: [PATCH 08/15] test: docker manifest --- .github/workflows/docker-image.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 5b708ad..57b583e 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -63,7 +63,8 @@ jobs: docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 docker rmi python:3.9-slim-bookworm docker images - docker buildx imagetools create -t ghcr.io/lightislost/python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 + docker manifest create ghcr.io/lightislost/python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 + docker manifest inspect ghcr.io/lightislost/python:3.9-slim-bookworm # - name: Build and push # uses: docker/build-push-action@v2 From 0acae633a0b4c8121c4c6bb64982cbd9c6d796d3 Mon Sep 17 00:00:00 2001 From: wyp311395 Date: Mon, 11 Nov 2024 20:46:31 +0800 Subject: [PATCH 09/15] test: docker manifest 1 --- .github/workflows/docker-image.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 57b583e..2ac5100 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -54,6 +54,7 @@ jobs: docker pull --platform linux/arm64 python:3.9-slim-bookworm docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 docker rmi python:3.9-slim-bookworm + docker push ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 docker images - name: docker image @@ -62,6 +63,7 @@ jobs: docker pull --platform linux/amd64 python:3.9-slim-bookworm docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 docker rmi python:3.9-slim-bookworm + docker push ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 docker images docker manifest create ghcr.io/lightislost/python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 docker manifest inspect ghcr.io/lightislost/python:3.9-slim-bookworm From 77477a3bd76c256d6d297e6f119b810d05770caf Mon Sep 17 00:00:00 2001 From: wyp311395 Date: Mon, 11 Nov 2024 20:50:02 +0800 Subject: [PATCH 10/15] test: docker manifest 2 --- .github/workflows/docker-image.yml | 115 +++++++++++++++-------------- 1 file changed, 60 insertions(+), 55 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 2ac5100..0af2f77 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -6,21 +6,21 @@ on: jobs: build: runs-on: ubuntu-20.04 # 或者指定其他版本 - # strategy: - # matrix: - # image: - # - name: runtime - # context: ./runtime - # dockerfile: ./runtime/Dockerfile.no-package - # tag: ghcr.io/codefuse-ai/runtime:0.1.0 - # - name: ekgfrontend - # context: . - # dockerfile: ./Dockerfile_frontend - # tag: ghcr.io/codefuse-ai/ekgfrontend:0.1.0 - # - name: ekgservice - # context: . - # dockerfile: ./Dockerfile_gh - # tag: ghcr.io/codefuse-ai/ekgservice:0.1.0 + strategy: + matrix: + image: + - name: runtime + context: ./runtime + dockerfile: ./runtime/Dockerfile.no-package + tag: ghcr.io/codefuse-ai/runtime:0.1.0 + - name: ekgfrontend + context: . + dockerfile: ./Dockerfile_frontend + tag: ghcr.io/codefuse-ai/ekgfrontend:0.1.0 + - name: ekgservice + context: . + dockerfile: ./Dockerfile_gh + tag: ghcr.io/codefuse-ai/ekgservice:0.1.0 steps: - name: Checkout code @@ -42,57 +42,62 @@ jobs: - name: Check disk space run: df -h - - name: Clean up Docker - run: docker system prune -af + # - name: docker image + # run: | + # docker images + # docker pull --platform linux/arm64 python:3.9-slim-bookworm + # docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 + # docker rmi python:3.9-slim-bookworm + # docker push ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 + # docker images - - name: Check disk space - run: df -h + # - name: docker image + # run: | + # docker images + # docker pull --platform linux/amd64 python:3.9-slim-bookworm + # docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 + # docker rmi python:3.9-slim-bookworm + # docker push ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 + # docker images + # docker manifest create ghcr.io/lightislost/python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 + # docker manifest inspect ghcr.io/lightislost/python:3.9-slim-bookworm + + - name: Build and push adm64 + uses: docker/build-push-action@v2 + with: + context: ${{ matrix.image.context }} + file: ${{ matrix.image.dockerfile }} + push: true + tags: ${{ matrix.image.tag }}-amd64 + platforms: linux/amd64 - name: docker image run: | docker images - docker pull --platform linux/arm64 python:3.9-slim-bookworm - docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 - docker rmi python:3.9-slim-bookworm - docker push ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 - docker images + docker rmi ${{ matrix.image.tag }}-amd64 + docker images + + - name: Build and push amr64 + uses: docker/build-push-action@v2 + with: + context: ${{ matrix.image.context }} + file: ${{ matrix.image.dockerfile }} + push: true + tags: ${{ matrix.image.tag }}-arm64 + platforms: linux/arm64 + - name: docker image run: | docker images - docker pull --platform linux/amd64 python:3.9-slim-bookworm - docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 - docker rmi python:3.9-slim-bookworm - docker push ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 + docker rmi ${{ matrix.image.tag }}-arm64 docker images - docker manifest create ghcr.io/lightislost/python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 - docker manifest inspect ghcr.io/lightislost/python:3.9-slim-bookworm - # - name: Build and push - # uses: docker/build-push-action@v2 - # with: - # context: ${{ matrix.image.context }} - # file: ${{ matrix.image.dockerfile }} - # push: true - # tags: ${{ matrix.image.tag }}-amd64 - # platforms: linux/amd64 - - # - name: Build and push - # uses: docker/build-push-action@v2 - # with: - # context: ${{ matrix.image.context }} - # file: ${{ matrix.image.dockerfile }} - # push: true - # tags: ${{ matrix.image.tag }}-arm64 - # platforms: linux/arm64 - # # platforms: | - # # linux/amd64 - # # linux/arm64 - - # - name: docker image - # run: | - # docker images - # docker buildx imagetools create -t ${{ matrix.image.tag }} ${{ matrix.image.tag }}-arm64 ${{ matrix.image.tag }}-amd64 + - name: docker image + run: | + docker images + docker manifest create ${{ matrix.image.tag }} ${{ matrix.image.tag }}-arm64 ${{ matrix.image.tag }}-amd64 + docker manifest inspect ${{ matrix.image.tag }} - name: Check disk space run: df -h \ No newline at end of file From c1f8f8cafc14f24227d55d6f5361190544144d82 Mon Sep 17 00:00:00 2001 From: wyp311395 Date: Mon, 11 Nov 2024 21:10:44 +0800 Subject: [PATCH 11/15] test: docker manifest 3 --- .github/workflows/docker-image.yml | 82 +++++++++++++++++++++++------- 1 file changed, 64 insertions(+), 18 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 0af2f77..fe4b58d 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,4 +1,4 @@ -name: Docker Image CI Test +name: Docker Image CI on: workflow_dispatch: # 允许手动触发工作流 @@ -62,31 +62,76 @@ jobs: # docker manifest create ghcr.io/lightislost/python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 # docker manifest inspect ghcr.io/lightislost/python:3.9-slim-bookworm - - name: Build and push adm64 - uses: docker/build-push-action@v2 - with: - context: ${{ matrix.image.context }} - file: ${{ matrix.image.dockerfile }} - push: true - tags: ${{ matrix.image.tag }}-amd64 - platforms: linux/amd64 + # - name: Build and push adm64 + # uses: docker/build-push-action@v2 + # with: + # context: ${{ matrix.image.context }} + # file: ${{ matrix.image.dockerfile }} + # push: true + # tags: ${{ matrix.image.tag }}-amd64 + # platforms: linux/amd64 + + - name: Build and push with retry for amd64 + run: | + max_retries=3 + count=0 + success=false + while [[ $count -lt $max_retries ]]; do + echo "Attempt $(($count + 1)) of $max_retries..." + docker buildx build --push \ + --platform linux/amd64 \ + --tag ${{ matrix.image.tag }}-amd64 \ + -f ${{ matrix.image.dockerfile }} ${{ matrix.image.context }} && success=true && break + + count=$(($count + 1)) + echo "Build failed, retrying in 5 seconds..." + sleep 5 + done + + if [ "$success" = false ]; then + echo "Build failed after $max_retries attempts." + exit 1 + fi + 3 - name: docker image run: | docker images docker rmi ${{ matrix.image.tag }}-amd64 docker images + # - name: Build and push amr64 + # uses: docker/build-push-action@v2 + # with: + # context: ${{ matrix.image.context }} + # file: ${{ matrix.image.dockerfile }} + # push: true + # tags: ${{ matrix.image.tag }}-arm64 + # platforms: linux/arm64 + + - name: Build and push with retry for arm64 + run: | + max_retries=3 + count=0 + success=false + + while [[ $count -lt $max_retries ]]; do + echo "Attempt $(($count + 1)) of $max_retries..." + docker buildx build --push \ + --platform linux/arm64 \ + --tag ${{ matrix.image.tag }}-arm64 \ + -f ${{ matrix.image.dockerfile }} ${{ matrix.image.context }} && success=true && break + + count=$(($count + 1)) + echo "Build failed, retrying in 5 seconds..." + sleep 5 + done + + if [ "$success" = false ]; then + echo "Build failed after $max_retries attempts." + exit 1 + fi - - name: Build and push amr64 - uses: docker/build-push-action@v2 - with: - context: ${{ matrix.image.context }} - file: ${{ matrix.image.dockerfile }} - push: true - tags: ${{ matrix.image.tag }}-arm64 - platforms: linux/arm64 - - name: docker image run: | docker images @@ -98,6 +143,7 @@ jobs: docker images docker manifest create ${{ matrix.image.tag }} ${{ matrix.image.tag }}-arm64 ${{ matrix.image.tag }}-amd64 docker manifest inspect ${{ matrix.image.tag }} + docker manifest push ${{ matrix.image.tag }} - name: Check disk space run: df -h \ No newline at end of file From 9c6de6cadb9eae7f417be820c9e17ba86cf6a71b Mon Sep 17 00:00:00 2001 From: wyp311395 Date: Tue, 12 Nov 2024 10:19:26 +0800 Subject: [PATCH 12/15] bugifx: error command --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index fe4b58d..081e11a 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -93,7 +93,7 @@ jobs: echo "Build failed after $max_retries attempts." exit 1 fi - 3 + - name: docker image run: | docker images From de516b29dcca719c26c307959d587a4442d91808 Mon Sep 17 00:00:00 2001 From: wyp311395 Date: Tue, 12 Nov 2024 10:32:08 +0800 Subject: [PATCH 13/15] test: docker manifest 4 --- .github/workflows/docker-image.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 081e11a..e5d82ea 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -96,8 +96,7 @@ jobs: - name: docker image run: | - docker images - docker rmi ${{ matrix.image.tag }}-amd64 + df -h docker images # - name: Build and push amr64 @@ -134,8 +133,7 @@ jobs: - name: docker image run: | - docker images - docker rmi ${{ matrix.image.tag }}-arm64 + df -h docker images - name: docker image From 406dd2b533744e737be1fb527ddf0d9eece3c133 Mon Sep 17 00:00:00 2001 From: wyp311395 Date: Tue, 12 Nov 2024 10:54:06 +0800 Subject: [PATCH 14/15] test: docker manifest 4 --- .github/workflows/docker-image.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index e5d82ea..2fb84e0 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -39,9 +39,6 @@ jobs: username: ${{ github.actor }} # 使用当前 GitHub 用户名 password: ${{ secrets.CR_TOKEN }} # 使用您刚刚添加的个人访问令牌 - - name: Check disk space - run: df -h - # - name: docker image # run: | # docker images @@ -73,20 +70,20 @@ jobs: - name: Build and push with retry for amd64 run: | - max_retries=3 + max_retries=5 count=0 success=false while [[ $count -lt $max_retries ]]; do echo "Attempt $(($count + 1)) of $max_retries..." - docker buildx build --push \ + docker build --push \ --platform linux/amd64 \ --tag ${{ matrix.image.tag }}-amd64 \ -f ${{ matrix.image.dockerfile }} ${{ matrix.image.context }} && success=true && break count=$(($count + 1)) echo "Build failed, retrying in 5 seconds..." - sleep 5 + sleep 15 done if [ "$success" = false ]; then @@ -94,7 +91,7 @@ jobs: exit 1 fi - - name: docker image + - name: docker image for amd64 run: | df -h docker images @@ -110,20 +107,20 @@ jobs: - name: Build and push with retry for arm64 run: | - max_retries=3 + max_retries=5 count=0 success=false while [[ $count -lt $max_retries ]]; do echo "Attempt $(($count + 1)) of $max_retries..." - docker buildx build --push \ + docker build --push \ --platform linux/arm64 \ --tag ${{ matrix.image.tag }}-arm64 \ -f ${{ matrix.image.dockerfile }} ${{ matrix.image.context }} && success=true && break count=$(($count + 1)) echo "Build failed, retrying in 5 seconds..." - sleep 5 + sleep 15 done if [ "$success" = false ]; then @@ -131,14 +128,16 @@ jobs: exit 1 fi - - name: docker image + - name: docker image for arm64 run: | df -h docker images - - name: docker image + - name: docker manifest run: | docker images + docker manifest inspect ${{ matrix.image.tag }}-arm64 + docker manifest inspect ${{ matrix.image.tag }}-amd64 docker manifest create ${{ matrix.image.tag }} ${{ matrix.image.tag }}-arm64 ${{ matrix.image.tag }}-amd64 docker manifest inspect ${{ matrix.image.tag }} docker manifest push ${{ matrix.image.tag }} From 7bb5516fd3af7c8ae8357a6d786623dda37e7819 Mon Sep 17 00:00:00 2001 From: wyp311395 Date: Tue, 12 Nov 2024 11:14:28 +0800 Subject: [PATCH 15/15] feat: add latest tag --- .github/workflows/docker-image.yml | 90 ++++++++++++++++-------------- 1 file changed, 49 insertions(+), 41 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 2fb84e0..7049c57 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -13,14 +13,17 @@ jobs: context: ./runtime dockerfile: ./runtime/Dockerfile.no-package tag: ghcr.io/codefuse-ai/runtime:0.1.0 + tag_latest: ghcr.io/codefuse-ai/runtime:latest - name: ekgfrontend context: . dockerfile: ./Dockerfile_frontend tag: ghcr.io/codefuse-ai/ekgfrontend:0.1.0 + tag_latest: ghcr.io/codefuse-ai/ekgfrontend:latest - name: ekgservice context: . dockerfile: ./Dockerfile_gh tag: ghcr.io/codefuse-ai/ekgservice:0.1.0 + tag_latest: ghcr.io/codefuse-ai/ekgservice:latest steps: - name: Checkout code @@ -39,35 +42,6 @@ jobs: username: ${{ github.actor }} # 使用当前 GitHub 用户名 password: ${{ secrets.CR_TOKEN }} # 使用您刚刚添加的个人访问令牌 - # - name: docker image - # run: | - # docker images - # docker pull --platform linux/arm64 python:3.9-slim-bookworm - # docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 - # docker rmi python:3.9-slim-bookworm - # docker push ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 - # docker images - - # - name: docker image - # run: | - # docker images - # docker pull --platform linux/amd64 python:3.9-slim-bookworm - # docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 - # docker rmi python:3.9-slim-bookworm - # docker push ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 - # docker images - # docker manifest create ghcr.io/lightislost/python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 - # docker manifest inspect ghcr.io/lightislost/python:3.9-slim-bookworm - - # - name: Build and push adm64 - # uses: docker/build-push-action@v2 - # with: - # context: ${{ matrix.image.context }} - # file: ${{ matrix.image.dockerfile }} - # push: true - # tags: ${{ matrix.image.tag }}-amd64 - # platforms: linux/amd64 - - name: Build and push with retry for amd64 run: | max_retries=5 @@ -79,6 +53,7 @@ jobs: docker build --push \ --platform linux/amd64 \ --tag ${{ matrix.image.tag }}-amd64 \ + --tag ${{ matrix.image.tag_latest }}-amd64 \ -f ${{ matrix.image.dockerfile }} ${{ matrix.image.context }} && success=true && break count=$(($count + 1)) @@ -95,15 +70,10 @@ jobs: run: | df -h docker images - - # - name: Build and push amr64 - # uses: docker/build-push-action@v2 - # with: - # context: ${{ matrix.image.context }} - # file: ${{ matrix.image.dockerfile }} - # push: true - # tags: ${{ matrix.image.tag }}-arm64 - # platforms: linux/arm64 + docker rmi ${{ matrix.image.tag }}-amd64 + docker rmi ${{ matrix.image.tag_latest }}-amd64 + df -h + docker images - name: Build and push with retry for arm64 run: | @@ -116,6 +86,7 @@ jobs: docker build --push \ --platform linux/arm64 \ --tag ${{ matrix.image.tag }}-arm64 \ + --tag ${{ matrix.image.tag_latest }}-arm64 \ -f ${{ matrix.image.dockerfile }} ${{ matrix.image.context }} && success=true && break count=$(($count + 1)) @@ -132,15 +103,52 @@ jobs: run: | df -h docker images + docker rmi ${{ matrix.image.tag }}-arm64 + docker rmi ${{ matrix.image.tag_latest }}-arm64 + df -h + docker images - name: docker manifest run: | docker images - docker manifest inspect ${{ matrix.image.tag }}-arm64 - docker manifest inspect ${{ matrix.image.tag }}-amd64 + docker manifest create ${{ matrix.image.tag }} ${{ matrix.image.tag }}-arm64 ${{ matrix.image.tag }}-amd64 + docker manifest create ${{ matrix.image.tag_latest }} ${{ matrix.image.tag_latest }}-arm64 ${{ matrix.image.tag_latest }}-amd64 + docker manifest inspect ${{ matrix.image.tag }} + docker manifest inspect ${{ matrix.image.tag_latest }} + docker manifest push ${{ matrix.image.tag }} + docker manifest push ${{ matrix.image.tag_latest }} - name: Check disk space - run: df -h \ No newline at end of file + run: df -h + + # - name: docker image + # run: | + # docker images + # docker pull --platform linux/arm64 python:3.9-slim-bookworm + # docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 + # docker rmi python:3.9-slim-bookworm + # docker push ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 + # docker images + + # - name: docker image + # run: | + # docker images + # docker pull --platform linux/amd64 python:3.9-slim-bookworm + # docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 + # docker rmi python:3.9-slim-bookworm + # docker push ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 + # docker images + # docker manifest create ghcr.io/lightislost/python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 ghcr.io/lightislost/python:3.9-slim-bookworm-amd64 + # docker manifest inspect ghcr.io/lightislost/python:3.9-slim-bookworm + + # - name: Build and push adm64 + # uses: docker/build-push-action@v2 + # with: + # context: ${{ matrix.image.context }} + # file: ${{ matrix.image.dockerfile }} + # push: true + # tags: ${{ matrix.image.tag }}-amd64 + # platforms: linux/amd64 \ No newline at end of file