Skip to content
Snippets Groups Projects
Commit 74fb6d4a authored by Pierre-Gilles Levallois's avatar Pierre-Gilles Levallois
Browse files

Try a deployment with parallel jobs

parent 064a140b
Branches
No related tags found
No related merge requests found
Pipeline #55487 failed
...@@ -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 Indices: # 3. Compute Factors:
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-indices" # CALQUL_ACTION: "compute-factors"
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 Datas: # 4. Compute Indices:
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-datas" # CALQUL_ACTION: "compute-indices"
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 *
......
...@@ -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
......
...@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment