Skip to content

Commit bca3a5b

Browse files
authored
Merge pull request #1432 from swirlai/main_prerelease_3_8_0
Main prerelease 3 8 0
2 parents d5e5f88 + 4abf1aa commit bca3a5b

22 files changed

+408
-177
lines changed

.github/workflows/docker-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docker Build and Push
1+
name: Docker Build
22

33
on:
44
# Manual trigger only

.github/workflows/qa-suite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Set Up Python
2929
uses: actions/setup-python@v5
3030
with:
31-
python-version: '3.12.4'
31+
python-version: '3.12.5'
3232
cache: 'pip'
3333
- name: Install Swirl
3434
run: ./install.sh

.github/workflows/spell-checker.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,26 @@ on:
88
paths:
99
- "docs/**"
1010

11+
pull_request:
12+
# Run for all PRs to develop - means PR cannot merge until unit tests pass
13+
branches:
14+
- develop
15+
- main
16+
# Skip non-code changes
17+
paths-ignore:
18+
- '.github/**'
19+
- 'integrations/**'
20+
- 'swirl-infra/**'
21+
- 'db.sqlite3.dist'
1122
# Allows manual run of this workflow from the Actions tab (on any branch)
1223
workflow_dispatch:
1324

25+
permissions:
26+
contents: read
27+
actions: read
28+
checks: write
29+
pull-requests: write
30+
1431
jobs:
1532
build:
1633
runs-on: ubuntu-latest

.github/workflows/test-build-pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Set Up Python
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: '3.12.4'
23+
python-version: '3.12.5'
2424
cache: 'pip'
2525
- name: Install Swirl
2626
run: ./install.sh
@@ -53,7 +53,7 @@ jobs:
5353
- name: Set Up Python
5454
uses: actions/setup-python@v5
5555
with:
56-
python-version: '3.12.4'
56+
python-version: '3.12.5'
5757
cache: 'pip'
5858
- name: Install Swirl
5959
run: ./install.sh

.github/workflows/testing-wip.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ name: Testing WIP
88
on:
99
workflow_dispatch:
1010
inputs:
11+
qa_image: # Input the QA Repo image to use
12+
description: 'QA Repo image to use'
13+
required: true
14+
default: 'automated-tests-master' # Default image if none specified
1115
behave_tags: # Input the Behave tag(s) to run
1216
description: 'Behave tag(s) to run'
1317
required: true
14-
default: 'estest' # Default tag if none specified
18+
default: 'qa_suite,community' # Default tag if none specified
1519

1620
jobs:
1721
wip-tests:
@@ -37,7 +41,7 @@ jobs:
3741
- name: Set Up Python
3842
uses: actions/setup-python@v5
3943
with:
40-
python-version: '3.12.4'
44+
python-version: '3.12.5'
4145
cache: 'pip'
4246
- name: Install Swirl
4347
run: ./install.sh
@@ -65,7 +69,7 @@ jobs:
6569
echo "========"
6670
cat .env.qa
6771
echo "========"
68-
docker run --net=host --env-file .env.qa -t swirlai/swirl-search-qa:automated-tests-master sh -c "behave --tags=${{ github.event.inputs.behave_tags }}"
72+
docker run --net=host --env-file .env.qa -t swirlai/swirl-search-qa:${{ github.event.inputs.qa_image }} sh -c "behave --tags=${{ github.event.inputs.behave_tags }}"
6973
- name: Upload Log Files
7074
if: always()
7175
uses: actions/upload-artifact@v4

.github/workflows/unit-tests.yml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
name: Unit Tests
22

33
on:
4-
# Manual trigger only
4+
pull_request:
5+
# Run for all PRs to develop - means PR cannot merge until unit tests pass
6+
branches:
7+
- develop
8+
# Skip non-code changes
9+
paths-ignore:
10+
- '.github/**'
11+
- 'integrations/**'
12+
- 'swirl-infra/**'
13+
- 'docs/**'
14+
- 'README.md'
15+
- 'db.sqlite3.dist'
516
workflow_dispatch:
617

7-
jobs:
18+
permissions:
19+
contents: read
20+
actions: read
21+
checks: write
22+
pull-requests: write
823

9-
build:
24+
jobs:
25+
unit-tests:
1026
runs-on: ubuntu-latest
1127

1228
steps:
@@ -15,14 +31,15 @@ jobs:
1531
- name: Set Up Python
1632
uses: actions/setup-python@v5
1733
with:
18-
python-version: '3.12.4'
34+
python-version: '3.12.5'
1935
cache: 'pip'
2036
- name: Install Swirl
2137
run: ./install.sh
2238
- name: Install the Unit Tests
2339
run: ./install-test.sh
2440
- name: Run the Unit Tests
25-
run: pytest
41+
# generate a JUnit XML report for the test results
42+
run: pytest --junitxml=reports/junit.xml --tb=short --ignore=integrations
2643
- name: Upload Log Files
2744
if: always()
2845
uses: actions/upload-artifact@v4
@@ -31,3 +48,9 @@ jobs:
3148
path: |
3249
logs/
3350
/var/log/syslog*
51+
52+
- name: Publish Unit Test Results
53+
if: always()
54+
uses: EnricoMi/publish-unit-test-result-action@v2
55+
with:
56+
files: reports/junit.xml

DevUtils/docker/sw-start-sa.sh

Lines changed: 0 additions & 26 deletions
This file was deleted.

Dockerfile

Lines changed: 30 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,37 @@
1-
# Use an official Python runtime as a parent image
2-
FROM python:3.12.4-slim-bookworm
3-
4-
# Upgrade pip to the specified version or higher
5-
RUN pip install --no-cache-dir --upgrade 'pip>=24.0'
6-
7-
# try to upgrade to a more recent version of openssl
8-
RUN apt-get update
9-
RUN apt-get -y upgrade openssl
10-
11-
# install jq
12-
RUN apt-get -y install jq
13-
14-
# RUN sudo echo 'nameserver 8.8.8.8'>/etc/resolv.conf
15-
RUN apt-get update -y
16-
RUN apt-get install apt-file -y
17-
RUN apt-file update
18-
RUN apt-get install -y python3-dev build-essential
19-
RUN apt-get install -y procps
20-
RUN apt-get install -y libpq-dev
21-
22-
RUN pip install --no-cache-dir --upgrade pip
23-
RUN pip install --no-cache-dir --upgrade grpcio
24-
25-
ADD requirements.txt .
26-
RUN pip install --no-cache-dir -r requirements.txt
27-
28-
# install redis
29-
RUN apt-get install -y redis-server
30-
31-
# install requirements
32-
RUN python -m spacy download en_core_web_lg
33-
RUN python -m nltk.downloader stopwords
34-
RUN python -m nltk.downloader punkt
35-
36-
# Copy Swirl App to container
37-
RUN mkdir /app
1+
FROM python:3.12.5-slim-bookworm
2+
3+
# Update, upgrade and install packages in a single RUN to reduce layers
4+
RUN apt-get update && apt-get install -y \
5+
apt-file \
6+
build-essential \
7+
jq \
8+
libpq-dev \
9+
procps \
10+
python3-dev \
11+
redis-server \
12+
&& apt-file update \
13+
&& apt-get clean \
14+
&& rm -rf /var/lib/apt/lists/*
15+
16+
# Copy application files (see .dockerignore for list of exclusions)
17+
COPY . /app
3818
COPY ./db.sqlite3.dist /app/db.sqlite3
3919
COPY ./.env.docker /app/.env
40-
COPY ./install-ui.sh /app/install-ui.sh
41-
ADD ./swirl /app/swirl
20+
COPY ./download-nltk-resources.sh /app/
4221

43-
# Install Galaxy UI
44-
RUN mkdir -p /app/swirl/static/galaxy
45-
COPY --from=swirlai/spyglass:latest /usr/src/spyglass/ui/dist/spyglass/browser/. /app/swirl/static/galaxy
46-
COPY --from=swirlai/spyglass:latest /usr/src/spyglass/ui/config-swirl-demo.db.json /app/
22+
WORKDIR /app
4723

48-
ADD ./swirl_server /app/swirl_server
49-
ADD ./SearchProviders /app/SearchProviders
50-
ADD ./DevUtils /app/DevUtils
51-
ADD ./Data /app/Data
52-
ADD ./uploads /app/uploads
53-
ADD ./swirl.py /app/swirl.py
54-
ADD ./swirl_load.py /app/swirl_load.py
55-
ADD ./manage.py /app/manage.py
24+
# Optimize pip and Python installations
25+
RUN pip install --no-cache-dir --upgrade pip \
26+
&& pip install --no-cache-dir -r requirements.txt \
27+
&& pip install --no-cache-dir --upgrade grpcio
5628

57-
WORKDIR /app
29+
# Swirl install requirements
30+
RUN python -m spacy download en_core_web_lg && \
31+
./download-nltk-resources.sh
32+
33+
# Install the Galaxy UI
34+
COPY --from=swirlai/spyglass:preview /usr/src/spyglass/ui/dist/spyglass/browser/. /app/swirl/static/galaxy
35+
COPY --from=swirlai/spyglass:preview /usr/src/spyglass/ui/config-swirl-demo.db.json /app/
5836

5937
EXPOSE 8000

db.sqlite3.dist

0 Bytes
Binary file not shown.

docker-compose.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
services:
22
redis:
3-
image: redis
3+
image: redis:latest
4+
ports:
5+
- "6379:6379"
6+
healthcheck:
7+
test: ["CMD", "redis-cli", "ping"]
8+
interval: 10s
9+
timeout: 5s
10+
retries: 5
411
app:
512
image: swirlai/swirl-search:latest
613
ports:
714
- "8000:8000"
15+
depends_on:
16+
redis:
17+
condition: service_healthy
818
command: >
919
sh -c 'rm -fr ./.swirl && python swirl.py setup && mkdir -p static/api/config &&
1020
/usr/bin/jq ".default" ./config-swirl-demo.db.json | sed -e "s/<msal-app-id>/$MSAL_APP_ID/" \

0 commit comments

Comments
 (0)