Skip to content

Commit

Permalink
Fix space outage in github runner (#144)
Browse files Browse the repository at this point in the history
* Fix merge bug

* Fix version conflict for config file

* Resolve snapshot merge conflict

* Update yaml
  • Loading branch information
moria97 authored Aug 5, 2024
1 parent 5ad9579 commit 7b3eea7
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 21 deletions.
28 changes: 19 additions & 9 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#
name: Create and publish a Docker image
name: Publish Docker image

# Configures this workflow to run every time a change is pushed to the branch called `release`.
on:
Expand All @@ -19,6 +18,17 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check disk space
run: df . -h

- name: Free disk space
run: |
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
sudo rm -rf \
/usr/share/dotnet /usr/local/lib/android /opt/ghc \
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
/usr/lib/jvm || true
- name: Extract version
run: |
pip install poetry
Expand All @@ -40,13 +50,6 @@ jobs:
docker build -t ${{ env.REGISTRY }}/mybigpai/pairag:$IMAGE_TAG .
docker push ${{ env.REGISTRY }}/mybigpai/pairag:$IMAGE_TAG
- name: Build and push GPU image
env:
IMAGE_TAG: ${{env.VERSION_TAG}}-gpu
run: |
docker build -t ${{ env.REGISTRY }}/mybigpai/pairag:$IMAGE_TAG -f Dockerfile_gpu .
docker push ${{ env.REGISTRY }}/mybigpai/pairag:$IMAGE_TAG
- name: Build and push UI image
env:
IMAGE_TAG: ${{env.VERSION_TAG}}-ui
Expand All @@ -60,3 +63,10 @@ jobs:
run: |
docker build -t ${{ env.REGISTRY }}/mybigpai/pairag:$IMAGE_TAG -f Dockerfile_nginx .
docker push ${{ env.REGISTRY }}/mybigpai/pairag:$IMAGE_TAG
- name: Build and push GPU image
env:
IMAGE_TAG: ${{env.VERSION_TAG}}-gpu
run: |
docker build -t ${{ env.REGISTRY }}/mybigpai/pairag:$IMAGE_TAG -f Dockerfile_gpu .
docker push ${{ env.REGISTRY }}/mybigpai/pairag:$IMAGE_TAG
34 changes: 22 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#
name: Release image

# Configures this workflow to run every time a change is pushed to the branch called `release`.
Expand All @@ -23,6 +22,17 @@ jobs:
with:
python-version: "3.11"

- name: Check disk space
run: df . -h

- name: Free disk space
run: |
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
sudo rm -rf \
/usr/share/dotnet /usr/local/lib/android /opt/ghc \
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
/usr/lib/jvm || true
- name: Extract version
run: |
pip install poetry
Expand All @@ -33,7 +43,7 @@ jobs:
echo "version:$SPECIFIC_VERSION_TAG\ncommit_id:$(git rev-parse HEAD)" > __build_version.cfg
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
- name: Login to ACR Hangzhou region
- name: Login to ACR region
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
Expand All @@ -50,16 +60,6 @@ jobs:
docker tag ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }} ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.SPECIFIC_IMAGE_TAG }}
docker push ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.SPECIFIC_IMAGE_TAG }}
- name: Build and push GPU image
env:
IMAGE_TAG: ${{env.VERSION_TAG}}-gpu
SPECIFIC_IMAGE_TAG: ${{env.SPECIFIC_VERSION_TAG}}-gpu
run: |
docker build -t ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }} -f Dockerfile_gpu .
docker push ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }}
docker tag ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }} ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.SPECIFIC_IMAGE_TAG }}
docker push ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.SPECIFIC_IMAGE_TAG }}
- name: Build and push UI image
env:
IMAGE_TAG: ${{env.VERSION_TAG}}-ui
Expand All @@ -79,3 +79,13 @@ jobs:
docker push ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }}
docker tag ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }} ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.SPECIFIC_IMAGE_TAG }}
docker push ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.SPECIFIC_IMAGE_TAG }}
- name: Build and push GPU image
env:
IMAGE_TAG: ${{env.VERSION_TAG}}-gpu
SPECIFIC_IMAGE_TAG: ${{env.SPECIFIC_VERSION_TAG}}-gpu
run: |
docker build -t ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }} -f Dockerfile_gpu .
docker push ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }}
docker tag ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.IMAGE_TAG }} ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.SPECIFIC_IMAGE_TAG }}
docker push ${{ env.REGISTRY }}/mybigpai/pairag:${{ env.SPECIFIC_IMAGE_TAG }}

0 comments on commit 7b3eea7

Please sign in to comment.