[ci] use python docker image 3.11, bump to version 1.4.1
Browse files- Dockerfile +18 -18
- dockerfiles/dockerfile-samgis-base +19 -28
- dockerfiles/dockerfile-samgis-base-with-lambda-support +131 -0
- docs/Changelog.md +7 -0
- pyproject.toml +3 -2
Dockerfile
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
-
FROM registry.gitlab.com/aletrn/gis-prediction:1.
|
2 |
|
3 |
# Include global arg in this stage of the build
|
4 |
-
ARG
|
5 |
-
ARG PYTHONPATH="${
|
6 |
-
ENV VIRTUAL_ENV=${
|
7 |
-
PATH="${
|
8 |
ENV IS_AWS_LAMBDA=""
|
9 |
|
10 |
# Set working directory to function root directory
|
11 |
-
WORKDIR ${
|
12 |
|
13 |
-
COPY samgis ${
|
14 |
-
COPY wrappers ${
|
15 |
-
COPY pyproject.toml poetry.lock README.md ${
|
16 |
RUN echo "# install samgis #" && pip install .
|
17 |
|
18 |
RUN ls -l /usr/bin/which
|
@@ -20,10 +20,10 @@ RUN /usr/bin/which python
|
|
20 |
RUN python -v
|
21 |
RUN echo "PYTHONPATH: ${PYTHONPATH}."
|
22 |
RUN echo "PATH: ${PATH}."
|
23 |
-
RUN echo "
|
24 |
-
RUN ls -l ${
|
25 |
-
RUN ls -ld ${
|
26 |
-
RUN ls -l ${
|
27 |
RUN python -c "import sys; print(sys.path)"
|
28 |
RUN python -c "import cv2"
|
29 |
RUN python -c "import fastapi"
|
@@ -33,10 +33,10 @@ RUN python -c "import onnxruntime"
|
|
33 |
RUN python -c "import rasterio"
|
34 |
RUN python -c "import uvicorn"
|
35 |
RUN df -h
|
36 |
-
RUN ls -l ${
|
37 |
-
RUN ls -l ${
|
38 |
-
RUN ls -l ${
|
39 |
-
RUN ls -l ${
|
40 |
-
RUN ls -l ${
|
41 |
|
42 |
CMD ["uvicorn", "wrappers.fastapi_wrapper:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
FROM registry.gitlab.com/aletrn/gis-prediction:1.4.1
|
2 |
|
3 |
# Include global arg in this stage of the build
|
4 |
+
ARG WORKDIR_ROOT="/var/task"
|
5 |
+
ARG PYTHONPATH="${WORKDIR_ROOT}:${PYTHONPATH}:/usr/local/lib/python3/dist-packages"
|
6 |
+
ENV VIRTUAL_ENV=${WORKDIR_ROOT}/.venv \
|
7 |
+
PATH="${WORKDIR_ROOT}/.venv/bin:$PATH"
|
8 |
ENV IS_AWS_LAMBDA=""
|
9 |
|
10 |
# Set working directory to function root directory
|
11 |
+
WORKDIR ${WORKDIR_ROOT}
|
12 |
|
13 |
+
COPY samgis ${WORKDIR_ROOT}/samgis
|
14 |
+
COPY wrappers ${WORKDIR_ROOT}/wrappers
|
15 |
+
COPY pyproject.toml poetry.lock README.md ${WORKDIR_ROOT}
|
16 |
RUN echo "# install samgis #" && pip install .
|
17 |
|
18 |
RUN ls -l /usr/bin/which
|
|
|
20 |
RUN python -v
|
21 |
RUN echo "PYTHONPATH: ${PYTHONPATH}."
|
22 |
RUN echo "PATH: ${PATH}."
|
23 |
+
RUN echo "WORKDIR_ROOT: ${WORKDIR_ROOT}."
|
24 |
+
RUN ls -l ${WORKDIR_ROOT}
|
25 |
+
RUN ls -ld ${WORKDIR_ROOT}
|
26 |
+
RUN ls -l ${WORKDIR_ROOT}/machine_learning_models
|
27 |
RUN python -c "import sys; print(sys.path)"
|
28 |
RUN python -c "import cv2"
|
29 |
RUN python -c "import fastapi"
|
|
|
33 |
RUN python -c "import rasterio"
|
34 |
RUN python -c "import uvicorn"
|
35 |
RUN df -h
|
36 |
+
RUN ls -l ${WORKDIR_ROOT}/samgis/
|
37 |
+
RUN ls -l ${WORKDIR_ROOT}/wrappers/
|
38 |
+
RUN ls -l ${WORKDIR_ROOT}/static/
|
39 |
+
RUN ls -l ${WORKDIR_ROOT}/static/dist
|
40 |
+
RUN ls -l ${WORKDIR_ROOT}/static/node_modules
|
41 |
|
42 |
CMD ["uvicorn", "wrappers.fastapi_wrapper:app", "--host", "0.0.0.0", "--port", "7860"]
|
dockerfiles/dockerfile-samgis-base
CHANGED
@@ -1,31 +1,28 @@
|
|
1 |
# Include global ARGs at the dockerfile top
|
2 |
ARG ARCH="x86_64"
|
3 |
-
ARG
|
4 |
-
ARG FASTAPI_STATIC="${
|
5 |
-
ARG PYTHONPATH="${
|
6 |
ARG POETRY_NO_INTERACTION=1
|
7 |
ARG POETRY_VIRTUALENVS_IN_PROJECT=1
|
8 |
ARG POETRY_VIRTUALENVS_CREATE=1
|
9 |
ARG POETRY_CACHE_DIR=/tmp/poetry_cache
|
10 |
-
ARG RIE="https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie"
|
11 |
|
12 |
|
13 |
-
FROM python:3.
|
14 |
|
15 |
ARG ARCH
|
16 |
-
ARG
|
17 |
ARG PYTHONPATH
|
18 |
ARG POETRY_NO_INTERACTION
|
19 |
ARG POETRY_VIRTUALENVS_IN_PROJECT
|
20 |
ARG POETRY_VIRTUALENVS_CREATE
|
21 |
ARG POETRY_CACHE_DIR
|
22 |
-
ARG RIE
|
23 |
ARG DEPENDENCY_GROUP
|
24 |
ARG ZLIB1G="http://ftp.it.debian.org/debian/pool/main/z/zlib/zlib1g_1.3.dfsg-3+b1_amd64.deb"
|
25 |
|
26 |
RUN echo "ARCH: $ARCH ..."
|
27 |
|
28 |
-
RUN echo "ARG RIE: $RIE ..."
|
29 |
RUN echo "ARG POETRY_CACHE_DIR: ${POETRY_CACHE_DIR} ..."
|
30 |
RUN echo "ARG PYTHONPATH: $PYTHONPATH ..."
|
31 |
RUN test -n ${DEPENDENCY_GROUP:?}
|
@@ -33,8 +30,8 @@ RUN echo "python DEPENDENCY_GROUP: ${DEPENDENCY_GROUP} ..."
|
|
33 |
RUN echo "arg dep:"
|
34 |
|
35 |
# Set working directory to function root directory
|
36 |
-
WORKDIR ${
|
37 |
-
COPY requirements_poetry.txt pyproject.toml poetry.lock README.md ${
|
38 |
|
39 |
# avoid segment-geospatial exception caused by missing libGL.so.1 library
|
40 |
RUN echo "BUILDER: check libz.s* before start" && ls -l /usr/lib/${ARCH}-linux-gnu/libz.so*
|
@@ -45,24 +42,23 @@ RUN apt update && apt install -t trixie zlib1g -y && apt clean
|
|
45 |
RUN echo "BUILDER: check libz.s* after install from trixie" && ls -l /usr/lib/${ARCH}-linux-gnu/libz.so*
|
46 |
|
47 |
RUN ls -l /etc/apt/sources* /etc/apt/preferences*
|
48 |
-
RUN curl -Lo /usr/local/bin/aws-lambda-rie ${RIE}
|
49 |
|
50 |
-
# poetry installation path is NOT within ${
|
51 |
-
RUN python -m pip install -r ${
|
52 |
|
53 |
RUN which poetry && poetry --version && poetry config --list
|
54 |
-
RUN poetry config virtualenvs.path ${
|
55 |
RUN echo "# poetry config --list #" && poetry config --list
|
56 |
RUN poetry install --with ${DEPENDENCY_GROUP} --no-root
|
57 |
|
58 |
|
59 |
-
FROM python:3.
|
60 |
|
61 |
ARG ARCH
|
62 |
-
ARG
|
63 |
|
64 |
-
ENV VIRTUAL_ENV=${
|
65 |
-
PATH="${
|
66 |
|
67 |
RUN echo "COPY --from=builder_global /usr/lib/${ARCH}-linux-gnu/libGL.so* /usr/lib/${ARCH}-linux-gnu/"
|
68 |
COPY --from=builder_global /usr/lib/${ARCH}-linux-gnu/libGL.so* /usr/lib/${ARCH}-linux-gnu/
|
@@ -70,16 +66,11 @@ RUN echo "RUNTIME: check libz.s* before upgrade" && ls -l /usr/lib/${ARCH}-linux
|
|
70 |
RUN echo "RUNTIME: remove libz.s* to force upgrade" && rm /usr/lib/${ARCH}-linux-gnu/libz.so*
|
71 |
COPY --from=builder_global /usr/lib/${ARCH}-linux-gnu/libz.so* /usr/lib/${ARCH}-linux-gnu/
|
72 |
RUN echo "RUNTIME: check libz.s* after copy" && ls -l /usr/lib/${ARCH}-linux-gnu/libz.so*
|
73 |
-
COPY --from=builder_global ${
|
74 |
|
75 |
-
RUN echo "new
|
76 |
-
RUN ls -ld ${
|
77 |
-
RUN ls -lA ${
|
78 |
-
|
79 |
-
COPY --from=builder_global /usr/local/bin/aws-lambda-rie /usr/local/bin/aws-lambda-rie
|
80 |
-
RUN chmod +x /usr/local/bin/aws-lambda-rie
|
81 |
-
COPY ./scripts/lambda-entrypoint.sh /lambda-entrypoint.sh
|
82 |
-
RUN chmod +x /lambda-entrypoint.sh
|
83 |
|
84 |
|
85 |
### conditional section
|
@@ -126,6 +117,6 @@ FROM runtime
|
|
126 |
ARG FASTAPI_STATIC
|
127 |
RUN mkdir ${FASTAPI_STATIC}
|
128 |
|
129 |
-
COPY ./machine_learning_models ${
|
130 |
COPY --from=node_prod_deps /appnode/node_modules* ${FASTAPI_STATIC}/node_modules
|
131 |
COPY --from=node_build /appnode/dist* ${FASTAPI_STATIC}/dist
|
|
|
1 |
# Include global ARGs at the dockerfile top
|
2 |
ARG ARCH="x86_64"
|
3 |
+
ARG WORKDIR_ROOT="/var/task"
|
4 |
+
ARG FASTAPI_STATIC="${WORKDIR_ROOT}/static"
|
5 |
+
ARG PYTHONPATH="${WORKDIR_ROOT}:${PYTHONPATH}:/usr/local/lib/python3/dist-packages"
|
6 |
ARG POETRY_NO_INTERACTION=1
|
7 |
ARG POETRY_VIRTUALENVS_IN_PROJECT=1
|
8 |
ARG POETRY_VIRTUALENVS_CREATE=1
|
9 |
ARG POETRY_CACHE_DIR=/tmp/poetry_cache
|
|
|
10 |
|
11 |
|
12 |
+
FROM python:3.11-bookworm as builder_global
|
13 |
|
14 |
ARG ARCH
|
15 |
+
ARG WORKDIR_ROOT
|
16 |
ARG PYTHONPATH
|
17 |
ARG POETRY_NO_INTERACTION
|
18 |
ARG POETRY_VIRTUALENVS_IN_PROJECT
|
19 |
ARG POETRY_VIRTUALENVS_CREATE
|
20 |
ARG POETRY_CACHE_DIR
|
|
|
21 |
ARG DEPENDENCY_GROUP
|
22 |
ARG ZLIB1G="http://ftp.it.debian.org/debian/pool/main/z/zlib/zlib1g_1.3.dfsg-3+b1_amd64.deb"
|
23 |
|
24 |
RUN echo "ARCH: $ARCH ..."
|
25 |
|
|
|
26 |
RUN echo "ARG POETRY_CACHE_DIR: ${POETRY_CACHE_DIR} ..."
|
27 |
RUN echo "ARG PYTHONPATH: $PYTHONPATH ..."
|
28 |
RUN test -n ${DEPENDENCY_GROUP:?}
|
|
|
30 |
RUN echo "arg dep:"
|
31 |
|
32 |
# Set working directory to function root directory
|
33 |
+
WORKDIR ${WORKDIR_ROOT}
|
34 |
+
COPY requirements_poetry.txt pyproject.toml poetry.lock README.md ${WORKDIR_ROOT}/
|
35 |
|
36 |
# avoid segment-geospatial exception caused by missing libGL.so.1 library
|
37 |
RUN echo "BUILDER: check libz.s* before start" && ls -l /usr/lib/${ARCH}-linux-gnu/libz.so*
|
|
|
42 |
RUN echo "BUILDER: check libz.s* after install from trixie" && ls -l /usr/lib/${ARCH}-linux-gnu/libz.so*
|
43 |
|
44 |
RUN ls -l /etc/apt/sources* /etc/apt/preferences*
|
|
|
45 |
|
46 |
+
# poetry installation path is NOT within ${WORKDIR_ROOT}: not needed for runtime docker image
|
47 |
+
RUN python -m pip install -r ${WORKDIR_ROOT}/requirements_poetry.txt
|
48 |
|
49 |
RUN which poetry && poetry --version && poetry config --list
|
50 |
+
RUN poetry config virtualenvs.path ${WORKDIR_ROOT}
|
51 |
RUN echo "# poetry config --list #" && poetry config --list
|
52 |
RUN poetry install --with ${DEPENDENCY_GROUP} --no-root
|
53 |
|
54 |
|
55 |
+
FROM python:3.11-slim-bookworm as runtime
|
56 |
|
57 |
ARG ARCH
|
58 |
+
ARG WORKDIR_ROOT
|
59 |
|
60 |
+
ENV VIRTUAL_ENV=${WORKDIR_ROOT}/.venv \
|
61 |
+
PATH="${WORKDIR_ROOT}/.venv/bin:$PATH"
|
62 |
|
63 |
RUN echo "COPY --from=builder_global /usr/lib/${ARCH}-linux-gnu/libGL.so* /usr/lib/${ARCH}-linux-gnu/"
|
64 |
COPY --from=builder_global /usr/lib/${ARCH}-linux-gnu/libGL.so* /usr/lib/${ARCH}-linux-gnu/
|
|
|
66 |
RUN echo "RUNTIME: remove libz.s* to force upgrade" && rm /usr/lib/${ARCH}-linux-gnu/libz.so*
|
67 |
COPY --from=builder_global /usr/lib/${ARCH}-linux-gnu/libz.so* /usr/lib/${ARCH}-linux-gnu/
|
68 |
RUN echo "RUNTIME: check libz.s* after copy" && ls -l /usr/lib/${ARCH}-linux-gnu/libz.so*
|
69 |
+
COPY --from=builder_global ${WORKDIR_ROOT}/.venv ${WORKDIR_ROOT}/.venv
|
70 |
|
71 |
+
RUN echo "new WORKDIR_ROOT after hidden venv copy => ${WORKDIR_ROOT}"
|
72 |
+
RUN ls -ld ${WORKDIR_ROOT}/
|
73 |
+
RUN ls -lA ${WORKDIR_ROOT}/
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
|
76 |
### conditional section
|
|
|
117 |
ARG FASTAPI_STATIC
|
118 |
RUN mkdir ${FASTAPI_STATIC}
|
119 |
|
120 |
+
COPY ./machine_learning_models ${WORKDIR_ROOT}/machine_learning_models
|
121 |
COPY --from=node_prod_deps /appnode/node_modules* ${FASTAPI_STATIC}/node_modules
|
122 |
COPY --from=node_build /appnode/dist* ${FASTAPI_STATIC}/dist
|
dockerfiles/dockerfile-samgis-base-with-lambda-support
ADDED
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Include global ARGs at the dockerfile top
|
2 |
+
ARG ARCH="x86_64"
|
3 |
+
ARG LAMBDA_TASK_ROOT="/var/task"
|
4 |
+
ARG FASTAPI_STATIC="${LAMBDA_TASK_ROOT}/static"
|
5 |
+
ARG PYTHONPATH="${LAMBDA_TASK_ROOT}:${PYTHONPATH}:/usr/local/lib/python3/dist-packages"
|
6 |
+
ARG POETRY_NO_INTERACTION=1
|
7 |
+
ARG POETRY_VIRTUALENVS_IN_PROJECT=1
|
8 |
+
ARG POETRY_VIRTUALENVS_CREATE=1
|
9 |
+
ARG POETRY_CACHE_DIR=/tmp/poetry_cache
|
10 |
+
ARG RIE="https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie"
|
11 |
+
|
12 |
+
|
13 |
+
FROM python:3.11-bookworm as builder_global
|
14 |
+
|
15 |
+
ARG ARCH
|
16 |
+
ARG LAMBDA_TASK_ROOT
|
17 |
+
ARG PYTHONPATH
|
18 |
+
ARG POETRY_NO_INTERACTION
|
19 |
+
ARG POETRY_VIRTUALENVS_IN_PROJECT
|
20 |
+
ARG POETRY_VIRTUALENVS_CREATE
|
21 |
+
ARG POETRY_CACHE_DIR
|
22 |
+
ARG RIE
|
23 |
+
ARG DEPENDENCY_GROUP
|
24 |
+
ARG ZLIB1G="http://ftp.it.debian.org/debian/pool/main/z/zlib/zlib1g_1.3.dfsg-3+b1_amd64.deb"
|
25 |
+
|
26 |
+
RUN echo "ARCH: $ARCH ..."
|
27 |
+
|
28 |
+
RUN echo "ARG RIE: $RIE ..."
|
29 |
+
RUN echo "ARG POETRY_CACHE_DIR: ${POETRY_CACHE_DIR} ..."
|
30 |
+
RUN echo "ARG PYTHONPATH: $PYTHONPATH ..."
|
31 |
+
RUN test -n ${DEPENDENCY_GROUP:?}
|
32 |
+
RUN echo "python DEPENDENCY_GROUP: ${DEPENDENCY_GROUP} ..."
|
33 |
+
RUN echo "arg dep:"
|
34 |
+
|
35 |
+
# Set working directory to function root directory
|
36 |
+
WORKDIR ${LAMBDA_TASK_ROOT}
|
37 |
+
COPY requirements_poetry.txt pyproject.toml poetry.lock README.md ${LAMBDA_TASK_ROOT}/
|
38 |
+
|
39 |
+
# avoid segment-geospatial exception caused by missing libGL.so.1 library
|
40 |
+
RUN echo "BUILDER: check libz.s* before start" && ls -l /usr/lib/${ARCH}-linux-gnu/libz.so*
|
41 |
+
RUN apt update && apt install -y libgl1 curl python3-pip && apt clean
|
42 |
+
COPY ./dockerfiles/apt_preferences /etc/apt/preferences
|
43 |
+
COPY ./dockerfiles/debian.sources /etc/apt/sources.list.d/debian.sources
|
44 |
+
RUN apt update && apt install -t trixie zlib1g -y && apt clean
|
45 |
+
RUN echo "BUILDER: check libz.s* after install from trixie" && ls -l /usr/lib/${ARCH}-linux-gnu/libz.so*
|
46 |
+
|
47 |
+
RUN ls -l /etc/apt/sources* /etc/apt/preferences*
|
48 |
+
RUN if [ "${DEPENDENCY_GROUP}" = "fastapi" ]; then curl -Lo /usr/local/bin/aws-lambda-rie ${RIE}; fi
|
49 |
+
|
50 |
+
# poetry installation path is NOT within ${LAMBDA_TASK_ROOT}: not needed for runtime docker image
|
51 |
+
RUN python -m pip install -r ${LAMBDA_TASK_ROOT}/requirements_poetry.txt
|
52 |
+
|
53 |
+
RUN which poetry && poetry --version && poetry config --list
|
54 |
+
RUN poetry config virtualenvs.path ${LAMBDA_TASK_ROOT}
|
55 |
+
RUN echo "# poetry config --list #" && poetry config --list
|
56 |
+
RUN poetry install --with ${DEPENDENCY_GROUP} --no-root
|
57 |
+
|
58 |
+
|
59 |
+
FROM python:3.11-slim-bookworm as runtime
|
60 |
+
|
61 |
+
ARG ARCH
|
62 |
+
ARG LAMBDA_TASK_ROOT
|
63 |
+
|
64 |
+
ENV VIRTUAL_ENV=${LAMBDA_TASK_ROOT}/.venv \
|
65 |
+
PATH="${LAMBDA_TASK_ROOT}/.venv/bin:$PATH"
|
66 |
+
|
67 |
+
RUN echo "COPY --from=builder_global /usr/lib/${ARCH}-linux-gnu/libGL.so* /usr/lib/${ARCH}-linux-gnu/"
|
68 |
+
COPY --from=builder_global /usr/lib/${ARCH}-linux-gnu/libGL.so* /usr/lib/${ARCH}-linux-gnu/
|
69 |
+
RUN echo "RUNTIME: check libz.s* before upgrade" && ls -l /usr/lib/${ARCH}-linux-gnu/libz.so*
|
70 |
+
RUN echo "RUNTIME: remove libz.s* to force upgrade" && rm /usr/lib/${ARCH}-linux-gnu/libz.so*
|
71 |
+
COPY --from=builder_global /usr/lib/${ARCH}-linux-gnu/libz.so* /usr/lib/${ARCH}-linux-gnu/
|
72 |
+
RUN echo "RUNTIME: check libz.s* after copy" && ls -l /usr/lib/${ARCH}-linux-gnu/libz.so*
|
73 |
+
COPY --from=builder_global ${LAMBDA_TASK_ROOT}/.venv ${LAMBDA_TASK_ROOT}/.venv
|
74 |
+
|
75 |
+
RUN echo "new LAMBDA_TASK_ROOT after hidden venv copy => ${LAMBDA_TASK_ROOT}"
|
76 |
+
RUN ls -ld ${LAMBDA_TASK_ROOT}/
|
77 |
+
RUN ls -lA ${LAMBDA_TASK_ROOT}/
|
78 |
+
|
79 |
+
COPY --from=builder_global /usr/local/bin/aws-lambda-rie /usr/local/bin/aws-lambda-rie
|
80 |
+
RUN chmod +x /usr/local/bin/aws-lambda-rie
|
81 |
+
COPY ./scripts/lambda-entrypoint.sh /lambda-entrypoint.sh
|
82 |
+
RUN chmod +x /lambda-entrypoint.sh
|
83 |
+
|
84 |
+
|
85 |
+
### conditional section
|
86 |
+
FROM node:20-slim AS node_fastapi
|
87 |
+
|
88 |
+
ARG DEPENDENCY_GROUP
|
89 |
+
ENV PNPM_HOME="/pnpm"
|
90 |
+
ENV PATH="$PNPM_HOME:$PATH"
|
91 |
+
RUN corepack enable
|
92 |
+
|
93 |
+
COPY ./static /appnode
|
94 |
+
WORKDIR /appnode
|
95 |
+
# RUN if [ "${DEPENDENCY_GROUP}" = "fastapi" ]; then echo "pnpm store path:" && pnpm store path; fi
|
96 |
+
|
97 |
+
|
98 |
+
FROM node_fastapi AS node_prod_deps
|
99 |
+
|
100 |
+
ARG DEPENDENCY_GROUP
|
101 |
+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store if [ "${DEPENDENCY_GROUP}" = "fastapi" ]; then \
|
102 |
+
pnpm install --prod --frozen-lockfile; else \
|
103 |
+
echo "DEPENDENCY_GROUP 1: ${DEPENDENCY_GROUP} ..."; fi
|
104 |
+
# here multiple conditions concatenated to avoid failing on check
|
105 |
+
RUN if [ "${DEPENDENCY_GROUP}" = "fastapi" ]; then if [ ! -d /appnode/node_modules ]; then echo "no node_modules folder" && exit 1; fi; fi
|
106 |
+
|
107 |
+
|
108 |
+
FROM node_fastapi AS node_build
|
109 |
+
|
110 |
+
ARG DEPENDENCY_GROUP
|
111 |
+
ARG VITE__MAP_DESCRIPTION
|
112 |
+
ARG VITE__SAMGIS_SPACE
|
113 |
+
RUN echo "VITE__MAP_DESCRIPTION:" ${VITE__MAP_DESCRIPTION}
|
114 |
+
RUN echo "VITE__SAMGIS_SPACE:" ${VITE__SAMGIS_SPACE}
|
115 |
+
|
116 |
+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store if [ "${DEPENDENCY_GROUP}" = "fastapi" ]; then \
|
117 |
+
pnpm install --frozen-lockfile; else \
|
118 |
+
echo "DEPENDENCY_GROUP 2: ${DEPENDENCY_GROUP} ..."; fi
|
119 |
+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store if [ "${DEPENDENCY_GROUP}" = "fastapi" ]; then pnpm build; fi
|
120 |
+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store if [ "${DEPENDENCY_GROUP}" = "fastapi" ]; then \
|
121 |
+
pnpm tailwindcss -i /appnode/src/input.css -o /appnode/dist/output.css; fi
|
122 |
+
RUN if [ "${DEPENDENCY_GROUP}" = "fastapi" ]; then if [ ! -d /appnode/dist ]; then echo "no dist folder" && exit 1; fi; fi
|
123 |
+
|
124 |
+
|
125 |
+
FROM runtime
|
126 |
+
ARG FASTAPI_STATIC
|
127 |
+
RUN mkdir ${FASTAPI_STATIC}
|
128 |
+
|
129 |
+
COPY ./machine_learning_models ${LAMBDA_TASK_ROOT}/machine_learning_models
|
130 |
+
COPY --from=node_prod_deps /appnode/node_modules* ${FASTAPI_STATIC}/node_modules
|
131 |
+
COPY --from=node_build /appnode/dist* ${FASTAPI_STATIC}/dist
|
docs/Changelog.md
CHANGED
@@ -1,10 +1,17 @@
|
|
1 |
# Changelog
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
## Version 1.4.0
|
4 |
|
5 |
- add support for python 3.11
|
6 |
- add urls section used by [pypi.org](https://pypi.org/)
|
7 |
- update some vulnerable dependencies
|
|
|
8 |
|
9 |
## Version 1.3.0
|
10 |
|
|
|
1 |
# Changelog
|
2 |
|
3 |
+
## Version 1.4.1
|
4 |
+
|
5 |
+
- update base python docker image to bookworm-3.11
|
6 |
+
- move support for AWS lambda (aws-lambda-rie, lambda-entrypoint.sh) docker to separated dockerfile
|
7 |
+
- add Demo url entry in pyproject.toml file
|
8 |
+
|
9 |
## Version 1.4.0
|
10 |
|
11 |
- add support for python 3.11
|
12 |
- add urls section used by [pypi.org](https://pypi.org/)
|
13 |
- update some vulnerable dependencies
|
14 |
+
- update [email protected] to use python 3.11
|
15 |
|
16 |
## Version 1.3.0
|
17 |
|
pyproject.toml
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
[tool.poetry]
|
2 |
name = "samgis"
|
3 |
-
version = "1.
|
4 |
description = "A backend for machine learning instance segmentation on geospatial data even without dedicated graphics cards."
|
5 |
authors = ["alessandro trinca tornidor <[email protected]>"]
|
6 |
license = "MIT license"
|
@@ -8,10 +8,11 @@ readme = "README.md"
|
|
8 |
|
9 |
[metadata]
|
10 |
name = "samgis"
|
11 |
-
version = "1.4.
|
12 |
|
13 |
[tool.poetry.urls]
|
14 |
Source = "https://github.com/trincadev/samgis-be"
|
|
|
15 |
|
16 |
[tool.poetry.dependencies]
|
17 |
bson = "^0.5.10"
|
|
|
1 |
[tool.poetry]
|
2 |
name = "samgis"
|
3 |
+
version = "1.4.1"
|
4 |
description = "A backend for machine learning instance segmentation on geospatial data even without dedicated graphics cards."
|
5 |
authors = ["alessandro trinca tornidor <[email protected]>"]
|
6 |
license = "MIT license"
|
|
|
8 |
|
9 |
[metadata]
|
10 |
name = "samgis"
|
11 |
+
version = "1.4.1"
|
12 |
|
13 |
[tool.poetry.urls]
|
14 |
Source = "https://github.com/trincadev/samgis-be"
|
15 |
+
Demo = "https://huggingface.co/spaces/aletrn/samgis"
|
16 |
|
17 |
[tool.poetry.dependencies]
|
18 |
bson = "^0.5.10"
|