Skip to content

Commit

Permalink
CI Testing multiple projects (not clean) (#130)
Browse files Browse the repository at this point in the history
* updated shared model tests

* [feat] testing multiple projects (not clean)

* [bug] python 3.11 minimum?

* [bug] ./ might be an issue?

* [bug] two extra "

---------

Co-authored-by: Francois <[email protected]>
  • Loading branch information
ctr26 and sherwoodf committed Aug 2, 2024
1 parent 778cf9c commit 02a27b7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion api/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.cwd": "${workspaceFolder}",
"python.testing.cwd": "${workspaceFolder}/api",
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true
Expand Down
20 changes: 8 additions & 12 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,23 @@ FROM python:3.10.0

EXPOSE 8080


# Override default shell and use bash and bia env
#RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
# /bin/bash ~/miniconda.sh -b -p /opt/conda
#ENV PATH=/opt/conda/bin:$PATH
#RUN conda env create -f conda_env.yml

RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH=/root/.local/bin:$PATH

# add files that poetry needs first so layers up to (including) pulling dependencies get reused
WORKDIR /bia-integrator

# only add poetry.lock if it exists (building on local)
ADD ./poetry.lock* /integrator-api/poetry.lock
ADD ./pyproject.toml /integrator-api/pyproject.toml
WORKDIR /integrator-api
ADD ./api/poetry.lock* api/poetry.lock
ADD ./api/pyproject.toml api/pyproject.toml
ADD ./bia-shared-datamodels bia-shared-datamodels

WORKDIR /bia-integrator/api
RUN poetry install

# Everything up to here should be reused most times

# add the actual project, which is what is often changed in between two different container builds
ADD ./ /integrator-api
ADD ./api ./

CMD ["poetry", "run", "uvicorn", "--workers", "4", "--port", "8080", "--log-config", "./src/log_config.yml", "--host", "0.0.0.0", "src.app:app"]
CMD ["poetry", "run", "uvicorn", "--workers", "4", "--port", "8080", "--log-config", "./api/log_config.yml", "--host", "0.0.0.0", "api.app:app"]
2 changes: 2 additions & 0 deletions api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ ome-types = "^0.4.2"
xsdata = "23.8"
lxml = "^4.9.3"
json-log-formatter = "^1.0"
#@TODO: CHANGEME
bia-shared-datamodels = { path = "../../prs/bia-integrator/bia-shared-datamodels", develop = true }

[tool.poetry.group.dev.dependencies]
locust = "^2.16.1"
Expand Down
File renamed without changes.

0 comments on commit 02a27b7

Please sign in to comment.