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

Using run-platform.sh script for build test workflow #1076

Closed
wants to merge 3 commits into from
Closed
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
64 changes: 24 additions & 40 deletions .github/workflows/ci-container-build.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
name: Container Image Build Test for PRs

env:
VERSION: ci-test # Used for docker tag

on:
push:
branches:
- main
- development
paths:
- 'backend/**'
- 'frontend/**'
- 'unstract/**'
- 'platform-service/**'
- 'x2text-service/**'
- 'runner/**'
- 'docker/dockerfiles/**'
# paths:
# - 'backend/**'
# - 'frontend/**'
# - 'unstract/**'
# - 'platform-service/**'
# - 'x2text-service/**'
# - 'runner/**'
# - 'docker/dockerfiles/**'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
- development
paths:
- 'backend/**'
- 'frontend/**'
- 'unstract/**'
- 'platform-service/**'
- 'x2text-service/**'
- 'runner/**'
- 'docker/dockerfiles/**'
# paths:
# - 'backend/**'
# - 'frontend/**'
# - 'unstract/**'
# - 'platform-service/**'
# - 'x2text-service/**'
# - 'runner/**'
# - 'docker/dockerfiles/**'

jobs:
build:
Expand All @@ -41,28 +38,15 @@ jobs:
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Container Build
working-directory: ./docker
run: |
docker compose -f docker-compose.build.yaml build
password: ${{ secrets.DOCKERHUB_TOKEN }
- name: Container Run
working-directory: ./docker
run: |
cp ../backend/sample.env ../backend/.env
cp ../platform-service/sample.env ../platform-service/.env
cp ../prompt-service/sample.env ../prompt-service/.env
cp ../runner/sample.env ../runner/.env
cp ../x2text-service/sample.env ../x2text-service/.env
cp sample.essentials.env essentials.env
cp sample.env .env

docker compose -f docker-compose.yaml up -d
sleep 10
docker compose -f docker-compose.yaml ps -a
./run-platform.sh -b
sleep 30
docker compose -f docker/docker-compose.yaml ps -a
# Get the names of exited containers
custom_format="{{.Name}}\t{{.Image}}\t{{.Service}}"
EXITED_CONTAINERS=$(docker compose -f docker-compose.yaml ps -a --filter status=exited --format "$custom_format")
EXITED_CONTAINERS=$(docker compose -f docker/docker-compose.yaml ps -a --filter status=exited --format "$custom_format")

line_count=$(echo "$EXITED_CONTAINERS" | wc -l)

Expand All @@ -76,9 +60,9 @@ jobs:
# Print logs of exited containers
IFS=$'\n'
for SERVICE in $SERVICE; do
docker compose -f docker-compose.yaml logs "$SERVICE"
docker compose -f docker/docker-compose.yaml logs "$SERVICE"
done
docker compose -f docker-compose.yaml down -v
docker compose -f docker/docker-compose.yaml down -v
exit 1
fi
docker compose -f docker-compose.yaml down -v
docker compose -f docker/docker-compose.yaml down -v
Loading