Skip to content

Commit 2546f53

Browse files
authored
Merge pull request #375 from jupyter-naas/374-create-the-open-data-module-in-custom
feat: Implement the module system
2 parents 43ea5f5 + 10f7fee commit 2546f53

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+8339
-57
lines changed

Dockerfile

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
FROM python:3.9
22
WORKDIR /app
33

4+
# Install CA certificates
5+
RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificates
6+
47
COPY . .
58

69
RUN pip install poetry
710
RUN poetry config virtualenvs.in-project true
811

12+
# Install Rust toolchain
13+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
14+
RUN . "$HOME/.cargo/env"
15+
RUN pip install maturin[patchelf]
16+
17+
918
# Add build argument for architecture
1019
ARG TARGETARCH
1120

@@ -18,4 +27,4 @@ RUN if [ "$TARGETARCH" = "arm64" ]; then \
1827
&& unzip awscliv2.zip \
1928
&& ./aws/install
2029

21-
CMD ["poetry", "run", "chat-single-assistant"]
30+
CMD ["poetry", "run", "chat-single-assistant"]

Dockerfile.linux.x86_64

+3
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ ADD ./.git /app/.git
1515
RUN pip install poetry
1616
RUN poetry install
1717

18+
# Install siteanalyzer integration
19+
RUN poetry run python -m pip install --force-reinstall /app/src/core/integrations/siteanalyzer/target/wheels/*.whl
20+
1821
CMD ["poetry", "run", "api" ]

Makefile

+36-12
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1-
.venv:
2-
@ docker compose run --rm abi poetry install
1+
2+
DEPENDENCIES = src/core/integrations/siteanalyzer/target/wheels/siteanalyzer-*.whl
3+
4+
src/core/integrations/siteanalyzer/target/wheels/siteanalyzer-*.whl:
5+
@ make -C src/core/integrations/siteanalyzer release
6+
7+
.venv: $(DEPENDENCIES)
8+
#@ make src/core/integrations/siteanalyzer/target/wheels/siteanalyzer-*.whl
9+
@ docker compose run --rm --remove-orphans abi poetry install
10+
@ docker compose run --rm --remove-orphans abi bash -c 'poetry run python -m pip install --force-reinstall /app/src/core/integrations/siteanalyzer/target/wheels/*.whl'
11+
12+
dev-build:
13+
@ docker compose build
314

415
install:
5-
@ docker compose run --rm abi poetry install
6-
@ docker compose run --rm abi poetry update abi
16+
@ docker compose run --rm --remove-orphans abi poetry install
17+
@ docker compose run --rm --remove-orphans abi poetry update abi
718

819
abi-add: .venv
920
@ docker compose run --rm abi bash -c 'cd lib && poetry add $(dep) && poetry lock'
@@ -12,27 +23,36 @@ add:
1223
@ docker compose run --rm abi bash -c 'poetry add $(dep) && poetry lock'
1324

1425
lock:
15-
@ docker compose run --rm abi poetry lock --no-update
26+
@ docker compose run --rm --remove-orphans abi poetry lock
1627

1728
path=tests/
1829
test:
19-
@ docker compose run --rm abi poetry run pytest $(path)
30+
@ docker compose run --rm --remove-orphans abi poetry run pytest $(path)
2031

2132
sh: .venv
22-
@ docker compose run --rm -it abi bash
33+
@ docker compose run --rm --remove-orphans -it abi bash
2334

2435
api: .venv
25-
@ docker compose run --rm -p 9879:9879 abi poetry run api
36+
@ docker compose run --rm --remove-orphans -p 9879:9879 abi poetry run api
2637

2738

2839
dvc-login: .venv
29-
@ docker compose run --rm abi bash -c 'poetry run python scripts/setup_dvc.py | sh'
40+
@ docker compose run --rm --remove-orphans abi bash -c 'poetry run python scripts/setup_dvc.py | sh'
3041

3142
storage-pull: .venv
32-
@ docker compose run --rm abi bash -c 'poetry run python scripts/storage_pull.py | sh'
43+
@ docker compose run --rm --remove-orphans abi bash -c 'poetry run python scripts/storage_pull.py | sh'
3344

3445
storage-push: .venv
35-
@ docker compose run --rm abi bash -c 'poetry run python scripts/storage_push.py | sh'
46+
@ docker compose run --rm --remove-orphans abi bash -c 'poetry run python scripts/storage_push.py | sh'
47+
48+
clean:
49+
docker compose down
50+
docker compose rm -f
51+
rm -rf src/core/integrations/siteanalyzer/target
52+
rm -rf .venv
53+
rm -rf dist
54+
rm -rf lib/.venv
55+
docker compose build --no-cache
3656

3757
# Docker Build Commands
3858
# -------------------
@@ -48,7 +68,7 @@ build: build.linux.x86_64
4868
# - Image name: abi
4969
# - Dockerfile: Dockerfile.linux.x86_64
5070
# - Platform: linux/amd64 (ensures consistent builds on x86_64/amd64 architecture)
51-
build.linux.x86_64:
71+
build.linux.x86_64: .venv
5272
docker build . -t abi -f Dockerfile.linux.x86_64 --platform linux/amd64
5373

5474
# -------------------------------------------------------------------------------------------------
@@ -200,6 +220,10 @@ chat-glassdoor-agent: .venv
200220
chat-powerpoint-agent: .venv
201221
@ docker compose run abi bash -c 'poetry install && poetry run chat-powerpoint-agent'
202222

223+
chat-osint-investigator-agent: .venv
224+
@ docker compose run abi bash -c 'poetry install && poetry run python -m src.core.apps.terminal_agent.main generic_run_agent OSINTInvestigatorAssistant'
225+
226+
203227
.DEFAULT_GOAL := chat-supervisor-agent
204228

205229
.PHONY: test chat-supervisor-agent chat-support-agent chat-content-agent chat-finance-agent chat-growth-agent chat-opendata-agent chat-operations-agent chat-sales-agent api sh lock add abi-add

docker-compose.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
services:
32
abi:
43
build: .
@@ -7,7 +6,11 @@ services:
76
- 8501:8501
87
volumes:
98
- .:/app
9+
- cargo-cache:/root/.cargo
1010
environment:
1111
- PYTHONPATH=/app
1212
- ENV=dev
13-
command: ["poetry", "run"]
13+
command: ["poetry", "run"]
14+
15+
volumes:
16+
cargo-cache:

0 commit comments

Comments
 (0)