-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: sallyom <[email protected]>
- Loading branch information
Showing
2 changed files
with
62 additions
and
18 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
|
@@ -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 | ||
|
@@ -64,31 +70,41 @@ jobs: | |
|
||
- name: Init | ||
run: terraform init | ||
with: | ||
system: ${{ matrix.system }} | ||
working-directory: terraform-test-environment-module | ||
|
||
- name: Bootstrap | ||
id: up | ||
with: | ||
system: ${{ matrix.system }} | ||
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 | ||
with: | ||
system: ${{ matrix.system }} | ||
run: | | ||
echo "id=$(terraform output id | xargs)" >> $GITHUB_OUTPUT | ||
echo "url=$(terraform output host | xargs)" >> $GITHUB_OUTPUT | ||
echo "pem_filename=$(terraform output pem_filename | xargs)" >> $GITHUB_OUTPUT | ||
working-directory: terraform-test-environment-module | ||
|
||
- name: Ansible Collections | ||
with: | ||
system: ${{ matrix.system }} | ||
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 | ||
with: | ||
system: ${{ matrix.system }} | ||
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: | ||
|
@@ -100,23 +116,29 @@ jobs: | |
python-version: '3.11' | ||
|
||
- name: Install Dependencies | ||
working-directory: ./main/recipes/natural_language_processing/chatbot | ||
with: | ||
system: ${{ matrix.system }} | ||
working-directory: ./main/recipes/${{ matrix.app_path }} | ||
run: make install | ||
|
||
- name: Run Integration Tests | ||
working-directory: ./main/recipes/natural_language_processing/chatbot | ||
with: | ||
system: ${{ matrix.system }} | ||
working-directory: ./main/recipes/${{ matrix.app_path }} | ||
run: make integration-tests | ||
env: | ||
URL: ${{ steps.terraform-output.outputs.url }} | ||
|
||
- name: Destroy Test Environment | ||
with: | ||
system: ${{ matrix.system }} | ||
id: down | ||
if: always() | ||
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 | ||
|
@@ -139,8 +161,14 @@ jobs: | |
matrix: | ||
include: | ||
- image: llamacpp_python | ||
#- 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] | ||
|
@@ -167,14 +195,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 | ||
|
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