Skip to content

Commit 45cb486

Browse files
authored
Merge pull request #7 from CogStack/revert-6-CU-869az43jq-distribut-cogstack-es
Revert "CU-869az43jq: MedCAT v2: Distribute cogstack-es and medcat-scripts"
2 parents bba8d63 + 2b23df8 commit 45cb486

File tree

4 files changed

+65
-14
lines changed

4 files changed

+65
-14
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: submodules-sync
2+
3+
on:
4+
push:
5+
branches: ['**']
6+
tags: ['v*.*.*']
7+
pull_request:
8+
branches: ['**']
9+
release:
10+
types: [published]
11+
workflow_dispatch:
12+
13+
jobs:
14+
sync:
15+
name: 'Submodules Sync'
16+
runs-on: ubuntu-22.04
17+
if: github.actor != 'github-actions[bot]'
18+
19+
defaults:
20+
run:
21+
shell: bash
22+
23+
steps:
24+
- name: Checkout repository with submodules
25+
uses: actions/checkout@v5
26+
with:
27+
token: ${{ secrets.GITHUB_TOKEN }}
28+
submodules: recursive
29+
persist-credentials: false
30+
31+
- name: Sync submodule URLs
32+
run: |
33+
git submodule sync --recursive
34+
35+
- name: Update submodules
36+
run: |
37+
git -c protocol.version=2 submodule update --init --remote --recursive --jobs 8
38+
39+
- name: Commit and push submodule updates
40+
env:
41+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
run: |
43+
set -euo pipefail
44+
git config user.name 'github-actions[bot]'
45+
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
46+
git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}
47+
# Stage only submodule pointer updates and .gitmodules
48+
git add .gitmodules $(git config -f .gitmodules --get-regexp path | awk '{print $2}') || true
49+
if git diff --cached --quiet; then
50+
echo "No submodule pointer changes to commit"
51+
exit 0
52+
fi
53+
git commit -m "chore(submodules): auto-update pointers [skip ci]"
54+
git push

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
[submodule "notebooks/demo_working_with_cogstack"]
3+
path = notebooks/demo_working_with_cogstack
4+
url = https://github.com/CogStack/working_with_cogstack.git
5+
branch = main
6+
ignore = all

Dockerfile_singleuser

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ ARG http_proxy
77
ARG https_proxy
88
ARG no_proxy
99

10-
# NOTE: set to ES8 or Elasticsearch 8 or OS for Opensearch
11-
ARG COGSTACK_BACKEND=ES9
12-
1310
# set to "true" for the GPU build
1411
ARG GPU_BUILD=false
1512

@@ -215,20 +212,16 @@ RUN uv pip install --upgrade --system pip setuptools wheel
215212

216213
# install the rest of the packages including medcat
217214
COPY ./requirements.txt /srv/jupyterhub/
215+
# install requirements for working with cogstack scripts
216+
COPY notebooks/demo_working_with_cogstack/requirements.txt /srv/jupyterhub/working_with_cogstack_requirements.txt
218217

219218
RUN if [ "$GPU_BUILD" = "true" ] && [ "$CPU_ARCHITECTURE" = "amd64" ]; then \
220219
uv pip install --system --no-cache-dir -r /srv/jupyterhub/requirements.txt && \
221-
# NOTE: it'll create the medcat-scripts folder within
222-
uv run python -m medcat download-scripts /srv/jupyterhub/ && \
223-
uv pip install --system --no-cache-dir -r /srv/jupyterhub/medcat-scripts/requirements.txt ; \
220+
uv pip install --system --no-cache-dir -r /srv/jupyterhub/working_with_cogstack_requirements.txt ; \
224221
else \
225222
uv pip install --system --no-cache-dir -r /srv/jupyterhub/requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu/ && \
226-
uv run python -m medcat download-scripts /srv/jupyterhub/ && \
227-
uv pip install --system --no-cache-dir -r /srv/jupyterhub/medcat-scripts/requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu/ ; \
228-
fi && \
229-
# install cogstack-es (Cogstack class)
230-
uv pip install "cogstack-es[$COGSTACK_BACKEND]" && \
231-
mv /srv/jupyterhub/medcat-scripts/notebooks/* /home/jovyan/work/. # move notebooks
223+
uv pip install --system --no-cache-dir -r /srv/jupyterhub/working_with_cogstack_requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu/ ; \
224+
fi
232225

233226
#######################################################################################################
234227

requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
wheel==0.45.1
2-
medcat==2.2.0
3-
# TODO: cogstack-es
42
virtualenv==20.31.2
53
ipywidgets==8.1.7
64
requests>=2.32.2

0 commit comments

Comments
 (0)