Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build each PR and nightly docker test #840

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Push to Vorvan - Nightly
name: Build Docker Image - Nightly

on:
schedule:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build the Docker Image

on:
push:
branches: [ main, docker_test ]
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- 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 .
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ jobs:
test:
runs-on: self-hosted
steps:
# Pre-Action Cleanup
- name: Clean workspace pre action
run: |
rm -rf ${{ github.workspace }}/*

- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/test_nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Test Docker Image - Nightly

on:
push:
branches: [ main, docker_test ]
pull_request:

jobs:
test-ui-nightly:
runs-on: [ self-hosted, gpu ]
steps:
# Pre-Action Cleanup
- name: Clean workspace pre action
run: |
rm -rf ${{ github.workspace }}/*

- name: Run the Docker Image
run: |-
mkdir llmstudio_mnt
docker run --runtime=nvidia --shm-size=64g --init --name llmstudio --rm -d -u `id -u`:`id -g` -p 10101:10101 -v /var/run/docker.sock:/var/run/docker.sock:ro -v $(pwd)/llmstudio_mnt:/home/llmstudio/mount gcr.io/vorvan/h2oai/h2o-llmstudio:nightly

- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.10.11
- name: Run UI Tests
run: docker exec -it llmstudio bash "H2O_LLM_STUDIO_WORKDIR=/home/llmstudio/mount/ LOCAL_LOGIN=True PYTEST_BASE_URL=localhost:10101 make test-ui"

- name: Stop the Docker Image
if: ${{ always() }}
run: |-
docker stop $(docker ps -q --filter ancestor=gcr.io/vorvan/h2oai/h2o-llmstudio:nightly)
- name: Remove the Docker Image
if: ${{ always() }}
run: |-
docker rmi gcr.io/vorvan/h2oai/h2o-llmstudio:nightly
- name: Clean up dangling images
if: ${{ always() }}
run: |-
docker image prune --force
docker volume prune --force
docker network prune --force
docker container prune --force

# Post-Action Cleanup
- name: Clean workspace after action
if: ${{ always() }}
run: |
rm -rf ${{ github.workspace }}/*
5 changes: 5 additions & 0 deletions .github/workflows/test_ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ jobs:
test-ui:
runs-on: self-hosted
steps:
# Pre-Action Cleanup
- name: Clean workspace pre action
run: |
rm -rf ${{ github.workspace }}/*

- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

<a href="https://user-images.githubusercontent.com/1069138/233859311-32aa1f8c-4d68-47ac-8cd9-9313171ff9f9.png"><img width="50%" alt="home" src="https://user-images.githubusercontent.com/1069138/233859311-32aa1f8c-4d68-47ac-8cd9-9313171ff9f9.png"></a><a href="https://user-images.githubusercontent.com/1069138/233859315-e6928aa7-28d2-420b-8366-bc7323c368ca.png"><img width="50%" alt="logs" src="https://user-images.githubusercontent.com/1069138/233859315-e6928aa7-28d2-420b-8366-bc7323c368ca.png"></a>

[![Build Docker Image - Nightly](https://github.com/h2oai/h2o-llmstudio/actions/workflows/build-and-push-nightly.yml/badge.svg)](https://github.com/h2oai/h2o-llmstudio/actions/workflows/build-and-push-nightly.yml)
[![Test Docker Image - Nightly](https://github.com/h2oai/h2o-llmstudio/actions/workflows/test_nightly.yml/badge.svg)](https://github.com/h2oai/h2o-llmstudio/actions/workflows/test_nightly.yml)

## Jump to

- [With H2O LLM Studio, you can](#with-h2o-llm-studio-you-can)
Expand Down
7 changes: 4 additions & 3 deletions tests/ui/llm_studio_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ def dataset_name(self, filename):

def import_dataset_from_filesystem(self, filepath: str):
self.import_dataset("Local")
if "LOCAL_LOGIN" in os.environ:
path = f"{LOCAL_FILESYSTEM_PATH}/{filepath}"
if "H2O_LLM_STUDIO_WORKDIR" in os.environ:
path = os.path.join(os.getenv("H2O_LLM_STUDIO_WORKDIR"), "data/user/oasst")
else:
path = f"{CLOUD_FILESYSTEM_PATH}/{filepath}"
path = os.path.join(os.getcwd(), "data/user/oasst")
path = os.path.join(path, filepath)
self.get_by_test_id(self.FILESYSTEM_SELECTOR).fill(path)
self.continue_button().click()

Expand Down
Loading