Skip to content

Commit fc46b70

Browse files
authored
Merge pull request #1333 from swirlai/ds2035-pubmain
update individual testing workflows; remove obsolet workflows; on main
2 parents fdc7302 + 2812655 commit fc46b70

File tree

5 files changed

+112
-328
lines changed

5 files changed

+112
-328
lines changed

.github/workflows/docker-image-sa.yml

-84
This file was deleted.

.github/workflows/docker-image.yml

+48-63
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,57 @@
1-
name: Docker Build
1+
name: Docker + SA Docker Builds
22

33
on:
4-
# Allows manual run of this workflow from the Actions tab (on any branch)
4+
# Manual trigger only
55
workflow_dispatch:
66

7-
# For debugging
8-
# on:
9-
# push:
10-
# branches: ''
11-
127
jobs:
138

14-
build:
9+
swirl-docker:
1510
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout the Code
13+
uses: actions/checkout@v4
14+
- name: Login to Docker Hub
15+
uses: docker/login-action@v3
16+
with:
17+
username: ${{ secrets.DOCKER_USERNAME }}
18+
password: ${{ secrets.DOCKER_PASSWORD }}
19+
- name: Build and Push Swirl Docker Image
20+
run: |
21+
BRANCH_NAME=${GITHUB_REF#refs/heads/}
22+
TAG_NAME=$([ "$BRANCH_NAME" = "main" ] && echo "latest" || echo "$BRANCH_NAME")
23+
docker buildx use devBuilder || docker buildx create --name devBuilder --use
24+
docker buildx build -t swirlai/swirl-search:$TAG_NAME --platform linux/amd64,linux/arm64 --push .
25+
- name: Update the Docker Repo Description
26+
uses: peter-evans/dockerhub-description@v4
27+
with:
28+
username: ${{ secrets.DOCKER_USERNAME_X }}
29+
password: ${{ secrets.DOCKER_PASSWORD_X }}
30+
repository: swirlai/swirl-search
1631

32+
standalone-docker:
33+
needs: swirl-docker
34+
runs-on: ubuntu-latest
1735
steps:
18-
- name: Checkout the Code
19-
uses: actions/checkout@v4
20-
- name: Login to Docker Hub
21-
uses: docker/login-action@v3
22-
with:
23-
username: ${{ secrets.DOCKER_USERNAME }}
24-
password: ${{ secrets.DOCKER_PASSWORD }}
25-
- name: Docker Diagnostics
26-
run: |
27-
docker system df
28-
- name: Host System Diagnostics
29-
run: |
30-
df -h
31-
du -sh *
32-
- name: Docker Cleanup
33-
run: |
34-
docker system prune -af
35-
docker volume prune -f
36-
docker builder prune -f
37-
- name: Builder Bootstrap
38-
run: docker buildx create --name devBuilder --use --bootstrap
39-
- name: Build the Docker Image
40-
run: docker buildx build -t swirlai/swirl-search:latest --platform linux/amd64,linux/arm64 --push .
41-
- name: Update the Docker Repo Description
42-
uses: peter-evans/dockerhub-description@v4
43-
with:
44-
username: ${{ secrets.DOCKER_USERNAME_X }}
45-
password: ${{ secrets.DOCKER_PASSWORD_X }}
46-
repository: swirlai/swirl-search
47-
- name: Create Artifacts Directory
48-
run: mkdir -p artifacts
49-
- name: Set Branch Name
50-
id: extract_branch
51-
run: |
52-
BRANCH_NAME=$(echo $GITHUB_REF | cut -d "/" -f 3)
53-
echo "branch=$BRANCH_NAME" >> $GITHUB_ENV
54-
- name: Write Branch and run_id to File
55-
run: |
56-
echo "${{ env.branch }}" > ./artifacts/branch.txt
57-
echo "${{ github.run_id }}" > ./artifacts/run_id.txt
58-
- name: Upload Branch and run_id Files as Artifacts
59-
uses: actions/upload-artifact@v4
60-
with:
61-
name: branch-info-${{ github.run_id }}
62-
path: |
63-
./artifacts/branch.txt
64-
./artifacts/run_id.txt
65-
- name: Upload Log Files
66-
if: always()
67-
uses: actions/upload-artifact@v4
68-
with:
69-
name: log-files
70-
path: |
71-
logs/
72-
/var/log/syslog*
36+
- name: Checkout the Code
37+
uses: actions/checkout@v4
38+
- name: Login to Docker Hub
39+
uses: docker/login-action@v3
40+
with:
41+
username: ${{ secrets.DOCKER_USERNAME }}
42+
password: ${{ secrets.DOCKER_PASSWORD }}
43+
- name: Build and Push Standalone Docker Image
44+
run: |
45+
BRANCH_NAME=${GITHUB_REF#refs/heads/}
46+
TAG_SUFFIX="-sa"
47+
TAG_NAME=$([ "$BRANCH_NAME" = "main" ] && echo "latest$TAG_SUFFIX" || echo "$BRANCH_NAME$TAG_SUFFIX")
48+
docker buildx use devBuilder || docker buildx create --name devBuilder --use
49+
docker buildx build -f DevUtils/docker/Dockerfile.sa --platform linux/amd64,linux/arm64 -t swirlai/swirl-search:${TAG_NAME} --push .
50+
- name: Upload Log Files
51+
if: always()
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: log-files
55+
path: |
56+
logs/
57+
/var/log/syslog*

.github/workflows/qa-suite.yml

+42-83
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,53 @@
11
name: QA Suite
22

33
on:
4-
# workflow_run:
5-
# workflows: [Unit Tests]
6-
# types:
7-
# - completed
8-
# Allows you to run this workflow manually from the Actions tab
4+
# Manual trigger only
95
workflow_dispatch:
106

117
jobs:
128

139
build:
14-
if: (github.event_name == 'workflow_dispatch') || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
1510
runs-on: ubuntu-latest
1611

1712
steps:
18-
- name: Download Branch and run_id Artifacts
19-
uses: dawidd6/action-download-artifact@v3
20-
with:
21-
github_token: ${{ secrets.GITHUB_TOKEN }}
22-
workflow: unit-tests.yml
23-
name: branch-info-${{ github.event_name == 'workflow_run' && github.event.workflow_run.id || github.run_id }}
24-
path: ./artifacts
25-
continue-on-error: true # Allow the step to fail without stopping the workflow
26-
- name: Determine Branch for Checkout
27-
id: determine_branch
28-
run: |
29-
if [[ -f ./artifacts/branch.txt && -f ./artifacts/run_id.txt ]]; then
30-
echo "branch=$(cat ./artifacts/branch.txt)" >> $GITHUB_ENV
31-
echo "original_run_id=$(cat ./artifacts/run_id.txt)" >> $GITHUB_ENV
32-
else
33-
BRANCH_NAME=$(echo $GITHUB_REF | cut -d "/" -f 3)
34-
echo "branch=$BRANCH_NAME" >> $GITHUB_ENV
35-
fi
36-
- name: Print Branch to be Checked Out
37-
run: |
38-
echo "Branch to checkout: ${{ env.branch }}"
39-
- name: Checkout the Code
40-
uses: actions/checkout@v4
41-
with:
42-
ref: ${{ env.branch }}
43-
- name: Set Up Python
44-
uses: actions/setup-python@v5
45-
with:
46-
python-version: '3.12.2'
47-
cache: 'pip' # caching pip stuff
48-
- name: Install Chromium
49-
uses: browser-actions/setup-chrome@v1
50-
- name: Chromium Binary Details
51-
run: |
52-
which chromedriver
53-
which chromium
54-
- name: Update apt
55-
run: sudo apt -o Acquire::Retries=3 update
56-
- name: Upgrade Ubuntu to Latest Patches
57-
run: sudo apt upgrade -y
58-
- name: Install redis-server
59-
run: sudo apt install -y redis-server
60-
- name: Install Swirl
61-
run: ./install.sh
62-
- name: Set Up Swirl
63-
run: python swirl.py setup
64-
- name: Start Swirl
65-
run: python swirl.py start
66-
- name: Check UI Availability
67-
run: curl http://localhost:8000/galaxy/login
68-
- name: Login to Docker Hub
69-
uses: docker/login-action@v3
70-
with:
71-
username: ${{ secrets.DOCKER_USERNAME }}
72-
password: ${{ secrets.DOCKER_PASSWORD }}
73-
- name: Run the QA Suite
74-
run: docker run --net=host -e SWIRL_TEST_HOST=localhost -t swirlai/swirl-search-qa:automated-tests-master sh -c "behave --tags=qa_suite,community"
75-
- name: Ensure Artifacts Directory Exists and Write Branch and run_id Again
76-
run: |
77-
mkdir -p ./artifacts
78-
echo "${{ env.branch }}" > ./artifacts/branch.txt
79-
echo "${{ env.original_run_id }}" > ./artifacts/run_id.txt
80-
- name: Re-upload Branch and run_id for Subsequent Workflows
81-
uses: actions/upload-artifact@v4
82-
with:
83-
name: branch-info-${{ github.run_id }}
84-
path: |
85-
./artifacts/branch.txt
86-
./artifacts/run_id.txt
87-
- name: Upload Log Files
88-
if: always()
89-
uses: actions/upload-artifact@v4
90-
with:
91-
name: log-files
92-
path: |
93-
logs/
94-
/var/log/syslog*
13+
- name: Checkout the Code
14+
uses: actions/checkout@v4
15+
- name: Start Application Environment
16+
run: docker-compose up -d
17+
- name: Login to Docker Hub
18+
uses: docker/login-action@v3
19+
with:
20+
username: ${{ secrets.DOCKER_USERNAME }}
21+
password: ${{ secrets.DOCKER_PASSWORD }}
22+
- name: Wait for Application to be Ready
23+
run: |
24+
echo "Waiting for the application to become ready..."
25+
max_attempts=10
26+
count=0
27+
until curl --output /dev/null --silent --head --fail http://localhost:8000/galaxy/login; do
28+
count=$(($count+1))
29+
if [ $count -ge $max_attempts ]; then
30+
echo "Application did not become ready in time."
31+
exit 1
32+
fi
33+
printf '.'
34+
sleep 30
35+
done
36+
echo "Application is ready."
37+
- name: Create env File
38+
run: |
39+
echo "SWIRL_TEST_HOST=localhost" > .env
40+
echo "QA_ADMIN_USER=${{ secrets.QA_ADMIN_USER }}" >> .env
41+
echo "QA_ADMIN_PW=${{ secrets.QA_ADMIN_PW }}" >> .env
42+
- name: Run the QA Suite
43+
run: docker run --net=host --env-file .env -t swirlai/swirl-search-qa:automated-tests-master sh -c "behave --tags=qa_suite,community"
44+
- name: Cleanup Application Environment
45+
run: docker-compose down
46+
- name: Upload Log Files
47+
if: always()
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: log-files
51+
path: |
52+
logs/
53+
/var/log/syslog*

.github/workflows/sectest-docker-image.yml

-49
This file was deleted.

0 commit comments

Comments
 (0)