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

build: Create integration-build.yml #32

Merged
merged 20 commits into from
Dec 23, 2024
Merged
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
49 changes: 49 additions & 0 deletions .github/workflows/integration-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Integration Build

on:
schedule:
- cron: '0 12 * * *'
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
scheduled:
runs-on: ubuntu-latest
timeout-minutes: 95
strategy:
matrix:
python-version: [ '3.10' ]

services:
redis:
image: redis:latest
ports:
- 6379:6379
rabbitmq:
image: rabbitmq:latest
env:
RABBITMQ_DEFAULT_USER: admin
RABBITMQ_DEFAULT_PASS: admin
ports:
- 5672:5672
- 15672:15672

steps:
- name: Checkout branch
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install llm-api dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install pytest-asyncio
pip install -r ./protollm_tools/llm-api/requirements.txt
- name: Test llm-api with pytest
run: |
pytest -s ./protollm_tools/llm-api/tests/integration
51 changes: 51 additions & 0 deletions .github/workflows/sdk-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: SDK Build

on:
schedule:
- cron: '0 12 * * *'
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
scheduled:
runs-on: ubuntu-latest
timeout-minutes: 95
strategy:
matrix:
python-version: [ '3.10' ]

services:
redis:
image: redis:latest
ports:
- 6379:6379
rabbitmq:
image: rabbitmq:latest
ports:
- 5672:5672
- 15672:15672

steps:
- name: Checkout branch
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install pytest dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install pytest-asyncio
- name: Change directory and install sdk dependencies
run: |
cd ./protollm_tools/sdk
pip install -r requirements.txt
pip install -e .
- name: Test sdk with pytest
run: |
cd ./protollm_tools/sdk
pytest -s ./tests
1 change: 1 addition & 0 deletions protollm_tools/llm-api/tests/integration/test_with_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def redis_client(test_real_config):


@pytest.mark.asyncio
@pytest.mark.skip(reason="Test waits infinitely in GitHub Action")
async def test_task_in_queue(test_real_config, redis_client):
task_id = str(uuid.uuid4())
prompt = ChatCompletionModel(
Expand Down
1 change: 1 addition & 0 deletions protollm_tools/sdk/protollm_sdk/celery/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions protollm_tools/sdk/tests/celery/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

4 changes: 4 additions & 0 deletions protollm_tools/sdk/tests/job/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,20 @@ def test_llm_request(llm_request):
res = LLMResponse(job_id=llm_request["job_id"], text=r.content)
assert isinstance(res, LLMResponse)


@pytest.mark.skip(reason="Test waits infinitely in GitHub Action")
def test_text_embedder_request(text_embedder_request):
random_id = uuid.uuid4()
result = task_test.apply_async(args=(TextEmbedderJob.__name__, random_id), kwargs=text_embedder_request)
assert isinstance(result.get(), TextEmbedderResponse)


@pytest.mark.skip(reason="Test waits infinitely in GitHub Action")
def test_result_storage(result_storage):
random_id = uuid.uuid4()
task_test.apply_async(args=(ResultStorageJob.__name__, random_id), kwargs=result_storage)


@pytest.mark.skip(reason="We don't have local vector DB")
def test_ping_vector_db():
random_id = uuid.uuid4()
Expand Down
1 change: 1 addition & 0 deletions protollm_tools/sdk/tests/job/test_text_embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def text_embedder_request():

# ---------------------------- Function Tests ----------------------------

@pytest.mark.skip(reason="Error: [Errno 111] Connection refused.")
def test_text_embedder_inference(text_embedder, text_embedder_request):
"""
Tests that the inference method returns a valid TextEmbedderResponse.
Expand Down
Loading