alessandro trinca tornidor
commited on
Commit
·
66ef4af
1
Parent(s):
50bc593
ci: docker, remove references to fastapi poetry group
Browse files- Dockerfile +8 -23
Dockerfile
CHANGED
@@ -7,8 +7,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 DEPENDENCY_GROUP=fastapi
|
11 |
-
|
12 |
|
13 |
FROM pytorch/pytorch:2.4.1-cuda12.4-cudnn9-runtime as builder_global
|
14 |
|
@@ -21,15 +19,11 @@ ARG POETRY_NO_INTERACTION
|
|
21 |
ARG POETRY_VIRTUALENVS_IN_PROJECT
|
22 |
ARG POETRY_VIRTUALENVS_CREATE
|
23 |
ARG POETRY_CACHE_DIR
|
24 |
-
ARG DEPENDENCY_GROUP
|
25 |
|
26 |
RUN echo "ARCH: $ARCH ..."
|
27 |
|
28 |
RUN echo "ARG POETRY_CACHE_DIR: ${POETRY_CACHE_DIR} ..."
|
29 |
RUN echo "ARG PYTHONPATH: $PYTHONPATH ..."
|
30 |
-
RUN test -n ${DEPENDENCY_GROUP:?}
|
31 |
-
RUN echo "python DEPENDENCY_GROUP: ${DEPENDENCY_GROUP} ..."
|
32 |
-
RUN echo "arg dep:"
|
33 |
|
34 |
# Set working directory to function root directory
|
35 |
WORKDIR ${LAMBDA_TASK_ROOT}
|
@@ -72,7 +66,7 @@ RUN echo "# poetry config --list #" && poetry config --list
|
|
72 |
RUN ls -ld ${LAMBDA_TASK_ROOT}/
|
73 |
#RUN . ${LAMBDA_TASK_ROOT}/.venv/bin/activate && ${LAMBDA_TASK_ROOT}/.venv/bin/python --version && ${LAMBDA_TASK_ROOT}/.venv/bin/python -m pip install pip wheel setuptools --upgrade
|
74 |
RUN poetry run python -m pip install pip wheel setuptools --upgrade
|
75 |
-
RUN poetry install --
|
76 |
|
77 |
RUN git clone https://huggingface.co/aletrn/sam-quantized/ ${LAMBDA_TASK_ROOT}/sam-quantized
|
78 |
RUN git clone -n --depth=1 --filter=tree:0 https://huggingface.co/spaces/aletrn/lisa-on-cuda ${LAMBDA_TASK_ROOT}/lisa-on-cuda && \
|
@@ -110,7 +104,6 @@ RUN ls -lA ${LAMBDA_TASK_ROOT}/.venv
|
|
110 |
### conditional section
|
111 |
FROM node:20-slim AS node_fastapi
|
112 |
|
113 |
-
ARG DEPENDENCY_GROUP
|
114 |
ENV PNPM_HOME="/pnpm"
|
115 |
ENV PATH="$PNPM_HOME:$PATH"
|
116 |
|
@@ -118,37 +111,29 @@ RUN corepack enable
|
|
118 |
|
119 |
COPY --from=builder_global ${LAMBDA_TASK_ROOT}/samgis-lisa-on-cuda/static /appnode
|
120 |
WORKDIR /appnode
|
121 |
-
# RUN
|
122 |
RUN ls -l /appnode
|
123 |
RUN ls -l /appnode/list_files.html
|
124 |
|
125 |
|
126 |
FROM node_fastapi AS node_prod_deps
|
127 |
|
128 |
-
|
129 |
-
RUN --mount=type=cache,id=pnpm,target=/pnpm/store if [ "${DEPENDENCY_GROUP}" = "fastapi" ]; then \
|
130 |
-
pnpm install --prod --frozen-lockfile; else \
|
131 |
-
echo "DEPENDENCY_GROUP 1: ${DEPENDENCY_GROUP} ..."; fi
|
132 |
# here multiple conditions concatenated to avoid failing on check
|
133 |
-
RUN if [
|
134 |
-
echo "no node_modules folder" && exit 1; fi; fi
|
135 |
|
136 |
|
137 |
FROM node_fastapi AS node_build
|
138 |
|
139 |
-
ARG DEPENDENCY_GROUP
|
140 |
ARG VITE__MAP_DESCRIPTION
|
141 |
ARG VITE__SAMGIS_SPACE
|
142 |
RUN echo "VITE__MAP_DESCRIPTION:" ${VITE__MAP_DESCRIPTION}
|
143 |
RUN echo "VITE__SAMGIS_SPACE:" ${VITE__SAMGIS_SPACE}
|
144 |
|
145 |
-
RUN --mount=type=cache,id=pnpm,target=/pnpm/store
|
146 |
-
|
147 |
-
|
148 |
-
RUN
|
149 |
-
RUN --mount=type=cache,id=pnpm,target=/pnpm/store if [ "${DEPENDENCY_GROUP}" = "fastapi" ]; then \
|
150 |
-
pnpm tailwindcss -i /appnode/src/input.css -o /appnode/dist/output.css; fi
|
151 |
-
RUN if [ "${DEPENDENCY_GROUP}" = "fastapi" ]; then if [ ! -d /appnode/dist ]; then echo "no dist folder" && exit 1; fi; fi
|
152 |
|
153 |
|
154 |
FROM runtime
|
|
|
7 |
ARG POETRY_VIRTUALENVS_IN_PROJECT=1
|
8 |
ARG POETRY_VIRTUALENVS_CREATE=1
|
9 |
ARG POETRY_CACHE_DIR=/tmp/poetry_cache
|
|
|
|
|
10 |
|
11 |
FROM pytorch/pytorch:2.4.1-cuda12.4-cudnn9-runtime as builder_global
|
12 |
|
|
|
19 |
ARG POETRY_VIRTUALENVS_IN_PROJECT
|
20 |
ARG POETRY_VIRTUALENVS_CREATE
|
21 |
ARG POETRY_CACHE_DIR
|
|
|
22 |
|
23 |
RUN echo "ARCH: $ARCH ..."
|
24 |
|
25 |
RUN echo "ARG POETRY_CACHE_DIR: ${POETRY_CACHE_DIR} ..."
|
26 |
RUN echo "ARG PYTHONPATH: $PYTHONPATH ..."
|
|
|
|
|
|
|
27 |
|
28 |
# Set working directory to function root directory
|
29 |
WORKDIR ${LAMBDA_TASK_ROOT}
|
|
|
66 |
RUN ls -ld ${LAMBDA_TASK_ROOT}/
|
67 |
#RUN . ${LAMBDA_TASK_ROOT}/.venv/bin/activate && ${LAMBDA_TASK_ROOT}/.venv/bin/python --version && ${LAMBDA_TASK_ROOT}/.venv/bin/python -m pip install pip wheel setuptools --upgrade
|
68 |
RUN poetry run python -m pip install pip wheel setuptools --upgrade
|
69 |
+
RUN poetry install --no-root --no-cache
|
70 |
|
71 |
RUN git clone https://huggingface.co/aletrn/sam-quantized/ ${LAMBDA_TASK_ROOT}/sam-quantized
|
72 |
RUN git clone -n --depth=1 --filter=tree:0 https://huggingface.co/spaces/aletrn/lisa-on-cuda ${LAMBDA_TASK_ROOT}/lisa-on-cuda && \
|
|
|
104 |
### conditional section
|
105 |
FROM node:20-slim AS node_fastapi
|
106 |
|
|
|
107 |
ENV PNPM_HOME="/pnpm"
|
108 |
ENV PATH="$PNPM_HOME:$PATH"
|
109 |
|
|
|
111 |
|
112 |
COPY --from=builder_global ${LAMBDA_TASK_ROOT}/samgis-lisa-on-cuda/static /appnode
|
113 |
WORKDIR /appnode
|
114 |
+
# RUN echo "pnpm store path:" && pnpm store path
|
115 |
RUN ls -l /appnode
|
116 |
RUN ls -l /appnode/list_files.html
|
117 |
|
118 |
|
119 |
FROM node_fastapi AS node_prod_deps
|
120 |
|
121 |
+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
|
|
|
|
|
|
|
122 |
# here multiple conditions concatenated to avoid failing on check
|
123 |
+
RUN if [ ! -d /appnode/node_modules ]; then echo "no node_modules folder" && exit 1; fi
|
|
|
124 |
|
125 |
|
126 |
FROM node_fastapi AS node_build
|
127 |
|
|
|
128 |
ARG VITE__MAP_DESCRIPTION
|
129 |
ARG VITE__SAMGIS_SPACE
|
130 |
RUN echo "VITE__MAP_DESCRIPTION:" ${VITE__MAP_DESCRIPTION}
|
131 |
RUN echo "VITE__SAMGIS_SPACE:" ${VITE__SAMGIS_SPACE}
|
132 |
|
133 |
+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
134 |
+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm build
|
135 |
+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm tailwindcss -i /appnode/src/input.css -o /appnode/dist/output.css
|
136 |
+
RUN if [ ! -d /appnode/dist ]; then echo "no dist folder" && exit 1; fi
|
|
|
|
|
|
|
137 |
|
138 |
|
139 |
FROM runtime
|