diff --git a/roles/openshift-apps/mirrormanager/files/cron.yml b/roles/openshift-apps/mirrormanager/files/cron.yml index d57bd72403..50db0078e4 100644 --- a/roles/openshift-apps/mirrormanager/files/cron.yml +++ b/roles/openshift-apps/mirrormanager/files/cron.yml @@ -19,23 +19,54 @@ spec: image: image-registry.openshift-image-registry.svc:5000/mirrormanager/mirrormanager2:latest command: - "/opt/app-root/bin/mm2_generate-worldmap" - - "-c" - - "/etc/mirrormanager/mm.cfg" - "--output" - - "/var/www/mirrormanager-statistics/map/" + - "/var/lib/mirrormanager/statistics/map/" volumeMounts: - name: config mountPath: "/etc/mirrormanager" readOnly: true - - name: statistics - mountPath: "/var/www/mirrormanager-statistics" + - name: data + mountPath: "/var/lib/mirrormanager" volumes: - name: config configMap: name: config - - name: statistics + - name: data persistentVolumeClaim: - claimName: statistics + claimName: data +--- +apiVersion: batch/v1 +kind: CronJob +metadata: + name: get-geoip +spec: + successfulJobsHistoryLimit: 3 + failedJobsHistoryLimit: 3 + concurrencyPolicy: Forbid + schedule: "48 * * * *" + startingDeadlineSeconds: 500 + jobTemplate: + spec: + template: + spec: + restartPolicy: Never + containers: + - name: mirrormanager + image: image-registry.openshift-image-registry.svc:5000/mirrormanager/mirrormanager2:latest + command: + - "curl" + - "--create-dirs" + - "--output-dir" + - "/var/lib/mirrormanager/geoip" + - "-O" + - "https://infrastructure.fedoraproject.org/infra/bigfiles/geoip/GeoLite2-City.mmdb" + volumeMounts: + - name: data + mountPath: "/var/lib/mirrormanager" + volumes: + - name: data + persistentVolumeClaim: + claimName: data # --- # apiVersion: batch/v1 diff --git a/roles/openshift-apps/mirrormanager/files/deploymentconfig.yml b/roles/openshift-apps/mirrormanager/files/deploymentconfig.yml index 922732a041..12dc928911 100644 --- a/roles/openshift-apps/mirrormanager/files/deploymentconfig.yml +++ b/roles/openshift-apps/mirrormanager/files/deploymentconfig.yml @@ -38,8 +38,8 @@ spec: - name: secrets mountPath: "/etc/mirrormanager-secrets" readOnly: true - - name: statistics - mountPath: /var/www/mirrormanager-statistics + - name: data + mountPath: /var/lib/mirrormanager - name: wsgi-script mountPath: "/opt/app-root/src/deploy" readOnly: true @@ -66,7 +66,7 @@ spec: # readOnly: true env: - name: MM2_CONFIG - value: "/etc/mirrormanager/mm.cfg" + value: "/etc/mirrormanager/mirrormanager2.cfg" - name: APP_MODULE value: "deploy.wsgi" - name: APP_CONFIG @@ -92,9 +92,9 @@ spec: - name: secrets secret: secretName: secrets - - name: statistics + - name: data persistentVolumeClaim: - claimName: statistics + claimName: data - name: wsgi-script configMap: name: wsgi-script diff --git a/roles/openshift-apps/mirrormanager/files/storage.yml b/roles/openshift-apps/mirrormanager/files/storage.yml index ee962c9def..d19c939fc6 100644 --- a/roles/openshift-apps/mirrormanager/files/storage.yml +++ b/roles/openshift-apps/mirrormanager/files/storage.yml @@ -2,7 +2,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: statistics + name: data spec: accessModes: - ReadWriteMany diff --git a/roles/openshift-apps/mirrormanager/templates/configmap.yml b/roles/openshift-apps/mirrormanager/templates/configmap.yml index 208e9bf395..8b624c3c16 100644 --- a/roles/openshift-apps/mirrormanager/templates/configmap.yml +++ b/roles/openshift-apps/mirrormanager/templates/configmap.yml @@ -11,8 +11,8 @@ items: labels: app: mirrormanager data: - mm.cfg: |- - {{ load_file('mm.cfg.py') | indent(6) }} + mirrormanager2.cfg: |- + {{ load_file('mirrormanager2.cfg.py') | indent(6) }} gunicorn.conf.py: |- {{ load_file('gunicorn.conf.py') | indent(6) }} - apiVersion: v1 diff --git a/roles/openshift-apps/mirrormanager/templates/mm.cfg.py b/roles/openshift-apps/mirrormanager/templates/mirrormanager2.cfg.py similarity index 97% rename from roles/openshift-apps/mirrormanager/templates/mm.cfg.py rename to roles/openshift-apps/mirrormanager/templates/mirrormanager2.cfg.py index 5b90a8a595..c092807cce 100644 --- a/roles/openshift-apps/mirrormanager/templates/mm.cfg.py +++ b/roles/openshift-apps/mirrormanager/templates/mirrormanager2.cfg.py @@ -77,7 +77,7 @@ SMTP_SERVER = 'bastion{{ env_suffix }}.fedoraproject.org' # This is the directory the code enabled by SHOW_STATISTICS will use # to locate the statistics files and display them. -# STATISTICS_BASE = '/var/www/mirrormanager-statistics/data' +STATISTICS_BASE = '/var/lib/mirrormanager/statistics/data' # Countries which have to be excluded. EMBARGOED_COUNTRIES = ['CU', 'IR', 'KP', 'SD', 'SY'] @@ -98,7 +98,10 @@ EMBARGOED_COUNTRIES = ['CU', 'IR', 'KP', 'SD', 'SY'] # SHOW_PROPAGATION = True # Where to look for the above mentioned propagation images. -# PROPAGATION_BASE = '/var/www/mirrormanager-statistics/data/propagation' +PROPAGATION_BASE = '/var/lib/mirrormanager/statistics/data/propagation' + +# Where the GeoIP database lives +GEOIP_BASE = "/var/lib/mirrormanager/geoip" # Disable master rsync server ACL # Fedora does not use it and therefore it is set to False