Skip to content

Commit 1bee03e

Browse files
Merge branch 'development' into improve-predictions
2 parents 8e13598 + 58b1ea2 commit 1bee03e

File tree

11 files changed

+68
-35
lines changed

11 files changed

+68
-35
lines changed

.github/workflows/dev-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ env:
2323

2424
jobs:
2525
test_and_lint:
26-
uses: NFDI4Chem/nmrkit/.github/workflows/test.yml@main
26+
uses: ./.github/workflows/test.yml
2727

2828
push_to_registry:
2929
name: Push Docker image to Docker Hub
3030
runs-on: ubuntu-latest
31-
#needs: test_and_lint
31+
needs: test_and_lint
3232
steps:
3333
- name: Check out the repo
34-
uses: actions/checkout@v3
34+
uses: actions/checkout@v4
3535

3636
- name: Log in to Docker Hub
3737
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a

.github/workflows/doc-deploy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,23 @@ jobs:
2929
runs-on: ubuntu-latest
3030
steps:
3131
- name: Checkout
32-
uses: actions/checkout@v3
32+
uses: actions/checkout@v4
3333
with:
3434
fetch-depth: 0 # Not needed if lastUpdated is not enabled
3535
# - uses: pnpm/action-setup@v2 # Uncomment this if you're using pnpm
3636
- name: Setup Node
37-
uses: actions/setup-node@v3
37+
uses: actions/setup-node@v4
3838
with:
3939
node-version: 18
4040
cache: npm # or pnpm / yarn
4141
- name: Setup Pages
42-
uses: actions/configure-pages@v3
42+
uses: actions/configure-pages@v4
4343
- name: Install dependencies
4444
run: npm ci # or pnpm install / yarn install
4545
- name: Build with VitePress
4646
run: npm run docs:build # or pnpm docs:build / yarn docs:build
4747
- name: Upload artifact
48-
uses: actions/upload-pages-artifact@v2
48+
uses: actions/upload-pages-artifact@v3
4949
with:
5050
path: docs/.vitepress/dist
5151

@@ -60,4 +60,4 @@ jobs:
6060
steps:
6161
- name: Deploy to GitHub Pages
6262
id: deployment
63-
uses: actions/deploy-pages@v2
63+
uses: actions/deploy-pages@v4

.github/workflows/prod-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: Check out the repo
28-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2929

3030
#Fetch Latest release
3131
- name: Fetch latest release

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131
python-version: ["3.10"]
3232

3333
steps:
34-
- uses: actions/checkout@v3
34+
- uses: actions/checkout@v4
3535
- name: Set up Python ${{ matrix.python-version }}
36-
uses: actions/setup-python@v3
36+
uses: actions/setup-python@v5
3737
with:
3838
python-version: ${{ matrix.python-version }}
3939
- name: 'Create env file'
@@ -62,4 +62,4 @@ jobs:
6262
flake8 --per-file-ignores="__init__.py:F401" --ignore E402,E501,W503 $(git ls-files 'app/*.py') .
6363
- name: Run test
6464
run: |
65-
python3 -m pytest -p no:warnings --ignore=lwreg/lwreg/test-cli.py --ignore=lwreg/lwreg/test_lwreg.py
65+
python3 -m pytest -p no:warnings --ignore=lwreg/lwreg/test-cli.py --ignore=lwreg/lwreg/test_lwreg.py --ignore=lwreg/lwreg/test_dbutils.py

Dockerfile

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
FROM continuumio/miniconda3 AS nmrkit-ms
1+
FROM continuumio/miniconda3:24.1.2-0 AS nmrkit-ms
22

33
ENV PYTHON_VERSION=3.10
44
ENV OPENBABEL_VERSION=v3.1
55

66
ARG RELEASE_VERSION
77
ENV RELEASE_VERSION=${RELEASE_VERSION}
88

9-
# Install runtime dependencies
9+
# Install runtime and build dependencies
1010
RUN apt-get update && \
11-
apt-get install -y software-properties-common && \
12-
apt-get update -y && \
13-
apt-get install -y openjdk-11-jre && \
14-
apt-get install -y curl && \
11+
apt-get install -y --no-install-recommends \
12+
software-properties-common \
13+
openjdk-17-jre \
14+
curl \
15+
build-essential \
16+
gcc \
17+
g++ \
18+
git \
19+
wget && \
20+
apt-get clean && \
21+
rm -rf /var/lib/apt/lists/* && \
1522
conda update -n base -c defaults conda
1623

1724
RUN apt-get update && apt-get -y install docker.io
@@ -23,7 +30,7 @@ RUN pip3 install rdkit
2330

2431
RUN python3 -m pip install -U pip
2532

26-
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64/
33+
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/
2734
RUN export JAVA_HOME
2835

2936
RUN git clone "https://github.com/rinikerlab/lightweight-registration.git" lwreg
@@ -34,8 +41,7 @@ WORKDIR /code
3441
COPY ./requirements.txt /code/requirements.txt
3542
COPY ./alembic.ini /code/alembic.ini
3643

37-
RUN pip3 install --upgrade setuptools pip && \
38-
apt-get update && apt-get install -y git
44+
RUN pip3 install --upgrade setuptools pip
3945

4046
RUN pip3 install --no-cache-dir -r /code/requirements.txt
4147

app/routers/chem.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,11 @@ async def label_atoms(data: Annotated[str, Body(embed=False, media_type="text/pl
9999
url = "http://alatis.nmrfam.wisc.edu/upload"
100100
payload = {"input_text": data, "format": "format_", "response_type": "json"}
101101
response = requests.request("POST", url, data=payload)
102+
response.raise_for_status() # Raise an error for bad status codes
102103
return response.json()
103104
except Exception as e:
104105
raise HTTPException(
105106
status_code=422,
106-
detail="Error parsing the structure " + e.message,
107+
detail=f"Error parsing the structure: {str(e)}",
107108
headers={"X-Error": "RDKit molecule input parse error"},
108109
)

app/scripts/nmr-cli/Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ WORKDIR /app
1212
ENV BASE_NMRIUM_URL=https://nmriumdev.nmrxiv.org/
1313
ENV NMR_PREDICTION_URL=https://nmrshiftdb.nmr.uni-koeln.de/NmrshiftdbServlet/nmrshiftdbaction/quickcheck
1414

15+
# Install Java (OpenJDK 17 for Ubuntu Noble)
16+
RUN apt-get update && \
17+
apt-get install -y --no-install-recommends openjdk-17-jre && \
18+
apt-get clean && \
19+
rm -rf /var/lib/apt/lists/*
20+
1521
COPY package.json ./
1622

1723
RUN npm install
@@ -20,8 +26,8 @@ COPY . ./
2026

2127
RUN npm run build
2228

23-
#install the nmr-cli as a global package
24-
# for example, nmr-cli parse-spectra -u https://cheminfo.github.io/bruker-data-test/data/zipped/aspirin-1h.zip
29+
# Install the nmr-cli as a global package
30+
# For example, nmr-cli parse-spectra -u https://cheminfo.github.io/bruker-data-test/data/zipped/aspirin-1h.zip
2531
# nmr-cli predict -n "1H" --id 1 --type "nmr;1H;1d" --shifts "1" --solvent "Dimethylsulphoxide-D6 (DMSO-D6, C2D6SO)" -m $"\n Ketcher 6122516162D 1 1.00000 0.00000 0\n\n 16 17 0 0 0 0 0 0 0 0999 V2000\n 1.1954 -4.6484 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 2.9258 -4.6479 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 2.0622 -4.1483 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 2.9258 -5.6488 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1.1954 -5.6533 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 2.0644 -6.1483 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 3.7902 -4.1495 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 4.6574 -4.6498 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 3.7964 -6.1512 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 4.6596 -5.6458 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 5.5228 -4.1488 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 5.5277 -6.1421 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 6.3895 -4.6477 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 5.5216 -3.1488 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 7.2548 -4.1466 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 8.1215 -4.6455 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 3 1 2 0 0 0 0\n 1 5 1 0 0 0 0\n 5 6 2 0 0 0 0\n 6 4 1 0 0 0 0\n 4 2 1 0 0 0 0\n 2 3 1 0 0 0 0\n 4 9 1 0 0 0 0\n 9 10 2 0 0 0 0\n 10 8 1 0 0 0 0\n 8 7 2 0 0 0 0\n 7 2 1 0 0 0 0\n 8 11 1 0 0 0 0\n 10 12 1 0 0 0 0\n 11 13 1 0 0 0 0\n 11 14 2 0 0 0 0\n 13 15 1 0 0 0 0\n 15 16 1 0 0 0 0\nM END"
2632
RUN npm install . -g
2733

app/scripts/nmr-respredict/Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
FROM continuumio/miniconda3 AS nmr-respredict-ms
1+
FROM continuumio/miniconda3:24.1.2-0 AS nmr-respredict-ms
22

33
ENV PYTHON_VERSION=3.10
44

55
# Install runtime dependencies
66
RUN apt-get update && \
7-
apt-get install -y software-properties-common && \
8-
apt-get update -y && \
9-
apt-get install -y curl && \
7+
apt-get install -y --no-install-recommends \
8+
software-properties-common \
9+
curl && \
10+
apt-get clean && \
11+
rm -rf /var/lib/apt/lists/* && \
1012
conda update -n base -c defaults conda
1113

1214
RUN conda install -c conda-forge python>=PYTHON_VERSION

docker-compose.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
- "/var/run/docker.sock:/var/run/docker.sock"
1313
- shared-data:/shared
1414
ports:
15-
- "80:80"
15+
- "8080:80"
1616
healthcheck:
1717
test:
1818
[
@@ -62,7 +62,7 @@ services:
6262
redis:
6363
image: "redis:alpine"
6464
ports:
65-
- "${FORWARD_REDIS_PORT:-6379}:6379"
65+
- "${FORWARD_REDIS_PORT:-6380}:6379"
6666
volumes:
6767
- "redis:/data"
6868
networks:
@@ -74,7 +74,7 @@ services:
7474
pgsql:
7575
image: "informaticsmatters/rdkit-cartridge-debian"
7676
ports:
77-
- "${FORWARD_DB_PORT:-5432}:5432"
77+
- "${FORWARD_DB_PORT:-5433}:5432"
7878
env_file:
7979
- ./.env
8080
volumes:
@@ -97,8 +97,8 @@ services:
9797
minio:
9898
image: 'minio/minio:latest'
9999
ports:
100-
- '${FORWARD_MINIO_PORT:-9001}:9001'
101-
- '${FORWARD_MINIO_CONSOLE_PORT:-8900}:8900'
100+
- '${FORWARD_MINIO_PORT:-9002}:9001'
101+
- '${FORWARD_MINIO_CONSOLE_PORT:-8901}:8900'
102102
environment:
103103
MINIO_ROOT_USER: 'sail'
104104
MINIO_ROOT_PASSWORD: 'password'

ops/docker-compose-dev.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,21 @@ services:
3232
env_file:
3333
- ./.env
3434

35+
nmr-load-save:
36+
image: nfdi4chem/nmr-cli:dev-latest
37+
entrypoint: /bin/sh
38+
stdin_open: true
39+
tty: true
40+
container_name: nmr-converter
41+
nmr-respredict:
42+
image: nfdi4chem/nmr-respredict:dev-latest
43+
entrypoint: /bin/sh
44+
stdin_open: true
45+
tty: true
46+
container_name: nmr-respredict
47+
volumes:
48+
- shared-data:/shared
49+
3550
prometheus:
3651
image: prom/prometheus
3752
container_name: nmrkit_prometheus

0 commit comments

Comments
 (0)