Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Script recalcul calque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ERASME
Script recalcul calque
Commits
abc62ccf
Commit
abc62ccf
authored
2 years ago
by
Pierre-Gilles Levallois
Browse files
Options
Downloads
Patches
Plain Diff
dirs
parent
bbc5e0f9
No related branches found
No related tags found
1 merge request
!6
Fully functional version that calculate layer with all stages
Pipeline
#54233
failed
2 years ago
Stage: Build Calqul
Stage: Deploy Calqul
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Dockerfiles/python/Dockerfile
+8
-12
8 additions, 12 deletions
Dockerfiles/python/Dockerfile
Dockerfiles/python/scripts/launch.sh
+1
-1
1 addition, 1 deletion
Dockerfiles/python/scripts/launch.sh
with
9 additions
and
13 deletions
Dockerfiles/python/Dockerfile
+
8
−
12
View file @
abc62ccf
...
...
@@ -8,7 +8,7 @@ FROM debian:10
WORKDIR
/app
# Copy the current directory contents into the container at /app
COPY
./
/app/
COPY
./
scripts/requirements.txt .
# Basic libs and install python3.7
RUN
apt-get update
&&
apt-get upgrade
-y
\
...
...
@@ -33,7 +33,7 @@ RUN python3 -m pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir manimce \
&& pip install rtree pygeos \
&& pip install --upgrade shapely \
&& pip install --no-cache-dir --upgrade -r ./
scripts/
requirements.txt
&& pip install --no-cache-dir --upgrade -r ./requirements.txt
# Add a non root user (OpenShift Requirements)
RUN
addgroup calquluser
&&
\
...
...
@@ -43,11 +43,16 @@ mkdir -p /app/logs && \
mkdir -p /app/tmp && \
chown -R calquluser:calquluser /app && \
chmod 755 /app/logs /app/tmp /app && \
chmod 755 /app/
scripts/
*.sh
chmod 755 /app/*.sh
# WORKDIR /app
USER
calquluser
# Add app
COPY
--chown=calquluser:calquluser ./scripts/*.py ./
COPY
--chown=calquluser:calquluser ./scripts/*.sh ./
COPY
--chown=calquluser:calquluser ./sql ./
COPY
--chown=calquluser:calquluser .env ./
# Arguments
ARG
NAMESPACE_ENV
...
...
@@ -71,15 +76,6 @@ ENV DB_PORT=$DB_PORT_ENV
ENV
DB_NAME=$DB_NAME_ENV
ENV
DB_USER=$DB_USER_ENV
# # Add app
# COPY --chown=calquluser:calquluser ./scripts/*.py ./
# COPY --chown=calquluser:calquluser ./scripts/*.sh ./
# COPY --chown=calquluser:calquluser ./sql ./
# COPY --chown=calquluser:calquluser .env ./
# RUN chmod 755 ./*.sh
# Launch calculation
# Documentation : https://stackoverflow.com/questions/40454470/how-can-i-use-a-variable-inside-a-dockerfile-cmd
CMD
[ "/bin/sh", "-c", "/app/scripts/launch.sh $NS_ENV $DB_HOST $DB_PORT $DB_NAME $DB_USER" ]
This diff is collapsed.
Click to expand it.
Dockerfiles/python/scripts/launch.sh
+
1
−
1
View file @
abc62ccf
...
...
@@ -20,7 +20,7 @@ LISTE_COMMUNES=( ["LYON-7EME"]="69387" ["LYON-8EME"]="69388" ["LYON-6EME"]="6938
DATA_REPO
=
"https://forge.grandlyon.com/erasme/data-recalcul-calque.git"
scripts_dir
=
"/app
/scripts
"
scripts_dir
=
"/app"
data_dir
=
"/arb-data/source-files/data-recalcul-calque"
backup_dir
=
"/arb-data/generated-files"
stage
=
1
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment