ci: use values for PVClaims, STATIC_URL (#7317)

* ci: Expose PV parameters as values

* ci: complain about missing value in dev mode

* ci: Allow override of STATIC_URL
This commit is contained in:
Jennifer Richards 2024-04-12 11:57:58 -03:00 committed by Nicolas Giard
parent 206a4bb749
commit e99286f400
3 changed files with 52 additions and 12 deletions

View file

@ -140,9 +140,9 @@ if _MEETECHO_CLIENT_ID is not None and _MEETECHO_CLIENT_SECRET is not None:
"client_secret": _MEETECHO_CLIENT_SECRET,
"request_timeout": 3.01, # python-requests doc recommend slightly > a multiple of 3 seconds
}
elif SERVER_MODE == "production":
else:
raise RuntimeError(
"DATATRACKER_MEETECHO_CLIENT_ID and DATATRACKER_MEETECHO_CLIENT_SECRET must be set in production"
"DATATRACKER_MEETECHO_CLIENT_ID and DATATRACKER_MEETECHO_CLIENT_SECRET must be set"
)
_APP_API_TOKENS_JSON = os.environ.get("DATATRACKER_APP_API_TOKENS_JSON", None)
@ -190,6 +190,11 @@ DRAFT_VIRTUAL_PATH = "/a/postfix/draft-virtual"
GROUP_ALIASES_PATH = "/a/postfix/group-aliases"
GROUP_VIRTUAL_PATH = "/a/postfix/group-virtual"
# Repoint STATIC_URL - hack to let staging access statics without hosting them itself
_STATIC_URL = os.environ.get("DATATRACKER_STATIC_URL", None)
if _STATIC_URL is not None:
STATIC_URL = _STATIC_URL
# Set these to the same as "production" in settings.py, whether production mode or not
MEDIA_ROOT = "/a/www/www6s/lib/dt/media/"
MEDIA_URL = "https://www.ietf.org/lib/dt/media/"

View file

@ -2,25 +2,36 @@ apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: "datatracker-shared-volume-claim"
# Note: This is the /a shared volume. The spec should be adjusted to ensure it always
# matches the correct EBS volume in production. For the moment, it just requests a
# large volume.
spec:
{{- with .Values.persistentVolumes.datatrackerSharedVolume }}
storageClassName: {{ .storageClassName | quote }}
{{- if .volumeName }}
volumeName: {{ .volumeName | quote }}
{{- end }}
accessModes:
- ReadWriteMany # or ReadWriteOnce and force datatracker/celery/beat to a single node
{{- range .accessModes }}
- {{ . | quote }}
{{- end }}
resources:
requests:
storage: 600Gi # adjust to something satisfied by the /a PersistentVolume
storage: {{ .storage | quote }}
{{- end }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: "rabbitmq-data-claim"
spec:
# storageClassName: "local"
# volumeName: ""
{{- with .Values.persistentVolumes.rabbitmqDataVolume }}
storageClassName: {{ .storageClassName | quote }}
{{- if .volumeName }}
volumeName: {{ .volumeName | quote }}
{{- end }}
accessModes:
- ReadWriteOnce
{{- range .accessModes }}
- {{ . | quote }}
{{- end }}
resources:
requests:
storage: 8Gi
storage: {{ .storage | quote }}
{{- end }}

View file

@ -561,6 +561,26 @@ memcached:
affinity: {}
# -------------------------------------------------------------
# PERSISTENT VOLUMES
# -------------------------------------------------------------
persistentVolumes:
datatrackerSharedVolume:
# Note: This is the /a shared volume
volumeName: "datatracker-shared-volume"
accessModes:
- "ReadWriteMany" # or ReadWriteOnce and force datatracker/celery/beat to a single node
storageClassName: "" # Empty string means do not use default storage class
storage: "600Gi" # actual PersistentVolume must be at least this big or the PVC will not bind
rabbitmqDataVolume:
volumeName: "rabbitmq-data-volume"
accessModes:
- "ReadWriteOnce"
storageClassName: "" # Empty string means do not use default storage class
storage: "8Gi" # actual PersistentVolume must be at least this big or the PVC will not bind
# -------------------------------------------------------------
# COMMON
# -------------------------------------------------------------
@ -592,7 +612,11 @@ env:
# DATATRACKER_DBPASS: "RkTkDPFnKpko" # secret
DATATRACKER_DJANGO_SECRET_KEY: "PDwXboUq!=hPjnrtG2=ge#N$Dwy+wn@uivrugwpic8mxyPfHk" # secret
# Set this to point testing / staging at the production statics server until we
# sort that out
DATATRACKER_STATIC_URL: "https://static.ietf.org/dt/12.10.0/"
# DATATRACKER_EMAIL_DEBUG: "true"
# Outgoing email details