-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yikun Jiang <yikunkero@gmail.com>
- Loading branch information
Showing
4 changed files
with
140 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: "build" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- 'main' | ||
paths: | ||
- '.github/workflows/build_image.yml' | ||
- '.github/workflows/publish_image.yml' | ||
- '.github/workflows/image.yml' | ||
- 'Dockerfile' | ||
- 'vllm_ascend/**' | ||
|
||
jobs: | ||
run-build: | ||
secrets: inherit | ||
uses: ./.github/workflows/image.yml | ||
with: | ||
publish: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: 'image' | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
publish: | ||
description: Publish the image or not. | ||
required: false | ||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
|
||
build: | ||
name: image | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Prepare | ||
run: | | ||
REPO_OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') | ||
echo "REPO_OWNER=${REPO_OWNER}" >> "$GITHUB_ENV" | ||
- name: Print | ||
run: | | ||
echo "REPO_OWNER:""${REPO_OWNER}" | ||
- name: Free up disk space | ||
run: | | ||
# Copy from https://github.com/apache/spark/blob/d6ad7798a9f77b611edb8d9f8648f726fcaa6938/dev/free_disk_space | ||
echo "==================================" | ||
echo "Free up disk space on CI system" | ||
echo "==================================" | ||
echo "Listing top 100 largest packages (from large to small)" | ||
printf "Installed-Size\tPackage\n" | ||
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n -r | head -n 100 | ||
df -h | ||
echo "Removing large packages" | ||
sudo rm -rf /usr/share/dotnet/ | ||
sudo rm -rf /usr/share/php/ | ||
sudo rm -rf /usr/local/graalvm/ | ||
sudo rm -rf /usr/local/.ghcup/ | ||
sudo rm -rf /usr/local/share/powershell | ||
sudo rm -rf /usr/local/share/chromium | ||
sudo rm -rf /usr/local/lib/android | ||
sudo rm -rf /usr/local/lib/node_modules | ||
sudo rm -rf /opt/az | ||
sudo rm -rf /opt/hostedtoolcache/CodeQL | ||
sudo rm -rf /opt/hostedtoolcache/go | ||
sudo rm -rf /opt/hostedtoolcache/node | ||
sudo apt-get remove --purge -y '^aspnet.*' | ||
sudo apt-get remove --purge -y '^dotnet-.*' | ||
sudo apt-get remove --purge -y '^llvm-.*' | ||
sudo apt-get remove --purge -y 'php.*' | ||
sudo apt-get remove --purge -y '^mongodb-.*' | ||
sudo apt-get remove --purge -y snapd google-chrome-stable microsoft-edge-stable firefox | ||
sudo apt-get remove --purge -y azure-cli google-cloud-sdk mono-devel powershell libgl1-mesa-dri | ||
sudo apt-get autoremove --purge -y | ||
sudo apt-get clean | ||
df -h | ||
- name: Build - Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
# TODO(yikun): remove this after https://github.com/docker/setup-qemu-action/issues/198 resolved | ||
with: | ||
image: tonistiigi/binfmt:qemu-v7.0.0-28 | ||
|
||
- name: Build - Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Publish - Login to GitHub Container Registry | ||
if: ${{ inputs.publish }} | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build - Build image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
push: ${{ inputs.publish }} | ||
tags: ghcr.io/${{ env.REPO_OWNER }}/vllm-ascend:dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: "publish" | ||
|
||
on: | ||
# Publish dev image for every commit | ||
push: | ||
branches: | ||
- 'main' | ||
paths: | ||
- '.github/workflows/build_image.yml' | ||
- '.github/workflows/publish_image.yml' | ||
- '.github/workflows/image.yml' | ||
- 'Dockerfile' | ||
- 'vllm_ascend/**' | ||
|
||
jobs: | ||
run-build: | ||
secrets: inherit | ||
uses: ./.github/workflows/image.yml | ||
with: | ||
publish: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters