-
Notifications
You must be signed in to change notification settings - Fork 696
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #550 from kvcache-ai/docker_dev
Docker dev
- Loading branch information
Showing
4 changed files
with
95 additions
and
50 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,90 @@ | ||
name: DockerHub CI | ||
|
||
on: | ||
release: | ||
types: [published] | ||
# push: | ||
# branches: | ||
# - main | ||
env: | ||
DOCKERHUB_REPO: ${{ secrets.DOCKERHUB_USERNAME }}/ktransformers | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Run tests | ||
run: | | ||
if [ -f docker-compose.test.yml ]; then | ||
docker-compose --file docker-compose.test.yml build | ||
docker-compose --file docker-compose.test.yml run sut | ||
else | ||
docker build . --file Dockerfile | ||
fi | ||
docker_task: | ||
needs: test | ||
name: ${{ matrix.instruct}} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# for amd64 | ||
- {instruct: "FANCY", platform: "linux/amd64"} | ||
- {instruct: "AVX512", platform: "linux/amd64"} | ||
- {instruct: "AVX2", platform: "linux/amd64"} | ||
- {instruct: "NATIVE", platform: "linux/amd64"} | ||
# for arm64 | ||
- {instruct: "NATIVE", platform: "linux/arm64"} | ||
|
||
steps: | ||
- name: Move Docker data directory | ||
run: | | ||
sudo systemctl stop docker | ||
sudo mkdir -p /mnt/docker | ||
sudo rsync -avz /var/lib/docker/ /mnt/docker | ||
sudo rm -rf /var/lib/docker | ||
sudo ln -s /mnt/docker /var/lib/docker | ||
sudo systemctl start docker | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Build and push for amd64 | ||
if: matrix.platform == 'linux/amd64' | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
platforms: | | ||
linux/amd64 | ||
tags: | | ||
${{ env.DOCKERHUB_REPO }}:latest-${{ matrix.instruct }} | ||
${{ env.DOCKERHUB_REPO }}:${{ github.event.release.tag_name }}-${{ matrix.instruct }} | ||
build-args: | | ||
CPU_INSTRUCT=${{ matrix.instruct }} | ||
- | ||
name: Build and push for arm64 | ||
if: matrix.platform == 'linux/arm64' | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
platforms: | | ||
linux/arm64 | ||
tags: | | ||
${{ env.DOCKERHUB_REPO }}:latest-${{ matrix.instruct }} | ||
${{ env.DOCKERHUB_REPO }}:${{ github.event.release.tag_name }}-${{ matrix.instruct }} | ||
build-args: | | ||
CPU_INSTRUCT=${{ matrix.instruct }} |
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
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