Docker build each PR and nightly docker test #3
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
name: Build the Docker Image and Run | |
on: | |
push: | |
branches: [ main, docker_test ] | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.10.11 | |
- name: Clean Docker images | |
run: |- | |
echo "Available storage before cleaning:" | |
df -h | |
docker system prune --all --force | |
echo "Available storage:" | |
df -h | |
echo "Removing dotnet" | |
sudo rm -rf /usr/share/dotnet | |
echo "Available storage:" | |
df -h | |
- name: Docker Build Image | |
run: |- | |
docker build -t h2o-llmstudio . | |
- name: Run the Docker Image | |
run: |- | |
mkdir llmstudio_mnt | |
docker run --runtime=nvidia --shm-size=64g --init --rm -i -u `id -u`:`id -g` -p 10101:10101 -v $(pwd)/llmstudio_mnt:/home/llmstudio/mount h2o-llmstudio |