Skip to content

Commit 22dc698

Browse files
committed
Merged changes from release 3.8.0.0 branch
2 parents af3d92b + 37b2ad1 commit 22dc698

16 files changed

+132
-270
lines changed

.github/workflows/docker-image.yml

+1-1
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

+1-1
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/test-build-pipeline.yml

+2-2
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

+7-3
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-develop' # 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

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set Up Python
1616
uses: actions/setup-python@v5
1717
with:
18-
python-version: '3.12.4'
18+
python-version: '3.12.5'
1919
cache: 'pip'
2020
- name: Install Swirl
2121
run: ./install.sh

DevUtils/docker/sw-start-sa.sh

-26
This file was deleted.

Dockerfile

+30-52
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

docker-compose.yaml

+11-1
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/" \

download-nltk-resources.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
python -c "import nltk; nltk.download('stopwords')"
4+
python -c "import nltk; nltk.download('punkt_tab')"

install.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ else
9999
fi
100100

101101
echo "$PROG Downloading NLTK modules..."
102-
python -m nltk.downloader stopwords
103-
python -m nltk.downloader punkt
102+
./download-nltk-resources.sh
104103

105104
echo "$PROG If no errors occurred, run python swirl.py setup"

0 commit comments

Comments
 (0)