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
74fb6d4a
Commit
74fb6d4a
authored
2 years ago
by
Pierre-Gilles Levallois
Browse files
Options
Downloads
Patches
Plain Diff
Try a deployment with parallel jobs
parent
064a140b
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#55487
failed
2 years ago
Stage: Build Calqul
Stage: Parallel Deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+79
-101
79 additions, 101 deletions
.gitlab-ci.yml
Dockerfiles/python/scripts/launch.sh
+1
-1
1 addition, 1 deletion
Dockerfiles/python/scripts/launch.sh
deployment/jobs/stage-calqul.yml
+2
-2
2 additions, 2 deletions
deployment/jobs/stage-calqul.yml
with
82 additions
and
104 deletions
.gitlab-ci.yml
+
79
−
101
View file @
74fb6d4a
...
@@ -119,7 +119,7 @@ variables:
...
@@ -119,7 +119,7 @@ variables:
################################################################################
################################################################################
stages
:
stages
:
-
Build Calqul
-
Build Calqul
-
Auto
Deploy
-
Parallel
Deploy
-
Deploy Calqul Buttons
-
Deploy Calqul Buttons
-
Deploy Calqul Production
-
Deploy Calqul Production
...
@@ -210,54 +210,15 @@ Build Calqul Git-lfs:
...
@@ -210,54 +210,15 @@ Build Calqul Git-lfs:
# tags:
# tags:
# - ns-arb-d01
# - ns-arb-d01
# 1. Init Grid:
# stage: Deploy Calqul Buttons
# when: manual
# environment: dev
# variables:
# NAMESPACE: "ns-$TRIGRAMME-$NAMESPACE_ENV"
# CALQUL_ACTION: "init-grid"
# before_script:
# - *prepare_deployment
# script:
# - *apply_confs
# #
# # @TODO : Déployer 67 jobs avec des paramétrages différents
# # En fait les jobs ne démarreront pas tous en même temps si on adapte bien les ressoureces
# # (vérifier quel est le max de RAM consommé et règler les requests dessus)
# # - INSEE="$codeInsee"
# # - *DeployJobInitGrid
# # parallel:
# # codeInsee: ["69001","69002","69003", ...]
# rules:
# - if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
# tags:
# - ns-arb-d01
1. Init Grid
:
1. Init Grid
:
stage
:
Auto
Deploy
stage
:
Parallel
Deploy
variables
:
variables
:
NAMESPACE
:
"
ns-$TRIGRAMME-$NAMESPACE_ENV"
NAMESPACE
:
"
ns-$TRIGRAMME-$NAMESPACE_ENV"
before_script
:
-
*prepare_deployment
script
:
-
*apply_confs
rules
:
-
if
:
$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
tags
:
-
ns-arb-d01
parallel
:
parallel
:
matrix
:
matrix
:
-
CALQUL_ACTION
:
init-grid
-
CALQUL_ACTION
:
init-grid
CODE_INSEE
:
[
69003
,
69029
,
69033
,
69034
,
69040
,
69044
,
69046
,
69271
,
69063
,
69273
,
69068
,
69069
,
69071
,
69072
,
69275
,
69081
,
69276
,
69085
,
69087
,
69088
,
69089
,
69278
,
69091
,
69096
,
69100
,
69279
,
69142
,
69250
,
69116
,
69117
,
69381
,
69382
,
69383
,
69384
,
69385
,
69386
,
69387
,
69388
,
69389
,
69127
,
69282
,
69283
,
69284
,
69143
,
69149
,
69152
,
69153
,
69163
,
69286
,
69168
,
69191
,
69194
,
69202
,
69199
,
69204
,
69205
,
69207
,
69290
,
69233
,
69292
,
69293
,
69296
,
69244
,
69256
,
69259
,
69260
,
69266
]
CODE_INSEE
:
[
69003
,
69029
,
69033
,
69034
,
69040
,
69044
,
69046
,
69271
,
69063
,
69273
,
69068
,
69069
,
69071
,
69072
,
69275
,
69081
,
69276
,
69085
,
69087
,
69088
,
69089
,
69278
,
69091
,
69096
,
69100
,
69279
,
69142
,
69250
,
69116
,
69117
,
69381
,
69382
,
69383
,
69384
,
69385
,
69386
,
69387
,
69388
,
69389
,
69127
,
69282
,
69283
,
69284
,
69143
,
69149
,
69152
,
69153
,
69163
,
69286
,
69168
,
69191
,
69194
,
69202
,
69199
,
69204
,
69205
,
69207
,
69290
,
69233
,
69292
,
69293
,
69296
,
69244
,
69256
,
69259
,
69260
,
69266
]
environment
:
dev $CALQUL_ACTION/$CODE_INSEE
environment
:
dev $CALQUL_ACTION/$CODE_INSEE
2. Init Datas
:
stage
:
Deploy Calqul Buttons
when
:
manual
environment
:
dev
variables
:
NAMESPACE
:
"
ns-$TRIGRAMME-$NAMESPACE_ENV"
CALQUL_ACTION
:
"
init-datas"
before_script
:
before_script
:
-
*prepare_deployment
-
*prepare_deployment
script
:
script
:
...
@@ -267,69 +228,86 @@ Build Calqul Git-lfs:
...
@@ -267,69 +228,86 @@ Build Calqul Git-lfs:
tags
:
tags
:
-
ns-arb-d01
-
ns-arb-d01
3. Compute Factors
:
# 2. Init Datas:
stage
:
Deploy Calqul Buttons
# stage: Deploy Calqul Buttons
when
:
manual
# when: manual
environment
:
dev
# environment: dev
variables
:
# variables:
NAMESPACE
:
"
ns-$TRIGRAMME-$NAMESPACE_ENV"
# NAMESPACE: "ns-$TRIGRAMME-$NAMESPACE_ENV"
CALQUL_ACTION
:
"
compute-factors"
# CALQUL_ACTION: "init-datas"
before_script
:
# CODE_INSEE: ""
-
*prepare_deployment
# before_script:
script
:
# - *prepare_deployment
-
*apply_confs
# script:
rules
:
# - *apply_confs
-
if
:
$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
# rules:
tags
:
# - if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
-
ns-arb-d01
# tags:
# - ns-arb-d01
4
. Compute
Indice
s
:
# 3
. Compute
Factor
s:
stage
:
Deploy Calqul Buttons
#
stage: Deploy Calqul Buttons
when
:
manual
#
when: manual
environment
:
dev
#
environment: dev
variables
:
#
variables:
NAMESPACE
:
"
ns-$TRIGRAMME-$NAMESPACE_ENV"
#
NAMESPACE: "ns-$TRIGRAMME-$NAMESPACE_ENV"
CALQUL_ACTION
:
"
compute-
indice
s"
#
CALQUL_ACTION: "compute-
factor
s"
before_script
:
#
before_script:
-
*prepare_deployment
#
- *prepare_deployment
script
:
#
script:
-
*apply_confs
#
- *apply_confs
rules
:
#
rules:
-
if
:
$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
#
- if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
tags
:
#
tags:
-
ns-arb-d01
#
- ns-arb-d01
5. Dump Data
s
:
# 4. Compute Indice
s:
stage
:
Deploy Calqul Buttons
#
stage: Deploy Calqul Buttons
when
:
manual
#
when: manual
environment
:
dev
#
environment: dev
variables
:
#
variables:
NAMESPACE
:
"
ns-$TRIGRAMME-$NAMESPACE_ENV"
#
NAMESPACE: "ns-$TRIGRAMME-$NAMESPACE_ENV"
CALQUL_ACTION
:
"
dump-data
s"
#
CALQUL_ACTION: "
compute-indice
s"
before_script
:
#
before_script:
-
*prepare_deployment
#
- *prepare_deployment
script
:
#
script:
-
*apply_confs
#
- *apply_confs
rules
:
#
rules:
-
if
:
$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
#
- if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
tags
:
#
tags:
-
ns-arb-d01
#
- ns-arb-d01
All Stages
:
# 5. Dump Datas:
stage
:
Deploy Calqul Buttons
# stage: Deploy Calqul Buttons
when
:
manual
# when: manual
environment
:
dev
# environment: dev
variables
:
# variables:
NAMESPACE
:
"
ns-$TRIGRAMME-$NAMESPACE_ENV"
# NAMESPACE: "ns-$TRIGRAMME-$NAMESPACE_ENV"
CALQUL_ACTION
:
"
all"
# CALQUL_ACTION: "dump-datas"
before_script
:
# before_script:
-
*prepare_deployment
# - *prepare_deployment
script
:
# script:
-
*apply_confs
# - *apply_confs
rules
:
# rules:
-
if
:
$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
# - if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
tags
:
# tags:
-
ns-arb-d01
# - ns-arb-d01
# All Stages:
# stage: Deploy Calqul Buttons
# when: manual
# environment: dev
# variables:
# NAMESPACE: "ns-$TRIGRAMME-$NAMESPACE_ENV"
# CALQUL_ACTION: "all"
# before_script:
# - *prepare_deployment
# script:
# - *apply_confs
# rules:
# - if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
# tags:
# - ns-arb-d01
# *********************************************************************************************
# *********************************************************************************************
# * MAIN BRANCH MAIN BRANCH MAIN BRANCH MAIN BRANCH MAIN BRANCH MAIN BRANCH MAIN BRANCH MAIN *
# * MAIN BRANCH MAIN BRANCH MAIN BRANCH MAIN BRANCH MAIN BRANCH MAIN BRANCH MAIN BRANCH MAIN *
...
...
This diff is collapsed.
Click to expand it.
Dockerfiles/python/scripts/launch.sh
+
1
−
1
View file @
74fb6d4a
...
@@ -6,12 +6,12 @@ alias python=python3
...
@@ -6,12 +6,12 @@ alias python=python3
source
.env
source
.env
action
=
$1
action
=
$1
code_insee
=
$2
namespace_env
=
$3
namespace_env
=
$3
DB_HOST
=
$4
DB_HOST
=
$4
DB_PORT
=
$5
DB_PORT
=
$5
DB_NAME
=
$6
DB_NAME
=
$6
DB_USER
=
$7
DB_USER
=
$7
code_insee
=
$8
GRID_SIZE
=
5
GRID_SIZE
=
5
...
...
This diff is collapsed.
Click to expand it.
deployment/jobs/stage-calqul.yml
+
2
−
2
View file @
74fb6d4a
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
apiVersion
:
batch/v1
apiVersion
:
batch/v1
kind
:
Job
kind
:
Job
metadata
:
metadata
:
name
:
calqul-stage-__CALQUL_ACTION__-__NAMESPACE_ENV__
name
:
calqul-stage-__CALQUL_ACTION__-__
CODE_INSEE__-__
NAMESPACE_ENV__
spec
:
spec
:
# maximum duration the job can run => 40h
# maximum duration the job can run => 40h
activeDeadlineSeconds
:
144000
activeDeadlineSeconds
:
144000
...
@@ -23,7 +23,7 @@ spec:
...
@@ -23,7 +23,7 @@ spec:
-
name
:
calqul-stage-__CALQUL_ACTION__-__NAMESPACE_ENV__
-
name
:
calqul-stage-__CALQUL_ACTION__-__NAMESPACE_ENV__
# Image Python de calcul du calque
# Image Python de calcul du calque
image
:
registry.forge.grandlyon.com/erasme/script-recalcul-calque/calqul-python-__NAMESPACE_ENV__
image
:
registry.forge.grandlyon.com/erasme/script-recalcul-calque/calqul-python-__NAMESPACE_ENV__
command
:
[
"
/bin/bash"
,
"
-c"
,
"
/app/launch.sh
__CALQUL_ACTION__
__NAMESPACE_ENV__
__POSTGRES_SERVER__
__POSTGRES_PORT__
__POSTGRES_DB__
__POSTGRES_USER__
__CODE_INSEE__
"
]
command
:
[
"
/bin/bash"
,
"
-c"
,
"
/app/launch.sh
__CALQUL_ACTION__
__CODE_INSEE__
__NAMESPACE_ENV__
__POSTGRES_SERVER__
__POSTGRES_PORT__
__POSTGRES_DB__
__POSTGRES_USER__"
]
volumeMounts
:
volumeMounts
:
-
name
:
arb-data
-
name
:
arb-data
mountPath
:
"
/arb-data/source-files"
mountPath
:
"
/arb-data/source-files"
...
...
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