Skip to content

Commit

Permalink
Port pipeline resource enhancements from sims
Browse files Browse the repository at this point in the history
  • Loading branch information
NickPhura committed Nov 23, 2023
1 parent 2dbaecc commit d72994d
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 18 deletions.
19 changes: 11 additions & 8 deletions api/.pipeline/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ const phases = {
env: 'build',
tz: config.timezone.api,
branch: branch,
cpuRequest: '100m',
cpuRequest: '50m',
cpuLimit: '1250m',
memoryRequest: '512Mi',
memoryRequest: '100Mi',
memoryLimit: '3Gi'
},
dev: {
Expand All @@ -87,9 +87,10 @@ const phases = {
tz: config.timezone.api,
sso: config.sso.dev,
logLevel: 'debug',
cpuRequest: '100m',
nodeOptions: '--max_old_space_size=1500', // 75% of memoryLimit (bytes)
cpuRequest: '50m',
cpuLimit: '500m',
memoryRequest: '512Mi',
memoryRequest: '100Mi',
memoryLimit: '2Gi',
replicas: '1',
replicasMax: (isStaticDeployment && '2') || '1'
Expand All @@ -114,9 +115,10 @@ const phases = {
tz: config.timezone.api,
sso: config.sso.test,
logLevel: 'info',
cpuRequest: '200m',
nodeOptions: '--max_old_space_size=1500', // 75% of memoryLimit (bytes)
cpuRequest: '50m',
cpuLimit: '1000m',
memoryRequest: '512Mi',
memoryRequest: '100Mi',
memoryLimit: '2Gi',
replicas: '2',
replicasMax: '3'
Expand All @@ -141,9 +143,10 @@ const phases = {
tz: config.timezone.api,
sso: config.sso.prod,
logLevel: 'info',
cpuRequest: '200m',
nodeOptions: '--max_old_space_size=1500', // 75% of memoryLimit (bytes)
cpuRequest: '50m',
cpuLimit: '1000m',
memoryRequest: '512Mi',
memoryRequest: '100Mi',
memoryLimit: '2Gi',
replicas: '2',
replicasMax: '3'
Expand Down
10 changes: 9 additions & 1 deletion api/.pipeline/lib/api.deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,30 @@ const apiDeploy = async (settings) => {
HOST: phases[phase].host,
CHANGE_ID: phases.build.changeId || changeId,
APP_HOST: phases[phase].appHost,
// Node
NODE_ENV: phases[phase].env || 'dev',
NODE_OPTIONS: phases[phase].nodeOptions,
// Elastic Search
ELASTICSEARCH_URL: phases[phase].elasticsearchURL,
ELASTICSEARCH_EML_INDEX: phases[phase].elasticsearchEmlIndex,
ELASTICSEARCH_TAXONOMY_INDEX: phases[phase].elasticsearchTaxonomyIndex,
// S3 (Object Store)
S3_KEY_PREFIX: phases[phase].s3KeyPrefix,
// Database
TZ: phases[phase].tz,
DB_SERVICE_NAME: `${phases[phase].dbName}-postgresql${phases[phase].suffix}`,
// Keycloak
KEYCLOAK_ADMIN_USERNAME: phases[phase].sso.adminUserName,
KEYCLOAK_SECRET: phases[phase].sso.keycloakSecret,
KEYCLOAK_SECRET_ADMIN_PASSWORD: phases[phase].sso.keycloakSecretAdminPassword,
DB_SERVICE_NAME: `${phases[phase].dbName}-postgresql${phases[phase].suffix}`,
KEYCLOAK_HOST: phases[phase].sso.url,
KEYCLOAK_CLIENT_ID: phases[phase].sso.clientId,
KEYCLOAK_REALM: phases[phase].sso.realm,
KEYCLOAK_INTEGRATION_ID: phases[phase].sso.integrationId,
KEYCLOAK_API_HOST: phases[phase].sso.apiHost,
// Log Level
LOG_LEVEL: phases[phase].logLevel || 'info',
// OPenshift Resources
CPU_REQUEST: phases[phase].cpuRequest,
CPU_LIMIT: phases[phase].cpuLimit,
MEMORY_REQUEST: phases[phase].memoryRequest,
Expand Down
3 changes: 3 additions & 0 deletions api/.pipeline/templates/api.dc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ parameters:
description: Application Environment type variable
required: true
value: 'dev'
- name: NODE_OPTIONS
- name: ELASTICSEARCH_URL
description: Platform Elasticsearch URL
required: true
Expand Down Expand Up @@ -223,6 +224,8 @@ objects:
value: ${CHANGE_ID}
- name: NODE_ENV
value: ${NODE_ENV}
- name: NODE_OPTIONS
value: ${NODE_OPTIONS}
- name: ELASTICSEARCH_URL
value: ${ELASTICSEARCH_URL}
- name: ELASTICSEARCH_EML_INDEX
Expand Down
8 changes: 4 additions & 4 deletions app/.pipeline/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const phases = {
tag: tag,
env: 'build',
branch: branch,
cpuRequest: '100m',
cpuRequest: '50m',
cpuLimit: '1000m',
memoryRequest: '512Mi',
memoryLimit: '3Gi'
Expand All @@ -86,7 +86,7 @@ const phases = {
sso: config.sso.dev,
cpuRequest: '50m',
cpuLimit: (isStaticDeployment && '300m') || '200m',
memoryRequest: '50Mi',
memoryRequest: '100Mi',
memoryLimit: (isStaticDeployment && '300Mi') || '200Mi',
replicas: '1',
replicasMax: (isStaticDeployment && '2') || '1'
Expand All @@ -107,7 +107,7 @@ const phases = {
maxUploadFileSize,
env: 'test',
sso: config.sso.test,
cpuRequest: '100m',
cpuRequest: '50m',
cpuLimit: '400m',
memoryRequest: '100Mi',
memoryLimit: '400Mi',
Expand All @@ -130,7 +130,7 @@ const phases = {
maxUploadFileSize,
env: 'prod',
sso: config.sso.prod,
cpuRequest: '100m',
cpuRequest: '50m',
cpuLimit: '400m',
memoryRequest: '100Mi',
memoryLimit: '400Mi',
Expand Down
10 changes: 5 additions & 5 deletions database/.pipeline/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const phases = {
volumeCapacity: (isStaticDeployment && '3Gi') || '500Mi',
cpuRequest: '50m',
cpuLimit: '200m',
memoryRequest: '512Mi',
memoryRequest: '100Mi',
memoryLimit: '2Gi',
replicas: '1'
},
Expand All @@ -97,9 +97,9 @@ const phases = {
tz: config.timezone.db,
dbSetupDockerfilePath: dbSetupDockerfilePath,
volumeCapacity: '3Gi',
cpuRequest: '100m',
cpuRequest: '50m',
cpuLimit: '500m',
memoryRequest: '512Mi',
memoryRequest: '100Mi',
memoryLimit: '3Gi',
replicas: '1'
},
Expand All @@ -116,9 +116,9 @@ const phases = {
tz: config.timezone.db,
dbSetupDockerfilePath: dbSetupDockerfilePath,
volumeCapacity: '5Gi',
cpuRequest: '100m',
cpuRequest: '50m',
cpuLimit: '500m',
memoryRequest: '512Mi',
memoryRequest: '100Mi',
memoryLimit: '3Gi',
replicas: '1'
}
Expand Down

0 comments on commit d72994d

Please sign in to comment.