Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
HansKallekleiv committed Nov 29, 2023
1 parent fc54e6a commit bc50fab
Show file tree
Hide file tree
Showing 2 changed files with 162 additions and 156 deletions.
2 changes: 1 addition & 1 deletion backend/src/backend/primary/user_session_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async def _create_new_job(self, user_id: str) -> None:
# these could be dynamic based on e.g. the selected ensemble sizess by the user.
json={
"resources": {
"limits": {"memory": "128GiB", "cpu": "16"},
"limits": {"memory": "64GiB", "cpu": "2"},
"requests": {"memory": "32GiB", "cpu": "1"},
}
},
Expand Down
316 changes: 161 additions & 155 deletions radixconfig.yml
Original file line number Diff line number Diff line change
@@ -1,169 +1,175 @@
apiVersion: radix.equinor.com/v1
kind: RadixApplication
metadata:
name: webviz
name: webviz
spec:
environments:
- name: prod
build:
from: main
- name: review
build:
from: review
environments:
- name: prod
build:
from: main
- name: review
build:
from: review

components:
- name: frontend
dockerFileName: frontend-prod.Dockerfile
publicPort: http
ports:
- name: http
port: 8080
components:
- name: frontend
dockerFileName: frontend-prod.Dockerfile
publicPort: http
ports:
- name: http
port: 8080
ingressConfiguration:
- websocketfriendly

- name: backend-primary
dockerFileName: backend.Dockerfile
ports:
- name: http
port: 5000
secretRefs:
azureKeyVaults:
- name: webviz
items:
- name: WEBVIZ-CLIENT-SECRET
envVar: WEBVIZ_CLIENT_SECRET
- name: WEBVIZ-SMDA-RESOURCE-SCOPE
envVar: WEBVIZ_SMDA_RESOURCE_SCOPE
- name: WEBVIZ-SMDA-SUBSCRIPTION-KEY
envVar: WEBVIZ_SMDA_SUBSCRIPTION_KEY
variables:
UVICORN_PORT: 5000
UVICORN_ENTRYPOINT: src.backend.primary.main:app
environmentConfig:
- environment: prod
- name: backend-primary
dockerFileName: backend.Dockerfile
ports:
- name: http
port: 5000
ingressConfiguration:
- websocketfriendly
secretRefs:
azureKeyVaults:
- name: webviz
items:
- name: WEBVIZ-INSIGHTS-CONNECTIONSTRING-PROD
envVar: APPLICATIONINSIGHTS_CONNECTION_STRING
azureKeyVaults:
- name: webviz
items:
- name: WEBVIZ-CLIENT-SECRET
envVar: WEBVIZ_CLIENT_SECRET
- name: WEBVIZ-SMDA-RESOURCE-SCOPE
envVar: WEBVIZ_SMDA_RESOURCE_SCOPE
- name: WEBVIZ-SMDA-SUBSCRIPTION-KEY
envVar: WEBVIZ_SMDA_SUBSCRIPTION_KEY
variables:
OTEL_RESOURCE_ATTRIBUTES: service.name=primary-backend, service.namespace=prod, service.version=tbd0.1.2
resources:
requests:
memory: 8Gi
cpu: 1000m
limits:
# Memory limit=request and cpu limit omitted on purpose
memory: 8Gi
horizontalScaling:
minReplicas: 2
maxReplicas: 4
resources:
memory:
averageUtilization: 60
cpu:
averageUtilization: 80
- environment: review
secretRefs:
azureKeyVaults:
- name: webviz
items:
- name: WEBVIZ-INSIGHTS-CONNECTIONSTRING-REVIEW
envVar: APPLICATIONINSIGHTS_CONNECTION_STRING
variables:
OTEL_RESOURCE_ATTRIBUTES: service.name=primary-backend, service.namespace=review, service.version=tbd0.1.2
resources:
requests:
memory: 4Gi
cpu: 500m
limits:
memory: 4Gi
horizontalScaling:
minReplicas: 1
maxReplicas: 3
resources:
memory:
averageUtilization: 60
cpu:
averageUtilization: 80

- name: redis-user-session
image: bitnami/redis:6.2.10@sha256:bd42fcdab5959ce2b21b6ea8410d4b3ee87ecb2e320260326ec731ecfcffbd0e
ports:
- name: http
port: 6379
variables:
ALLOW_EMPTY_PASSWORD: yes
UVICORN_PORT: 5000
UVICORN_ENTRYPOINT: src.backend.primary.main:app
environmentConfig:
- environment: prod
secretRefs:
azureKeyVaults:
- name: webviz
items:
- name: WEBVIZ-INSIGHTS-CONNECTIONSTRING-PROD
envVar: APPLICATIONINSIGHTS_CONNECTION_STRING
variables:
OTEL_RESOURCE_ATTRIBUTES: service.name=primary-backend, service.namespace=prod, service.version=tbd0.1.2
resources:
requests:
memory: 8Gi
cpu: 1000m
limits:
# Memory limit=request and cpu limit omitted on purpose
memory: 8Gi
horizontalScaling:
minReplicas: 2
maxReplicas: 4
resources:
memory:
averageUtilization: 60
cpu:
averageUtilization: 80
- environment: review
secretRefs:
azureKeyVaults:
- name: webviz
items:
- name: WEBVIZ-INSIGHTS-CONNECTIONSTRING-REVIEW
envVar: APPLICATIONINSIGHTS_CONNECTION_STRING
variables:
OTEL_RESOURCE_ATTRIBUTES: service.name=primary-backend, service.namespace=review, service.version=tbd0.1.2
resources:
requests:
memory: 4Gi
cpu: 500m
limits:
memory: 4Gi
horizontalScaling:
minReplicas: 1
maxReplicas: 3
resources:
memory:
averageUtilization: 60
cpu:
averageUtilization: 80

- name: redis-cache
image: bitnami/redis:6.2.10@sha256:bd42fcdab5959ce2b21b6ea8410d4b3ee87ecb2e320260326ec731ecfcffbd0e
ports:
- name: http
port: 6379
variables:
ALLOW_EMPTY_PASSWORD: yes
# https://redis.io/docs/management/config/#configuring-redis-as-a-cache
# maxmemory for redis must be aligned with component's requested memory, here 1gb vs 2gb
REDIS_EXTRA_FLAGS: --maxmemory 1gb --maxmemory-policy allkeys-lru --save '' --appendonly no --loglevel verbose
resources:
requests:
memory: 2Gi
cpu: 200m
limits:
memory: 2Gi
- name: redis-user-session
image: bitnami/redis:6.2.10@sha256:bd42fcdab5959ce2b21b6ea8410d4b3ee87ecb2e320260326ec731ecfcffbd0e
ports:
- name: http
port: 6379
variables:
ALLOW_EMPTY_PASSWORD: yes

jobs:
- name: backend-user-session
dockerFileName: backend.Dockerfile
schedulerPort: 8000
ports:
- name: http
port: 8000
secretRefs:
azureKeyVaults:
- name: webviz
items:
- name: WEBVIZ-CLIENT-SECRET
envVar: WEBVIZ_CLIENT_SECRET
- name: WEBVIZ-SMDA-RESOURCE-SCOPE
envVar: WEBVIZ_SMDA_RESOURCE_SCOPE
- name: WEBVIZ-SMDA-SUBSCRIPTION-KEY
envVar: WEBVIZ_SMDA_SUBSCRIPTION_KEY
variables:
UVICORN_PORT: 8000
UVICORN_ENTRYPOINT: src.backend.user_session.main:app
environmentConfig:
# As of October 2023 in radix, these settings need to be duplicated for both environments.
- environment: prod
secretRefs:
azureKeyVaults:
- name: webviz
items:
- name: WEBVIZ-INSIGHTS-CONNECTIONSTRING-PROD
envVar: APPLICATIONINSIGHTS_CONNECTION_STRING
- name: redis-cache
image: bitnami/redis:6.2.10@sha256:bd42fcdab5959ce2b21b6ea8410d4b3ee87ecb2e320260326ec731ecfcffbd0e
ports:
- name: http
port: 6379
variables:
OTEL_RESOURCE_ATTRIBUTES: service.name=user-session, service.namespace=prod, service.version=tbd0.1.2
volumeMounts:
- name: webvizcache
path: /tmp/webvizcache/
blobfuse2:
container: cache
uid: 1234
- environment: review
ALLOW_EMPTY_PASSWORD: yes
# https://redis.io/docs/management/config/#configuring-redis-as-a-cache
# maxmemory for redis must be aligned with component's requested memory, here 1gb vs 2gb
REDIS_EXTRA_FLAGS: --maxmemory 1gb --maxmemory-policy allkeys-lru --save '' --appendonly no --loglevel verbose
resources:
requests:
memory: 2Gi
cpu: 200m
limits:
memory: 2Gi

jobs:
- name: backend-user-session
dockerFileName: backend.Dockerfile
schedulerPort: 8000
ports:
- name: http
port: 8000
ingressConfiguration:
- websocketfriendly
secretRefs:
azureKeyVaults:
- name: webviz
items:
- name: WEBVIZ-INSIGHTS-CONNECTIONSTRING-REVIEW
envVar: APPLICATIONINSIGHTS_CONNECTION_STRING
azureKeyVaults:
- name: webviz
items:
- name: WEBVIZ-CLIENT-SECRET
envVar: WEBVIZ_CLIENT_SECRET
- name: WEBVIZ-SMDA-RESOURCE-SCOPE
envVar: WEBVIZ_SMDA_RESOURCE_SCOPE
- name: WEBVIZ-SMDA-SUBSCRIPTION-KEY
envVar: WEBVIZ_SMDA_SUBSCRIPTION_KEY
variables:
OTEL_RESOURCE_ATTRIBUTES: service.name=user-session, service.namespace=review, service.version=tbd0.1.2
volumeMounts:
- name: webvizcache
path: /tmp/webvizcache/
blobfuse2:
container: cache
uid: 1234
UVICORN_PORT: 8000
UVICORN_ENTRYPOINT: src.backend.user_session.main:app
environmentConfig:
# As of October 2023 in radix, these settings need to be duplicated for both environments.
- environment: prod
secretRefs:
azureKeyVaults:
- name: webviz
items:
- name: WEBVIZ-INSIGHTS-CONNECTIONSTRING-PROD
envVar: APPLICATIONINSIGHTS_CONNECTION_STRING
variables:
OTEL_RESOURCE_ATTRIBUTES: service.name=user-session, service.namespace=prod, service.version=tbd0.1.2
volumeMounts:
- name: webvizcache
path: /tmp/webvizcache/
blobfuse2:
container: cache
uid: 1234
- environment: review
secretRefs:
azureKeyVaults:
- name: webviz
items:
- name: WEBVIZ-INSIGHTS-CONNECTIONSTRING-REVIEW
envVar: APPLICATIONINSIGHTS_CONNECTION_STRING
variables:
OTEL_RESOURCE_ATTRIBUTES: service.name=user-session, service.namespace=review, service.version=tbd0.1.2
volumeMounts:
- name: webvizcache
path: /tmp/webvizcache/
blobfuse2:
container: cache
uid: 1234

dnsAppAlias:
environment: prod
component: frontend
dnsAppAlias:
environment: prod
component: frontend

0 comments on commit bc50fab

Please sign in to comment.