diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index 300bfc5e8..d8708124b 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -36,7 +36,7 @@ jobs: echo Provision database CPU_REQUEST=75m CPU_LIMIT=2000m MEMORY_REQUEST=2Gi MEMORY_LIMIT=16Gi PVC_SIZE=45Gi PROJ_TARGET=e1e498-prod bash openshift/scripts/oc_provision_db.sh prod apply echo Deploy API - CPU_REQUEST=100m CPU_LIMIT=500m MEMORY_REQUEST=3Gi MEMORY_LIMIT=4Gi REPLICAS=3 PROJ_TARGET=e1e498-prod VANITY_DOMAIN=psu.nrs.gov.bc.ca SECOND_LEVEL_DOMAIN=apps.silver.devops.gov.bc.ca bash ./openshift/scripts/oc_deploy.sh prod apply + WORKERS_PER_CORE=0.25 CPU_REQUEST=100m CPU_LIMIT=500m MEMORY_REQUEST=3Gi MEMORY_LIMIT=4Gi REPLICAS=3 PROJ_TARGET=e1e498-prod VANITY_DOMAIN=psu.nrs.gov.bc.ca SECOND_LEVEL_DOMAIN=apps.silver.devops.gov.bc.ca bash ./openshift/scripts/oc_deploy.sh prod apply echo Env Canada Subscriber PROJ_TARGET=e1e498-prod bash openshift/scripts/oc_provision_ec_gdps_cronjob.sh prod apply PROJ_TARGET=e1e498-prod bash openshift/scripts/oc_provision_ec_hrdps_cronjob.sh prod apply diff --git a/openshift/scripts/oc_deploy.sh b/openshift/scripts/oc_deploy.sh index 3de226dfc..95339ea3d 100755 --- a/openshift/scripts/oc_deploy.sh +++ b/openshift/scripts/oc_deploy.sh @@ -40,6 +40,7 @@ OC_PROCESS="oc -n ${PROJ_TARGET} process -f ${PATH_DC} \ -p POSTGRES_READ_HOST=${POSTGRES_READ_HOST:-"patroni-${NAME_APP}-${SUFFIX}-replica"} \ -p VANITY_DOMAIN=${VANITY_DOMAIN} \ ${SECOND_LEVEL_DOMAIN:+ "-p SECOND_LEVEL_DOMAIN=${SECOND_LEVEL_DOMAIN}"} \ + ${WORKERS_PER_CORE:+ "-p WORKERS_PER_CORE=${WORKERS_PER_CORE}"} \ ${CPU_REQUEST:+ "-p CPU_REQUEST=${CPU_REQUEST}"} \ ${CPU_LIMIT:+ "-p CPU_LIMIT=${CPU_LIMIT}"} \ ${MEMORY_REQUEST:+ "-p MEMORY_REQUEST=${MEMORY_REQUEST}"} \ diff --git a/openshift/templates/deploy.dc.yaml b/openshift/templates/deploy.dc.yaml index 32f98cd31..b413488ca 100644 --- a/openshift/templates/deploy.dc.yaml +++ b/openshift/templates/deploy.dc.yaml @@ -71,6 +71,9 @@ parameters: value: "False" - name: VANITY_DOMAIN requests: True + - name: WORKERS_PER_CORE + description: "Number of workers per core. e.g. openshift pods report having 32 cores, so 0.125 would give you 4 workers total." + value: "0.125" objects: - apiVersion: v1 kind: DeploymentConfig @@ -103,7 +106,7 @@ objects: - name: PORT # The port that the API will run on (used by fastapi docker image) value: "8080" - name: WORKERS_PER_CORE # The number of worker per code (used by fastapi docker image) - value: "0.25" + value: ${WORKERS_PER_CORE} - name: "TIMEOUT" # https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker#timeout valueFrom: configMapKeyRef: