Skip to content

Refactor docker compose of the dataprep microservice #3660

Refactor docker compose of the dataprep microservice

Refactor docker compose of the dataprep microservice #3660

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
name: MicroService-test
on:
pull_request_target:
branches: ["main", "*rc", "pre-ci"]
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped
paths:
- comps/**
- tests/**
- "!**.md"
- .github/workflows/pr-microservice-test.yml
# If there is a new commit, the previous jobs will be canceled
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
job1:
uses: ./.github/workflows/_get-test-matrix.yml
Microservice-test:
needs: job1
strategy:
matrix: ${{ fromJSON(needs.job1.outputs.run_matrix) }}
runs-on: ${{ matrix.hardware }}
permissions:
id-token: write
contents: read
continue-on-error: true
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Clean Up Working Directory
run: |
sudo rm -rf ${{github.workspace}}/*
cid=$(docker ps -aq --filter "name=test-comps-*")
if [[ ! -z "$cid" ]]; then docker stop $cid && docker rm $cid && sleep 1s; fi
docker rmi $(docker images --filter reference="*/*:comps" -q) || true
docker system prune -f
docker ps
- name: Checkout out Repo
uses: actions/checkout@v4
with:
ref: "refs/pull/${{ github.event.number }}/merge"
- name: Get AWS Credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
if: ${{ contains(matrix.service, 'bedrock') }}
with:
role-to-assume: ${{ secrets.AWS_IAM_ROLE_ARN }}
aws-region: us-east-1
- name: Run microservice test
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
GOOGLE_CSE_ID: ${{ secrets.GOOGLE_CSE_ID }}
PINECONE_KEY: ${{ secrets.PINECONE_KEY }}
PREDICTIONGUARD_API_KEY: ${{ secrets.PREDICTIONGUARD_API_KEY }}
service: ${{ matrix.service }}
hardware: ${{ matrix.hardware }}
run: |
cd tests
echo "log_name=${service}" >> $GITHUB_ENV
timeout 60m bash $(find . -type f -name test_${service}.sh)
- name: Clean up container
run: |
cid=$(docker ps -aq --filter "name=test-comps-*")
if [[ ! -z "$cid" ]]; then docker stop $cid && docker rm $cid && sleep 1s; fi
docker system prune -f
- name: Publish pipeline artifact
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.log_name }}
path: ${{ github.workspace }}/tests/*.log