Skip to content

Commit 7055164

Browse files
committed
workflow: use litte python image
1 parent ce26c9a commit 7055164

File tree

4 files changed

+65
-47
lines changed

4 files changed

+65
-47
lines changed

.github/workflows/docker-image-pull.yml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
jobs:
77
build:
88
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
architecture: [amd64, arm64]
12+
os: [linux]
13+
service: [runtime:0.1.0, ekgservice:0.1.0, ekgfrontend:0.1.0]
914

1015
steps:
1116
- name: Checkout code
@@ -21,9 +26,38 @@ jobs:
2126
run: |
2227
# 登录阿里云镜像仓库
2328
docker login --username=${{ secrets.ALIYUN_USERNAME }} --password=${{ secrets.ALIYUN_PASSWORD }} registry.cn-hangzhou.aliyuncs.com
29+
2430
# 使用Dockerfile构建镜像
25-
docker pull --platform linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0
26-
docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-amd
27-
# 推送镜像到镜像仓库
31+
docker pull --platform ${{ matrix.os }}/${{ matrix.architecture }} ghcr.io/codefuse-ai/runtime:0.1.0
32+
docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-${{ matrix.architecture }}
33+
docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-${{ matrix.architecture }}
34+
2835
docker pull --platform linux/arm64 ghcr.io/codefuse-ai/runtime:0.1.0
29-
docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm
36+
37+
docker pull --platform linux/amd64 ghcr.io/codefuse-ai/ekgservice:0.1.0
38+
docker pull --platform linux/arm64 ghcr.io/codefuse-ai/ekgservice:0.1.0
39+
40+
docker pull --platform linux/amd64 ghcr.io/codefuse-ai/ekgfrontend:0.1.0
41+
docker pull --platform linux/arm64 ghcr.io/codefuse-ai/ekgfrontend:0.1.0
42+
43+
# 推送镜像到镜像仓库
44+
## runtime-amd
45+
docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-amd
46+
docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-amd
47+
## runtime-arm
48+
docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm
49+
docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm
50+
51+
## runtime-amd
52+
docker tag linux/amd64 ghcr.io/codefuse-ai/ekgservice:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/ekgservice:0.1.0-amd
53+
docker push registry.cn-hangzhou.aliyuncs.com/muagent/ekgservice:0.1.0-amd
54+
## runtime-arm
55+
docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm
56+
docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm
57+
58+
## runtime-amd
59+
docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-amd
60+
docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-amd
61+
## runtime-arm
62+
docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm
63+
docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm

.github/workflows/docker-image.yml

Lines changed: 25 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ on:
66
jobs:
77
build:
88
runs-on: ubuntu-20.04 # 或者指定其他版本
9+
strategy:
10+
matrix:
11+
image:
12+
- name: runtime
13+
context: ./runtime
14+
dockerfile: ./runtime/Dockerfile.no-package
15+
tag: ghcr.io/codefuse-ai/runtime:0.1.0
16+
- name: ekgfrontend
17+
context: .
18+
dockerfile: ./Dockerfile_frontend
19+
tag: ghcr.io/codefuse-ai/ekgfrontend:0.1.0
20+
- name: ekgservice
21+
context: .
22+
dockerfile: ./Dockerfile_gh
23+
tag: ghcr.io/codefuse-ai/ekgservice:0.1.0
924

1025
steps:
1126
- name: Checkout code
@@ -24,56 +39,25 @@ jobs:
2439
username: ${{ github.actor }} # 使用当前 GitHub 用户名
2540
password: ${{ secrets.CR_TOKEN }} # 使用您刚刚添加的个人访问令牌
2641

27-
- name: show local dir
28-
run: |
29-
pwd
30-
ls -l
31-
ls -l ./runtime
32-
33-
# - name: Build and push
34-
# uses: docker/build-push-action@v2
35-
# with:
36-
# context: ./runtime
37-
# file: ./runtime/Dockerfile.no-package
38-
# push: true
39-
# tags: ghcr.io/lightislost/runtime:0.1.0
40-
# platforms: |
41-
# linux/amd64
42-
# linux/arm64
42+
- name: Check disk space
43+
run: df -h
4344

44-
# - name: Build and push
45-
# uses: docker/build-push-action@v2
46-
# with:
47-
# context: .
48-
# file: ./Dockerfile_frontend
49-
# push: true
50-
# tags: ghcr.io/lightislost/ekgfrontend:0.1.0
51-
# platforms: |
52-
# linux/amd64
53-
# linux/arm64
45+
- name: Clean up Docker
46+
run: docker system prune -af
5447

5548
- name: Check disk space
5649
run: df -h
57-
50+
5851
- name: Build and push
5952
uses: docker/build-push-action@v2
6053
with:
61-
context: .
62-
file: ./Dockerfile_gh
54+
context: ${{ matrix.image.context }}
55+
file: ${{ matrix.image.dockerfile }}
6356
push: true
64-
tags: ghcr.io/lightislost/ekgservice:0.1.0
57+
tags: ${{ matrix.image.tag }}
6558
platforms: |
6659
linux/amd64
6760
linux/arm64
6861
69-
70-
# - name: Build and push
71-
# uses: docker/build-push-action@v2
72-
# with:
73-
# context: .
74-
# file: ./Dockerfile_frontend
75-
# push: true
76-
# tags: ghcr.io/lightislost/ekgfrontend:latest
77-
# platforms: |
78-
# linux/amd64
79-
# linux/arm64
62+
- name: Check disk space
63+
run: df -h

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-bookworm
1+
FROM python:3.9-slim-bookworm
22

33
WORKDIR /home/user
44

Dockerfile_frontend

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From node:20.18.0-bookworm
1+
FROM node:20.18.0-bookworm
22

33
WORKDIR /home/user
44

0 commit comments

Comments
 (0)