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

Integration tests #254

Closed
wants to merge 1 commit into from
Closed
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
59 changes: 42 additions & 17 deletions .github/workflows/testing-framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: Testing Framework

on:
schedule: # schedule the job to run every hour
- cron: '0 * * * *'
- cron: '0 */6 * * *'

workflow_dispatch:

# pull_request: ## temporary for debugging development purposes
# branches:
# - main
pull_request: ## temporary for debugging development purposes
branches:
- main

env:
TF_VAR_aws_region: "eu-west-2"
Expand All @@ -32,7 +32,13 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
app_path:
- natural_language_processing/chatbot
- natural_language_processing/summarizer
- natural_language_processing/codegen
- natural_language_processing/rag
- audio/audio_to_text
system:
- arch: amd64
aws_image_type: t3a.medium
aws_ami_architecture: x86_64
Expand Down Expand Up @@ -71,8 +77,8 @@ jobs:
run: terraform apply -auto-approve -lock=false
working-directory: terraform-test-environment-module
env:
TF_VAR_aws_instance_type: ${{ matrix.aws_image_type }}
TF_VAR_aws_ami_architecture: ${{ matrix.aws_ami_architecture }}
TF_VAR_aws_instance_type: ${{ matrix.system.aws_image_type }}
TF_VAR_aws_ami_architecture: ${{ matrix.system.aws_ami_architecture }}

- name: Terraform Output
id: terraform-output
Expand All @@ -84,11 +90,11 @@ jobs:

- name: Ansible Collections
run: ansible-galaxy install -r ./provision/requirements.yml
working-directory: ./main/recipes/natural_language_processing/chatbot
working-directory: ./main/recipes/${{ matrix.app_path }}

- name: Provision
run: |
ansible-playbook ./main/recipes/natural_language_processing/chatbot/provision/playbook.yml \
ansible-playbook ./main/recipes/${{ matrix.app_path }}/provision/playbook.yml \
-i terraform-test-environment-module/hosts.ini \
--private-key=terraform-test-environment-module/${{ steps.terraform-output.outputs.pem_filename }}
env:
Expand All @@ -100,11 +106,11 @@ jobs:
python-version: '3.11'

- name: Install Dependencies
working-directory: ./main/recipes/natural_language_processing/chatbot
working-directory: ./main/recipes/${{ matrix.app_path }}
run: make install

- name: Run Integration Tests
working-directory: ./main/recipes/natural_language_processing/chatbot
working-directory: ./main/recipes/${{ matrix.app_path }}
run: make integration-tests
env:
URL: ${{ steps.terraform-output.outputs.url }}
Expand All @@ -115,8 +121,8 @@ jobs:
run: terraform destroy -auto-approve -lock=false
working-directory: terraform-test-environment-module
env:
TF_VAR_aws_instance_type: ${{ matrix.aws_image_type }}
TF_VAR_aws_ami_architecture: ${{ matrix.aws_ami_architecture }}
TF_VAR_aws_instance_type: ${{ matrix.system.aws_image_type }}
TF_VAR_aws_ami_architecture: ${{ matrix.system.aws_ami_architecture }}

- name: Publish Job Results to Slack
id: slack
Expand All @@ -139,8 +145,14 @@ jobs:
matrix:
include:
- image: llamacpp_python
#- image: llamacpp_python_vulkan
- image: llamacpp_python_cuda
Comment on lines +148 to +149
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are labeled wrong, llamacpp_python is correct though:

Suggested change
#- image: llamacpp_python_vulkan
- image: llamacpp_python_cuda
#- image: llamacpp-python-vulkan
- image: llamacpp-python-cuda

- image: whispercpp
- image: chatbot
- image: summarizer
- image: codegen
- image: rag
- image: transcribe
steps:
- name: Login to registry
uses: redhat-actions/[email protected]
Expand All @@ -167,14 +179,27 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

test-make-targets:
test-make-bootc:
if: github.repository == 'containers-mirror/ai-lab-recipes'
runs-on: ubuntu-22.04-2core
strategy:
fail-fast: false
matrix:
include:
- app_path: natural_language_processing/chatbot
app: chatbot
- app_path: natural_language_processing/summarizer
app: summarizer
- app_path: natural_language_processing/codegen
app: codegen
- app_path: natural_language_processing/rag
app: rag
- app_path: audio/audio_to_text
app: transcribe
steps:
- uses: actions/[email protected]

- name: chatbot
working-directory: ./recipes/natural_language_processing/chatbot
- name: ${{ matrix.app }}
working-directory: ./recipes/${{ matrix.app_path }}
run: make bootc

- name: Publish Job Results to Slack
Expand Down
5 changes: 4 additions & 1 deletion recipes/common/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@ functional-tests:
fi;

.PHONY: integration-tests
integration-tests:
run-integration-tests: clean

.PHONY: run-integration-tests
run-integration-tests:
@if [[ -n "$(LOCAL_CHROMEDRIVER_EXISTS)" ]]; then \
URL=${URL} IMAGE_NAME=${IMAGE_NAME} REGISTRY=${REGISTRY} pytest -vvv --driver=Chrome --driver-path=$(CHROMEDRIVER_INSTALLATION_PATH)/chromedriver ${RELATIVE_TESTS_PATH}/integration; \
else \
Expand Down
Loading