From fbc016ebaa98516d070cc00539a68307e226f9a2 Mon Sep 17 00:00:00 2001 From: Ryan Lerch Date: Thu, 6 Jul 2023 15:56:50 +1000 Subject: [PATCH] Remove nuancier-openshift Work had started on moving nuancier to openshift, but was never deployed. This removes this. Nuancier is being shut down. Signed-off-by: Ryan Lerch --- playbooks/openshift-apps/nuancier.yml | 58 --------------- .../nuancier/files/deploymentconfig.yml | 74 ------------------- .../openshift-apps/nuancier/files/service.yml | 15 ---- .../nuancier/templates/alembic.ini | 54 -------------- .../nuancier/templates/buildconfig.yml | 30 -------- .../nuancier/templates/configmap.yml | 13 ---- .../nuancier/templates/imagestream.yml | 10 --- .../nuancier/templates/nuancier.cfg | 70 ------------------ .../nuancier/templates/storage.yml | 15 ---- 9 files changed, 339 deletions(-) delete mode 100644 playbooks/openshift-apps/nuancier.yml delete mode 100644 roles/openshift-apps/nuancier/files/deploymentconfig.yml delete mode 100644 roles/openshift-apps/nuancier/files/service.yml delete mode 100644 roles/openshift-apps/nuancier/templates/alembic.ini delete mode 100644 roles/openshift-apps/nuancier/templates/buildconfig.yml delete mode 100644 roles/openshift-apps/nuancier/templates/configmap.yml delete mode 100644 roles/openshift-apps/nuancier/templates/imagestream.yml delete mode 100644 roles/openshift-apps/nuancier/templates/nuancier.cfg delete mode 100644 roles/openshift-apps/nuancier/templates/storage.yml diff --git a/playbooks/openshift-apps/nuancier.yml b/playbooks/openshift-apps/nuancier.yml deleted file mode 100644 index 4715711f55..0000000000 --- a/playbooks/openshift-apps/nuancier.yml +++ /dev/null @@ -1,58 +0,0 @@ -- name: make the app be real - hosts: os_control_stg[0] - user: root - gather_facts: False - - vars_files: - - /srv/web/infra/ansible/vars/global.yml - - "/srv/private/ansible/vars.yml" - - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml - - roles: - - role: openshift/project - app: nuancier - description: Fedora nuancier apps - appowners: - - kevin - - - role: openshift/object - app: nuancier - template: imagestream.yml - objectname: imagestream.yml - - - role: openshift/object - app: nuancier - template: buildconfig.yml - objectname: buildconfig.yml - - - role: openshift/object - app: nuancier - template: storage.yml - objectname: storage.yml - - - role: openshift/object - app: nuancier - template: configmap.yml - objectname: configmap.yml - - - role: openshift/start-build - app: nuancier - buildname: nuancier-build - objectname: nuancier-build - - - role: openshift/object - app: nuancier - file: service.yml - objectname: service.yml - - - role: openshift/route - app: nuancier - routename: nuancier - host: "wallpapers{{ env_suffix }}.fedoraproject.org" - serviceport: 8080-tcp - servicename: nuancier - - - role: openshift/object - app: nuancier - file: deploymentconfig.yml - objectname: deploymentconfig.yml diff --git a/roles/openshift-apps/nuancier/files/deploymentconfig.yml b/roles/openshift-apps/nuancier/files/deploymentconfig.yml deleted file mode 100644 index bf325215e4..0000000000 --- a/roles/openshift-apps/nuancier/files/deploymentconfig.yml +++ /dev/null @@ -1,74 +0,0 @@ ---- -apiVersion: v1 -kind: DeploymentConfig -metadata: - labels: - app: nuancier - service: nuancier - name: nuancier -spec: - replicas: 1 - selector: - app: nuancier - deploymentconfig: nuancier - strategy: - type: Recreate - recreateParams: -# mid: -# failurePolicy: Abort -# execNewPod: -# containerName: nuancier -# command: ["alembic", "upgrade", "head", "-c", "/opt/app-root/config/alembic.ini"] -# env: -# - name: PYTHONPATH -# value: /opt/app-root/src -# volumes: -# - config-volume - template: - metadata: - labels: - app: nuancier - deploymentconfig: nuancier - spec: - containers: - - name: nuancier - image: nuancier:latest - ports: - - containerPort: 8080 - resources: {} - volumeMounts: - - name: config-volume - mountPath: /opt/app-root/config/ - readOnly: true - - name: data-volume - mountPath: /var/cache/nuancier/ - readinessProbe: - timeoutSeconds: 1 - initialDelaySeconds: 5 - httpGet: - path: / - port: 8080 - livenessProbe: - timeoutSeconds: 1 - initialDelaySeconds: 30 - httpGet: - path: / - port: 8080 - volumes: - - name: config-volume - configMap: - name: nuancier-configmap - - name: data-volume - persistentVolumeClaim: - claimName: nuancier-storage - - triggers: - - type: ConfigChange - - type: ImageChange - imageChangeParams: - automatic: true - containerNames: - - nuancier - from: - kind: ImageStreamTag - name: nuancier:latest diff --git a/roles/openshift-apps/nuancier/files/service.yml b/roles/openshift-apps/nuancier/files/service.yml deleted file mode 100644 index 837ad76756..0000000000 --- a/roles/openshift-apps/nuancier/files/service.yml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: - app: nuancier - name: nuancier -spec: - ports: - - name: 8080-tcp - port: 8080 - protocol: TCP - targetPort: 8080 - selector: - app: nuancier - deploymentconfig: nuancier diff --git a/roles/openshift-apps/nuancier/templates/alembic.ini b/roles/openshift-apps/nuancier/templates/alembic.ini deleted file mode 100644 index a2761646de..0000000000 --- a/roles/openshift-apps/nuancier/templates/alembic.ini +++ /dev/null @@ -1,54 +0,0 @@ -# A generic, single database configuration. - -[alembic] -# path to migration scripts -script_location = /opt/app-root/src/nuancier/alembic - -# template used to generate migration files -# file_template = %%(rev)s_%%(slug)s - -# set to 'true' to run the environment during -# the 'revision' command, regardless of autogenerate -# revision_environment = false - -{% if env == 'staging' %} -sqlalchemy.url = postgresql://{{ nuancier_db_admin_user }}:{{ nuancier_db_admin_pass }}@db01.stg.iad2.fedoraproject.org/{{ nuancier_db_name }} -{% else %} -sqlalchemy.url = postgresql://{{ nuancier_db_admin_user }}:{{ nuancier_db_admin_pass }}@db01.iad2.fedoraproject.org/{{ nuancier_db_name }} -{% endif %} - - -# Logging configuration -[loggers] -keys = root,sqlalchemy,alembic - -[handlers] -keys = console - -[formatters] -keys = generic - -[logger_root] -level = WARN -handlers = console -qualname = - -[logger_sqlalchemy] -level = WARN -handlers = -qualname = sqlalchemy.engine - -[logger_alembic] -level = INFO -handlers = -qualname = alembic - -[handler_console] -class = StreamHandler -args = (sys.stderr,) -level = NOTSET -formatter = generic - -[formatter_generic] -format = %(levelname)-5.5s [%(name)s] %(message)s -datefmt = %H:%M:%S diff --git a/roles/openshift-apps/nuancier/templates/buildconfig.yml b/roles/openshift-apps/nuancier/templates/buildconfig.yml deleted file mode 100644 index 751a3a54d1..0000000000 --- a/roles/openshift-apps/nuancier/templates/buildconfig.yml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: build.openshift.io/v1 -kind: BuildConfig -metadata: - name: nuancier-build - labels: - environment: "nuancier" -spec: - output: - to: - kind: ImageStreamTag - name: nuancier:latest - source: - type: Git - git: - uri: https://pagure.io/nuancier.git -{% if env == 'staging' %} - ref: "staging" -{% else %} - ref: "production" -{% endif %} - strategy: - type: Source - sourceStrategy: - from: - kind: ImageStreamTag - namespace: openshift - name: python:2.7 - triggers: - - type: ConfigChange - - type: ImageChange diff --git a/roles/openshift-apps/nuancier/templates/configmap.yml b/roles/openshift-apps/nuancier/templates/configmap.yml deleted file mode 100644 index 9e3cb67d1d..0000000000 --- a/roles/openshift-apps/nuancier/templates/configmap.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: nuancier-configmap - labels: - app: nuancier -{% macro load_file(filename) %}{% include filename %}{%- endmacro -%} -data: - alembic.ini: |- - {{ load_file('alembic.ini') | indent }} - nuancier.cfg: |- - {{ load_file('nuancier.cfg') | indent }} diff --git a/roles/openshift-apps/nuancier/templates/imagestream.yml b/roles/openshift-apps/nuancier/templates/imagestream.yml deleted file mode 100644 index 5f44240838..0000000000 --- a/roles/openshift-apps/nuancier/templates/imagestream.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -apiVersion: image.openshift.io/v1 -kind: ImageStream -metadata: - name: nuancier -spec: - lookupPolicy: - local: false -status: - dockerImageRepository: "" diff --git a/roles/openshift-apps/nuancier/templates/nuancier.cfg b/roles/openshift-apps/nuancier/templates/nuancier.cfg deleted file mode 100644 index 5a2eecee50..0000000000 --- a/roles/openshift-apps/nuancier/templates/nuancier.cfg +++ /dev/null @@ -1,70 +0,0 @@ -# Beware that the quotes around the values are mandatory - -import os - -### Secret key for the Flask application -SECRET_KEY='{{ nuancier_secret_key }}' - -### url to the database server: -{% if env == 'staging' %} -DB_URL='postgresql://{{ nuancier_db_user }}:{{ nuancier_db_pass }}@db01.stg.iad2.fedoraproject.org/{{ nuancier_db_name }}' -{% else %} -DB_URL='postgresql://{{ nuancier_db_user }}:{{ nuancier_db_pass }}@db01.iad2.fedoraproject.org/{{ nuancier_db_name }}' -{% endif %} - -### The FAS groups in which the admin of nuancier are -### This can either be a single group or multiple, defined between -### parenthesis. -ADMIN_GROUP=('sysadmin-nuancier', 'sysadmin-main') -# FAS group for the nuancier reviewers -REVIEW_GROUP = ('nuancier-mentors') -# FAS group of users having a higher vote -WEIGHTED_GROUP = ('sysadmin-nuancier', 'designteam') - -### Static folder -### The folder containing the css, javascript as well as the pictures -### candidates and the cache of those pictures. -### This directory should be somewhere where apache can access, it's -### proposed in '/var/www/nuancier' -STATIC_FOLDER = '/var/cache/nuancier' - -### Pictures folder -### The folder in which are located the pictures of the different elections. -### This folder does not have to be writable by the application but should be -### readable. -### /!\ It should be the full path to this folder -PICTURE_FOLDER = os.path.join(STATIC_FOLDER, 'pictures') - -### Cache folder -### The folder in which the application will generate thumbnails of the pictures -### selected for an election. -### This folder *must* be *writable* by the application. -### /!\ It should be the full path to this folder -CACHE_FOLDER = os.path.join(STATIC_FOLDER, 'cache') - -### Size of the thumbnails (keeping the ratio) -### In order to reduce the loading page of the election page that might contains -### more than hundreds pictures, the application generates thumbnails of each -### pictures. -### The application will keep the ratio intact and just make sure that either -### length or width of the picture fit the length and width specified below. -THUMB_SIZE = (256, 256) - -# This is required to fix login in stg -PREFERRED_URL_SCHEME='https' - -# Make browsers send session cookie only via HTTPS -SESSION_COOKIE_SECURE = True - -# Used by SESSION_COOKIE_PATH -APPLICATION_ROOT = '/nuancier/' -SESSION_COOKIE_NAME = 'nuancier' - -# dogpile.cache configuration to work with memcached -#NUANCIER_CACHE_BACKEND = 'dogpile.cache.memcached' -#NUANCIER_CACHE_KWARGS = {'arguments' : { -# 'url': "127.0.0.1:11211", -# } -#} - -NUANCIER_EMAIL_NOTIFICATIONS = True diff --git a/roles/openshift-apps/nuancier/templates/storage.yml b/roles/openshift-apps/nuancier/templates/storage.yml deleted file mode 100644 index 02193e7e77..0000000000 --- a/roles/openshift-apps/nuancier/templates/storage.yml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: nuancier-storage -spec: - accessModes: - - ReadWriteMany - resources: - requests: -{% if env == 'staging' %} - storage: 10Gi -{% else %} - storage: 20Gi -{% endif %} - storageClassName: ""