Skip to content

Commit 7bf8dd8

Browse files
committed
ci: reduce image size
Signed-off-by: thxCode <thxcode0824@gmail.com>
1 parent 960332b commit 7bf8dd8

5 files changed

Lines changed: 196 additions & 259 deletions

File tree

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*.tfstate.*
1919
*.tfvars
2020
*.tfvars.*
21+
*.local.json
2122

2223
# Dirs
2324
/.idea

.github/workflows/ci.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,6 @@ jobs:
8585
include: ${{ fromJson(needs.expand-matrix.outputs.matrix) }}
8686
runs-on: ${{ matrix.runner }}
8787
steps:
88-
- name: Maximize Docker Build Space
89-
uses: gpustack/.github/.github/actions/maximize-docker-build-space@main
90-
with:
91-
deep-clean: true
92-
root-reserve-mb: 20480
9388
- name: Prepare Env
9489
env:
9590
INPUT_REPOSITORY_OWNER: ${{ github.repository_owner }}
@@ -128,14 +123,26 @@ jobs:
128123
uses: actions/cache@v4
129124
with:
130125
path: |-
131-
${{ github.workspace }}/.cache
126+
${{ github.workspace }}/.cache/go-build
127+
${{ github.workspace }}/.cache/go-mod
132128
${{ github.workspace }}/.sbin
133129
key: ci-${{ matrix.platform }}-${{ hashFiles('go.sum') }}
134130
- name: Restore BuildX Cache
135131
uses: reproducible-containers/buildkit-cache-dance@v3
136132
with:
137133
builder: ${{ steps.setup-buildx.outputs.name }}
138-
cache-dir: ${{ github.workspace }}/.cache
134+
cache-map: |-
135+
{
136+
"${{ github.workspace }}/.cache/go-build": {
137+
"target": "/root/.cache/go-build"
138+
},
139+
"${{ github.workspace }}/.cache/go-mod": {
140+
"target": "/go/pkg/mod"
141+
},
142+
"${{ github.workspace }}/.sbin": {
143+
"target": "/usr/local/go/src/gpustack.ai/gpustack/.sbin"
144+
}
145+
}
139146
dockerfile: ${{ github.workspace }}/pack/${{ env.INPUT_REPOSITORY }}/Dockerfile
140147
skip-extraction: ${{ steps.setup-buildx-cache.outputs.cache-hit }}
141148
- name: Login DockerHub

.github/workflows/pack.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ jobs:
6565
include: ${{ fromJson(needs.expand-matrix.outputs.matrix) }}
6666
runs-on: ${{ matrix.runner }}
6767
steps:
68-
- name: Maximize Docker Build Space
69-
uses: gpustack/.github/.github/actions/maximize-docker-build-space@main
70-
with:
71-
deep-clean: true
72-
root-reserve-mb: 20480
7368
- name: Prepare Env
7469
env:
7570
INPUT_REPOSITORY_OWNER: ${{ github.repository_owner }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ go.work.*
2020
*.tfstate.*
2121
*.tfvars
2222
*.tfvars.*
23+
*.local.json
2324

2425
# Dirs
2526
/.idea

0 commit comments

Comments
 (0)