alessandro trinca tornidor
commited on
Commit
·
2dfa32a
1
Parent(s):
7b3c19b
ci: docker, add docker_entrypoint.sh and entrypoint.sh scripts to root project, remove AWS lambda scripts
Browse files
Dockerfile
CHANGED
@@ -36,8 +36,9 @@ RUN git clone https://huggingface.co/spaces/aletrn/samgis-lisa-on-cuda ${LAMBDA_
|
|
36 |
cp ${LAMBDA_TASK_ROOT}/samgis-lisa-on-cuda/pyproject.toml ${LAMBDA_TASK_ROOT}/pyproject.toml && \
|
37 |
ls -l ${LAMBDA_TASK_ROOT}/samgis-lisa-on-cuda/poetry.lock && \
|
38 |
cp ${LAMBDA_TASK_ROOT}/samgis-lisa-on-cuda/poetry.lock ${LAMBDA_TASK_ROOT}/poetry.lock &&
|
39 |
-
COPY ${LAMBDA_TASK_ROOT}/
|
40 |
-
|
|
|
41 |
RUN add-apt-repository "deb http://archive.ubuntu.com/ubuntu jammy main universe restricted multiverse" && \
|
42 |
add-apt-repository "deb http://archive.ubuntu.com/ubuntu jammy-security main universe restricted multiverse" && \
|
43 |
add-apt-repository "deb http://archive.ubuntu.com/ubuntu jammy-updates main universe restricted multiverse" && \
|
@@ -167,10 +168,9 @@ ENV IS_AWS_LAMBDA=""
|
|
167 |
# Set working directory to function root directory
|
168 |
WORKDIR ${LAMBDA_TASK_ROOT}
|
169 |
|
170 |
-
|
171 |
-
RUN chmod +x
|
172 |
-
RUN
|
173 |
-
RUN ls -l ${LAMBDA_TASK_ROOT}/scripts/entrypoint.sh ${LAMBDA_TASK_ROOT}/scripts/docker_entrypoint.sh
|
174 |
|
175 |
RUN ls -l /usr/bin/which
|
176 |
RUN /usr/bin/which python
|
@@ -200,4 +200,4 @@ RUN ls -l ${FASTAPI_STATIC}/ || true
|
|
200 |
RUN ls -l ${FASTAPI_STATIC}/dist || true
|
201 |
RUN ls -l ${FASTAPI_STATIC}/node_modules || true
|
202 |
|
203 |
-
CMD ["/var/task/
|
|
|
36 |
cp ${LAMBDA_TASK_ROOT}/samgis-lisa-on-cuda/pyproject.toml ${LAMBDA_TASK_ROOT}/pyproject.toml && \
|
37 |
ls -l ${LAMBDA_TASK_ROOT}/samgis-lisa-on-cuda/poetry.lock && \
|
38 |
cp ${LAMBDA_TASK_ROOT}/samgis-lisa-on-cuda/poetry.lock ${LAMBDA_TASK_ROOT}/poetry.lock &&
|
39 |
+
COPY ${LAMBDA_TASK_ROOT}/docker_entrypoint.sh ${LAMBDA_TASK_ROOT}
|
40 |
+
COPY ${LAMBDA_TASK_ROOT}/entrypoint.sh ${LAMBDA_TASK_ROOT}
|
41 |
+
RUN ls -l /etc/apt/preferences ${LAMBDA_TASK_ROOT}/pyproject.toml
|
42 |
RUN add-apt-repository "deb http://archive.ubuntu.com/ubuntu jammy main universe restricted multiverse" && \
|
43 |
add-apt-repository "deb http://archive.ubuntu.com/ubuntu jammy-security main universe restricted multiverse" && \
|
44 |
add-apt-repository "deb http://archive.ubuntu.com/ubuntu jammy-updates main universe restricted multiverse" && \
|
|
|
168 |
# Set working directory to function root directory
|
169 |
WORKDIR ${LAMBDA_TASK_ROOT}
|
170 |
|
171 |
+
RUN chmod +x ${LAMBDA_TASK_ROOT}/entrypoint.sh
|
172 |
+
RUN chmod +x ${LAMBDA_TASK_ROOT}/docker_entrypoint.sh
|
173 |
+
RUN ls -l ${LAMBDA_TASK_ROOT}/entrypoint.sh ${LAMBDA_TASK_ROOT}/docker_entrypoint.sh
|
|
|
174 |
|
175 |
RUN ls -l /usr/bin/which
|
176 |
RUN /usr/bin/which python
|
|
|
200 |
RUN ls -l ${FASTAPI_STATIC}/dist || true
|
201 |
RUN ls -l ${FASTAPI_STATIC}/node_modules || true
|
202 |
|
203 |
+
CMD ["/var/task/docker_entrypoint.sh"]
|
scripts/docker_entrypoint.sh → docker_entrypoint.sh
RENAMED
@@ -8,9 +8,8 @@ source ${WORKDIR}/.venv/bin/activate
|
|
8 |
|
9 |
which python
|
10 |
python --version
|
11 |
-
python ${WORKDIR}/scripts/create_folders_and_variables_if_not_exists.py
|
12 |
|
13 |
-
chmod +x ${WORKDIR}/
|
14 |
-
bash ${WORKDIR}/
|
15 |
|
16 |
exit 0
|
|
|
8 |
|
9 |
which python
|
10 |
python --version
|
|
|
11 |
|
12 |
+
chmod +x ${WORKDIR}/entrypoint.sh
|
13 |
+
bash ${WORKDIR}/entrypoint.sh
|
14 |
|
15 |
exit 0
|
scripts/entrypoint.sh → entrypoint.sh
RENAMED
File without changes
|
scripts/aws-lambda-rie
DELETED
File without changes
|
scripts/lambda-entrypoint.sh
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
#!/bin/sh
|
2 |
-
|
3 |
-
# default value for PYTHONBIN=/usr/local/bin/python
|
4 |
-
# but it change because of poetry that it uses a virtualenv installed within the LAMBDA_TASK_ROOT=/var/task
|
5 |
-
|
6 |
-
echo "python installation path and version:"
|
7 |
-
which python
|
8 |
-
python --version
|
9 |
-
|
10 |
-
echo "lambda-entrypoint.sh: PYTHONPATH ${PYTHONPATH} ..."
|
11 |
-
echo "lambda-entrypoint.sh: PATH ${PATH} ..."
|
12 |
-
|
13 |
-
if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then
|
14 |
-
exec /usr/local/bin/aws-lambda-rie python -m awslambdaric "$@"
|
15 |
-
else
|
16 |
-
exec python -m awslambdaric "$@"
|
17 |
-
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|