forked from infra/ansible
bodhi-stg: use valkey cache
Signed-off-by: Mattia Verga <mattia.verga@tiscali.it>
This commit is contained in:
parent
16642a1d02
commit
481443b92f
7 changed files with 55 additions and 6 deletions
|
|
@ -83,6 +83,11 @@
|
|||
object_template: secret.yml.j2
|
||||
object_objectname: secret.yml
|
||||
when: env == "staging"
|
||||
- role: openshift/object
|
||||
object_app: bodhi
|
||||
object_template: valkey-configmap.yml.j2
|
||||
object_objectname: valkey-configmap.yml
|
||||
when: env == "staging"
|
||||
- role: openshift/keytab
|
||||
keytab_app: bodhi
|
||||
keytab_key: koji-keytab
|
||||
|
|
@ -194,7 +199,7 @@
|
|||
ansible.builtin.command: oc -n bodhi scale deployment bodhi-celery --replicas={{ bodhi_openshift_pods }}
|
||||
when: env == "staging"
|
||||
- name: Scale up pods
|
||||
ansible.builtin.command: oc -n bodhi scale deployment bodhi-web --replicas={{ bodhi_openshift_pods }}
|
||||
ansible.builtin.command: oc -n bodhi scale deployment bodhi-web --replicas={{ bodhi_openshift_pods_stg_web }}
|
||||
when: env == "staging"
|
||||
- name: Set the timeout to the openshift route
|
||||
ansible.builtin.command: "oc -n bodhi annotate route bodhi-web --overwrite haproxy.router.openshift.io/timeout=180s"
|
||||
|
|
|
|||
|
|
@ -366,12 +366,34 @@ top_testers_timeframe = 900
|
|||
# stacks_enabled = False
|
||||
|
||||
# Cache settings
|
||||
{% if env == 'staging' %}
|
||||
dogpile.cache.backend = dogpile.cache.redis
|
||||
# Set expiration_time to one week
|
||||
dogpile.cache.expiration_time = 604800
|
||||
dogpile.cache.dogpile_expire_time = 10
|
||||
dogpile.cache.arguments.url = redis://default:{{bodhi_valkey_secret}}@bodhi-valkey:6379/0
|
||||
# dogpile.cache.arguments.host =
|
||||
# dogpile.cache.arguments.port = 6379
|
||||
# dogpile.cache.arguments.db = 0
|
||||
# dogpile.cache.arguments.username = default
|
||||
# dogpile.cache.arguments.password = This_Is_JustAT3st
|
||||
dogpile.cache.arguments.distributed_lock = True
|
||||
dogpile.cache.arguments.thread_local_lock = False
|
||||
dogpile.cache.arguments.lock_timeout = 5
|
||||
dogpile.cache.arguments.lock_sleep = 0.1
|
||||
dogpile.cache.arguments.lock_prefix = bodhi:dogpile_lock:
|
||||
# Set redis expiration_time to one week + 1 hour
|
||||
dogpile.cache.arguments.redis_expiration_time = 608400
|
||||
dogpile.cache.arguments.connection_pool_kwargs.max_connections = 20
|
||||
dogpile.cache.arguments.connection_pool_kwargs.socket_keepalive = True
|
||||
{% else %}
|
||||
# dogpile.cache.backend = dogpile.cache.dbm
|
||||
# dogpile.cache.expiration_time = 100
|
||||
# dogpile.cache.arguments.filename = /var/cache/bodhi-dogpile-cache.dbm
|
||||
dogpile.cache.backend = dogpile.cache.memory_pickle
|
||||
# Cache expires every 6 hours.
|
||||
dogpile.cache.expiration_time = 21600
|
||||
{% endif %}
|
||||
|
||||
# Exclude sending emails to these users
|
||||
# exclude_mail = bodhi
|
||||
|
|
|
|||
|
|
@ -386,7 +386,7 @@ spec:
|
|||
- name: bodhi-valkey
|
||||
image: image-registry.openshift-image-registry.svc:5000/bodhi/bodhi-valkey:latest
|
||||
command: ["valkey-server"]
|
||||
args: ["/etc/valkey/valkey.conf", "--logfile", "", "--pidfile", "", "--unixsocket", "", "--bind", "0.0.0.0", "--requirepass", "$(VALKEY_PASSWORD)"]
|
||||
args: ["/etc/valkey/valkey.conf", "--include", "/etc/valkey/valkey-overrides.conf", "--requirepass", "$(VALKEY_PASSWORD)"]
|
||||
env:
|
||||
- name: VALKEY_PASSWORD
|
||||
valueFrom:
|
||||
|
|
@ -397,6 +397,9 @@ spec:
|
|||
volumeMounts:
|
||||
- name: bodhi-valkey-data-volume
|
||||
mountPath: /data
|
||||
- name: bodhi-valkey-config-volume
|
||||
mountPath: /etc/valkey/valkey-overrides.conf
|
||||
subPath: valkey-overrides.conf
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
protocol: TCP
|
||||
|
|
@ -417,6 +420,9 @@ spec:
|
|||
- name: bodhi-valkey-data-volume
|
||||
persistentVolumeClaim:
|
||||
claimName: "bodhi-valkey-storage{{ '-stg' if env == 'staging' else '' }}"
|
||||
- name: bodhi-valkey-config-volume
|
||||
configMap:
|
||||
name: bodhi-valkey-config
|
||||
---
|
||||
# bodhi-valkey Service
|
||||
apiVersion: v1
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{% if env == "staging" %}
|
||||
FROM fedora:44
|
||||
FROM quay.io/fedora/fedora:44
|
||||
{% else %}
|
||||
FROM fedora:43
|
||||
FROM quay.io/fedora/fedora:43
|
||||
{% endif %}
|
||||
LABEL \
|
||||
name="bodhi-base" \
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{% if env == "staging" %}
|
||||
FROM fedora:43
|
||||
FROM quay.io/fedora/fedora:43
|
||||
{% else %}
|
||||
FROM fedora:43
|
||||
FROM quay.io/fedora/fedora:43
|
||||
{% endif %}
|
||||
LABEL \
|
||||
name="bodhi-critpathcron" \
|
||||
|
|
|
|||
15
roles/openshift-apps/bodhi/templates/valkey-configmap.yml.j2
Normal file
15
roles/openshift-apps/bodhi/templates/valkey-configmap.yml.j2
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{% if env == "staging" %}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: bodhi-valkey-config
|
||||
labels:
|
||||
app: bodhi-valkey
|
||||
data:
|
||||
valkey-overrides.conf: |
|
||||
bind 0.0.0.0
|
||||
logfile ""
|
||||
loglevel {{ 'verbose' if env == 'staging' else 'notice' }}
|
||||
pidfile ""
|
||||
dir /data
|
||||
{% endif %}
|
||||
|
|
@ -3,4 +3,5 @@
|
|||
bodhi_version: "{{ (env == 'production')|ternary('26.4.0', '26.4.0') }}"
|
||||
bodhi_openshift_pods: 1
|
||||
bodhi_openshift_pods_stg_consumers: 15
|
||||
bodhi_openshift_pods_stg_web: 2
|
||||
bodhi_sent_topics: ^org\.fedoraproject\.{{ env_short }}\.(bodhi|pungi)\..*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue