Skip to content

Commit

Permalink
enhance(ci): parallel build starwhale image (#874)
Browse files Browse the repository at this point in the history
  • Loading branch information
tianweidut authored Aug 5, 2022
1 parent 8d90896 commit 4a46749
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ jobs:
needs:
- pypi-release

strategy:
matrix:
cuda_version: ["", "11.3", "11.3-cudnn8", "11.4", "11.4-cudnn8", "11.5", "11.5-cudnn8", "11.6", "11.6-cudnn8", "11.7"]
arch: ["linux/arm64", "linux/amd64"]

steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -97,7 +102,11 @@ jobs:
RELEASE_VERSION: ${{ steps.tag.outputs.tag }}
PYPI_RELEASE_VERSION: ${{ steps.tag.outputs.tag }}
run: |
make build-release-starwhale
if [ "${{matrix.cuda_version}}" = "" ]; then
make build-release-starwhale arch=${{matrix.arch}}
else
make build-release-starwhale-cuda arch=${{matrix.arch}} version=${{matrix.cuda_version}}
fi
server-image-release:
runs-on: ubuntu-latest
Expand Down
20 changes: 6 additions & 14 deletions docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ define push-image
endef

define build-starwhale
docker buildx build --platform linux/arm64,linux/amd64 \
docker buildx build --platform $(3) \
--build-arg BASE_IMAGE=$(1) \
--build-arg SW_VERSION=$(PYPI_RELEASE_VERSION) \
--build-arg HTTP_PROXY=$(HTTP_PROXY) --build-arg HTTPS_PROXY=$(HTTPS_PROXY) \
Expand All @@ -66,7 +66,7 @@ define build-starwhale
endef

define build-starwhale-cuda
$(call build-starwhale,${GHCR_IO_REPO}/cuda:$(1)-base${FIXED_VERSION_BASE_IMAGE},-cuda$(1))
$(call build-starwhale,${GHCR_IO_REPO}/cuda:$(1)-base${FIXED_VERSION_BASE_IMAGE},-cuda$(1),$(2))
endef


Expand All @@ -88,19 +88,11 @@ build-release-base:
-t $(GHCR_IO_REPO)/base:latest \
--push -f Dockerfile.base .

#Parallel to build starwhale image
build-release-starwhale:
$(call build-starwhale,${GHCR_IO_REPO}/base:${FIXED_VERSION_BASE_IMAGE},)

$(call build-starwhale-cuda,11.3)
$(call build-starwhale-cuda,11.3-cudnn8)
$(call build-starwhale-cuda,11.4)
$(call build-starwhale-cuda,11.4-cudnn8)
$(call build-starwhale-cuda,11.5)
$(call build-starwhale-cuda,11.5-cudnn8)
$(call build-starwhale-cuda,11.6)
$(call build-starwhale-cuda,11.6-cudnn8)
$(call build-starwhale-cuda,11.7)
$(call build-starwhale,${GHCR_IO_REPO}/base:${FIXED_VERSION_BASE_IMAGE},,$(arch))

build-release-starwhale-cuda:
$(call build-starwhale-cuda,$(version),$(arch))

build-cuda:
cd cuda; python3 render.py --all --push --base-image $(GHCR_BASE_IMAGE)
Expand Down

0 comments on commit 4a46749

Please sign in to comment.