fix(docker): 移除 go 模块的 cache mount 加速构建(hxtesting 上 buildkit cache mount 文件系统 IO 极慢导致 go mod download 超时);ci: 构建跳过 anydoc(Rust 工具链需外网)
deploy-hxtesting / build-and-deploy (push) Failing after 1m45s
deploy-hxtesting / build-and-deploy (push) Failing after 1m45s
This commit is contained in:
1 parent
d03e024d59
commit
5f491edff4
2 files changed
+8
-8
No files matched your search
@@ -30,8 +30,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
cd "$DEPLOY_DIR"
|
cd "$DEPLOY_DIR"
|
||||||
bash scripts/build_images.sh -p
|
# WITH_ANYDOC=0:跳过 anydoc 解析引擎(Rust 工具链需外网,hxtesting 不可达;
|
||||||
bash scripts/build_images.sh -f
|
# 文档解析由 docreader 容器承担,测试环境不受影响)
|
||||||
|
WITH_ANYDOC=0 bash scripts/build_images.sh -p
|
||||||
|
WITH_ANYDOC=0 bash scripts/build_images.sh -f
|
||||||
docker tag wechatopenai/weknora-app:latest wechatopenai/weknora-app:sha-${GIT_SHA}
|
docker tag wechatopenai/weknora-app:latest wechatopenai/weknora-app:sha-${GIT_SHA}
|
||||||
docker tag wechatopenai/weknora-ui:latest wechatopenai/weknora-ui:sha-${GIT_SHA}
|
docker tag wechatopenai/weknora-ui:latest wechatopenai/weknora-ui:sha-${GIT_SHA}
|
||||||
docker image prune -f --filter "until=168h" >/dev/null
|
docker image prune -f --filter "until=168h" >/dev/null
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ RUN go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate
|
|||||||
# so that module's go.mod must exist before `go mod download`.
|
# so that module's go.mod must exist before `go mod download`.
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
COPY third_party/anydoc-go/go.mod third_party/anydoc-go/go.mod
|
COPY third_party/anydoc-go/go.mod third_party/anydoc-go/go.mod
|
||||||
RUN --mount=type=cache,target=/go/pkg/mod go mod download
|
RUN go mod download
|
||||||
COPY cmd/download cmd/download
|
COPY cmd/download cmd/download
|
||||||
# DuckDB extensions (spatial/excel): prefer a local seed tarball exported from
|
# DuckDB extensions (spatial/excel): prefer a local seed tarball exported from
|
||||||
# a previously built image (artifacts/duckdb_extensions/seed.tar) —
|
# a previously built image (artifacts/duckdb_extensions/seed.tar) —
|
||||||
@@ -69,7 +69,7 @@ RUN if [ -s /tmp/duckdb-seed.tar ]; then \
|
|||||||
go run cmd/download/duckdb/duckdb.go; \
|
go run cmd/download/duckdb/duckdb.go; \
|
||||||
fi
|
fi
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN --mount=type=cache,target=/go/pkg/mod bash ./scripts/copy-licenses.sh /license-bundle
|
RUN bash ./scripts/copy-licenses.sh /license-bundle
|
||||||
|
|
||||||
# Get version and commit info for build injection
|
# Get version and commit info for build injection
|
||||||
ARG VERSION_ARG
|
ARG VERSION_ARG
|
||||||
@@ -119,14 +119,12 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
|||||||
# the layer (~2.7 GB), which occupies disk locally and is uploaded to the CI
|
# the layer (~2.7 GB), which occupies disk locally and is uploaded to the CI
|
||||||
# layer cache. Mounted, the cache lives outside the layer and repeated builds
|
# layer cache. Mounted, the cache lives outside the layer and repeated builds
|
||||||
# reuse compiled objects instead of recompiling from scratch.
|
# reuse compiled objects instead of recompiling from scratch.
|
||||||
RUN --mount=type=cache,target=/go/pkg/mod \
|
RUN if [ "$WITH_ANYDOC" = "1" ]; then \
|
||||||
--mount=type=cache,target=/root/.cache/go-build \
|
|
||||||
if [ "$WITH_ANYDOC" = "1" ]; then \
|
|
||||||
make build-prod GO_BUILD_TAGS=anydoc; \
|
make build-prod GO_BUILD_TAGS=anydoc; \
|
||||||
else \
|
else \
|
||||||
make build-prod; \
|
make build-prod; \
|
||||||
fi
|
fi
|
||||||
RUN --mount=type=cache,target=/go/pkg/mod cp -r /go/pkg/mod/github.com/yanyiwu/ /app/yanyiwu/
|
RUN cp -r /go/pkg/mod/github.com/yanyiwu/ /app/yanyiwu/
|
||||||
|
|
||||||
# Final stage
|
# Final stage
|
||||||
FROM debian:12.12-slim
|
FROM debian:12.12-slim
|
||||||
|
|||||||
Reference in new issue
Block a user