diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 27740528975565d92de52d193879187c801a410d..4355324e5b04aa020e15f5ee9bdf35718679f75e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -66,13 +66,9 @@ variables: - sed -i "s/__NAMESPACE__/$NAMESPACE/g" deployment/jobs/master-calqul.yml - sed -i "s/__NAMESPACE_ENV__/$NAMESPACE_ENV/g" deployment/jobs/master-calqul.yml - # Git-lfs deployment file For test only - # - sed -i "s/__NAMESPACE__/$NAMESPACE/g" deployment/pods/git-calqul.yml - # - sed -i "s/__NAMESPACE_ENV__/$NAMESPACE_ENV/g" deployment/pods/git-calqul.yml - # Git-lfs deployment file - - sed -i "s/__NAMESPACE__/$NAMESPACE/g" deployment/git-calqul.yml - - sed -i "s/__NAMESPACE_ENV__/$NAMESPACE_ENV/g" deployment/git-calqul.yml + - sed -i "s/__NAMESPACE__/$NAMESPACE/g" deployment/pods/git-calqul.yml + - sed -i "s/__NAMESPACE_ENV__/$NAMESPACE_ENV/g" deployment/pods/git-calqul.yml # Applying openshift conf anchor .apply_confs: &apply_confs @@ -93,10 +89,6 @@ variables: # - oc delete pods --selector pod-name=calqul-git-lfs-$NAMESPACE_ENV #--grace-period=0 --force # - oc apply -f deployment/pods/git-calqul.yml - # Git-lfs - # - oc delete pods --selector pod-name=calqul-git-lfs-$NAMESPACE_ENV #--grace-period=0 --force - # - oc apply -f deployment/git-calqul.yml - # Job - oc delete jobs --selector job-name=calqul-master-job-$NAMESPACE_ENV - oc create -f deployment/jobs/master-calqul.yml diff --git a/deployment/git-calqul.yml b/deployment/git-calqul.yml deleted file mode 100644 index f7fe3125ec1825c851ad42270eecaebb448fd7f5..0000000000000000000000000000000000000000 --- a/deployment/git-calqul.yml +++ /dev/null @@ -1,113 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: calqul-git-lfs-__NAMESPACE_ENV__ - namespace: __NAMESPACE__ - labels: - apps: calqul-git-lfs-__NAMESPACE_ENV__ -spec: - replicas: 1 - selector: - matchLabels: - app: calqul-git-lfs-__NAMESPACE_ENV__ - role: primary - tier: data-sources - template: - metadata: - labels: - app: calqul-git-lfs-__NAMESPACE_ENV__ - role: primary - tier: data-sources - spec: - imagePullSecrets: - - name: forge-secret - volumes: - - name: arb-data - persistentVolumeClaim: - claimName: pvc-01-__NAMESPACE__-claim - containers: - - name: calqul-git-lfs-__NAMESPACE_ENV__ - image: registry.forge.grandlyon.com/erasme/script-recalcul-calque/calqul-git-lfs-__NAMESPACE_ENV__ - env: - - name: GIT_USERNAME - valueFrom: - secretKeyRef: - name: arb-data-access-token - key: username - - name: GIT_PASSWORD - valueFrom: - secretKeyRef: - name: arb-data-access-token - key: password - - name: HTTP_PROXY - value: "http://proxyhttppro.grandlyon.fr:8080" - - name: HTTPS_PROXY - value: "http://proxyhttppro.grandlyon.fr:8080" - command: - - /bin/sh - - -c - - sleep 3600; - # - rm -rf /arb-data/source-files/data-recalcul-calque; mkdir -p /arb-data/source-files/data-recalcul-calque; cd /arb-data/source-files/; git lfs install --force; git clone https://${GIT_USERNAME}:${GIT_PASSWORD}@forge.grandlyon.com/erasme/sources-recalcul-calque.git ./data-recalcul-calque/; cd data-recalcul-calque; git pull origin main; - volumeMounts: - - name: arb-data - mountPath: "/arb-data/source-files" - - name: arb-data - mountPath: "/arb-data/generated-files" - -# apiVersion: apps/v1 -# kind: Deployment -# metadata: -# name: calqul-git-lfs-__NAMESPACE_ENV__ -# namespace: __NAMESPACE__ -# labels: -# apps: calqul-git-lfs-__NAMESPACE_ENV__ -# spec: -# replicas: 1 -# selector: -# matchLabels: -# app: calqul-git-lfs-__NAMESPACE_ENV__ -# role: primary -# tier: git -# template: -# metadata: -# name: calqul-git-lfs-__NAMESPACE_ENV__ -# labels: calqul-git-lfs-__NAMESPACE_ENV__ -# spec: -# imagePullSecrets: -# - name: forge-secret -# volumes: -# - name: arb-data -# persistentVolumeClaim: -# claimName: pvc-01-__NAMESPACE__-claim -# containers: -# - name: calqul-git-lfs-__NAMESPACE_ENV__ -# image: registry.forge.grandlyon.com/erasme/script-recalcul-calque/calqul-git-lfs-__NAMESPACE_ENV__ -# env: -# - name: GIT_USERNAME -# valueFrom: -# secretKeyRef: -# name: arb-data-access-token -# key: username -# - name: GIT_PASSWORD -# valueFrom: -# secretKeyRef: -# name: arb-data-access-token -# key: password -# - name: HTTP_PROXY -# value: "http://proxyhttppro.grandlyon.fr:8080" -# - name: HTTPS_PROXY -# value: "http://proxyhttppro.grandlyon.fr:8080" -# command: -# - /bin/sh -# - -c -# - sleep 3600; -# # - rm -rf /arb-data/source-files/data-recalcul-calque; mkdir -p /arb-data/source-files/data-recalcul-calque; cd /arb-data/source-files/; git lfs install --force; git clone https://${GIT_USERNAME}:${GIT_PASSWORD}@forge.grandlyon.com/erasme/sources-recalcul-calque.git ./data-recalcul-calque/; cd data-recalcul-calque; git pull origin main; -# volumeMounts: -# - name: arb-data -# mountPath: "/arb-data/source-files" -# # subpath: source-files -# - name: arb-data -# mountPath: "/arb-data/generated-files" -# # subpath: out -# restartPolicy: Always - diff --git a/deployment/job-calqul.yml b/deployment/job-calqul.yml deleted file mode 100644 index 9c5e7347ca135268de1e1a6d4606597bf5fcba63..0000000000000000000000000000000000000000 --- a/deployment/job-calqul.yml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: calqul-job-__NAMESPACE_ENV__ -spec: - # maximum duration the job can run => 40h - activeDeadlineSeconds: 144000 - template: - metadata: - name: calqul-job-__NAMESPACE_ENV__ - spec: - volumes: - - name: arb-data - persistentVolumeClaim: - claimName: pvc-01-__NAMESPACE__-claim - containers: - - name: calqul-python-__NAMESPACE_ENV__ - image: registry.forge.grandlyon.com/erasme/script-recalcul-calque/calqul-python-__NAMESPACE_ENV__ - volumeMounts: - - name: arb-data - mountPath: "/arb-data/source-files" - # subpath: source-files - - name: arb-data - mountPath: "/arb-data/generated-files" - # subpath: out - restartPolicy: Never - - # Clone or update sources data before calculation - initContainers: - - name: update-data-source - image: registry.forge.grandlyon.com/erasme/script-recalcul-calque/calqul-git-lfs-__NAMESPACE_ENV__ - env: - - name: GIT_USERNAME - valueFrom: - secretKeyRef: - name: arb-data-access-token - key: username - - name: GIT_PASSWORD - valueFrom: - secretKeyRef: - name: arb-data-access-token - key: password - - name: HTTP_PROXY - value: "http://proxyhttppro.grandlyon.fr:8080" - - name: HTTPS_PROXY - value: "http://proxyhttppro.grandlyon.fr:8080" - imagePullPolicy: IfNotPresent - command: - - /bin/sh - - -c - - rm -rf /arb-data/source-files/data-recalcul-calque; mkdir -p /arb-data/source-files/data-recalcul-calque; cd /arb-data/source-files; git lfs clone https://arb-data-access-token:sj_-yDyc3nnvAmWmP76h@forge.grandlyon.com/erasme/sources-recalcul-calque.git ./data-recalcul-calque/; echo "Data ready !"; - volumeMounts: - - name: arb-data - mountPath: "/arb-data/source-files" \ No newline at end of file diff --git a/deployment/jobs/master-calqul.yml b/deployment/jobs/master-calqul.yml index 8497f71b3385ae17be9d9772bd953d5b472980ab..294bb6c088ac18788ef5e67c8fe9c8fb405f0c4c 100644 --- a/deployment/jobs/master-calqul.yml +++ b/deployment/jobs/master-calqul.yml @@ -16,13 +16,6 @@ spec: containers: - name: calqul-python-__NAMESPACE_ENV__ image: registry.forge.grandlyon.com/erasme/script-recalcul-calque/calqul-python-__NAMESPACE_ENV__ - resources: - requests: - cpu: 200m - memory: 256Mi - limits: - cpu: 1 - memory: 1024Mi env: - name: PGPASSWORD valueFrom: @@ -41,6 +34,13 @@ spec: - name: arb-data mountPath: "/arb-data/run" # storing a file telling export-job the state of python script restartPolicy: Never + resources: + requests: + cpu: 200m + memory: 256Mi + limits: + cpu: 1 + memory: 1024Mi # Clone or update sources data before calculation initContainers: