diff --git a/helm/settings_local.py b/helm/settings_local.py index eb960839b..0a6f8a3b5 100644 --- a/helm/settings_local.py +++ b/helm/settings_local.py @@ -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/" diff --git a/helm/templates/persistentvolumeclaims.yaml b/helm/templates/persistentvolumeclaims.yaml index db636fb05..54e75925a 100644 --- a/helm/templates/persistentvolumeclaims.yaml +++ b/helm/templates/persistentvolumeclaims.yaml @@ -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 }} diff --git a/helm/values.yaml b/helm/values.yaml index 6e79be5e8..7170e63d0 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -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