bodhi: version 5.2 in production, also enable celery-beat in production

Signed-off-by: Clement Verna <cverna@tutanota.com>
This commit is contained in:
Clement Verna 2020-03-23 09:13:59 +01:00 committed by Pierre-Yves Chibon
parent 6d1a2f1373
commit 3b92a8e3c7
7 changed files with 7 additions and 175 deletions

View file

@ -12,5 +12,5 @@ nagios_Check_Services:
# Set some bodhi variables here. # Set some bodhi variables here.
# Since they are used when running playbooks against the master nodes. # Since they are used when running playbooks against the master nodes.
# #
bodhi_version: 5.1.1-1.fc30 bodhi_version: 5.2.0-1.fc30
bodhi_openshift_pods: 2 bodhi_openshift_pods: 2

View file

@ -11,5 +11,5 @@ nagios_Check_Services:
# Set some bodhi variables here. # Set some bodhi variables here.
# Since they are used when running playbooks against the master nodes. # Since they are used when running playbooks against the master nodes.
# #
bodhi_version: 5.1.1-1.fc30 bodhi_version: 5.2.0-1.fc30
bodhi_openshift_pods: 1 bodhi_openshift_pods: 1

View file

@ -91,18 +91,6 @@
- role: openshift/imagestream - role: openshift/imagestream
app: bodhi app: bodhi
imagename: bodhi-base imagename: bodhi-base
- role: openshift/imagestream
app: bodhi
imagename: bodhi-web
- role: openshift/imagestream
app: bodhi
imagename: bodhi-consumer
- role: openshift/imagestream
app: bodhi
imagename: bodhi-celery
- role: openshift/imagestream
app: bodhi
imagename: bodhi-celery-beat
- role: openshift/object - role: openshift/object
app: bodhi app: bodhi
template: buildconfig.yml template: buildconfig.yml

View file

@ -184,7 +184,7 @@
user: apache user: apache
job: "/usr/bin/bodhi-approve-testing /etc/bodhi/production.ini > /dev/null" job: "/usr/bin/bodhi-approve-testing /etc/bodhi/production.ini > /dev/null"
cron_file: bodhi-approve-testing-job cron_file: bodhi-approve-testing-job
state: "{{ (env == 'production')|ternary('present', 'absent') }}" state: absent
tags: tags:
- config - config
- bodhi - bodhi
@ -198,7 +198,7 @@
user: apache user: apache
job: "/usr/bin/bodhi-check-policies >& /dev/null" job: "/usr/bin/bodhi-check-policies >& /dev/null"
cron_file: bodhi-check-policies-job cron_file: bodhi-check-policies-job
state: "{{ (env == 'production')|ternary('present', 'absent') }}" state: absent
tags: tags:
- config - config
- bodhi - bodhi
@ -212,7 +212,7 @@
user: root user: root
job: "/usr/bin/bodhi-clean-old-composes 2>&1 | logger -t bodhi-clean-old-composes" job: "/usr/bin/bodhi-clean-old-composes 2>&1 | logger -t bodhi-clean-old-composes"
cron_file: bodhi-clean-old-composes cron_file: bodhi-clean-old-composes
state: "{{ (env == 'production')|ternary('present', 'absent') }}" state: absent
tags: tags:
- config - config
- bodhi - bodhi
@ -226,7 +226,7 @@
user: apache user: apache
job: "/usr/bin/bodhi-expire-overrides /etc/bodhi/production.ini 2>&1 | logger -t bodhi-expire-overrides" job: "/usr/bin/bodhi-expire-overrides /etc/bodhi/production.ini 2>&1 | logger -t bodhi-expire-overrides"
cron_file: bodhi-expire-overrides-job cron_file: bodhi-expire-overrides-job
state: "{{ (env == 'production')|ternary('present', 'absent') }}" state: absent
tags: tags:
- config - config
- bodhi - bodhi

View file

@ -39,9 +39,7 @@ task_routes = {
'clean_old_composes': {'queue': 'has_koji_mount'}, 'clean_old_composes': {'queue': 'has_koji_mount'},
} }
{% if env == "staging" %}
# Periodic tasks # Periodic tasks
beat_schedule = { beat_schedule = {
"approve-testing": { "approve-testing": {
"task": "approve_testing", "task": "approve_testing",
@ -63,4 +61,3 @@ beat_schedule = {
} }
beat_schedule_filename = "/tmp/celery-beat-schedule" beat_schedule_filename = "/tmp/celery-beat-schedule"
{% endif %}

View file

@ -18,7 +18,7 @@ items:
RUN curl -o /etc/yum.repos.d/infra-tags.repo https://infrastructure.fedoraproject.org/cgit/ansible.git/plain/files/common/fedora-infra-tags.repo RUN curl -o /etc/yum.repos.d/infra-tags.repo https://infrastructure.fedoraproject.org/cgit/ansible.git/plain/files/common/fedora-infra-tags.repo
# While dnf has a --nodocs, it doesen't have a --docs... # While dnf has a --nodocs, it doesen't have a --docs...
RUN sed -i '/nodocs/d' /etc/dnf/dnf.conf RUN sed -i '/nodocs/d' /etc/dnf/dnf.conf
RUN dnf install -y bodhi-server-{{bodhi_version}} && \ RUN dnf install -y bodhi-server-{{bodhi_version}} bodhi-docs-{{bodhi_version}} python3-pyramid_sawing && \
curl -o /usr/lib/python3.7/site-packages/bodhi/server/templates/errors.html https://infrastructure.fedoraproject.org/cgit/ansible.git/plain/files/bodhi/errors.html curl -o /usr/lib/python3.7/site-packages/bodhi/server/templates/errors.html https://infrastructure.fedoraproject.org/cgit/ansible.git/plain/files/bodhi/errors.html
# Set up krb5 # Set up krb5
RUN rm -f /etc/krb5.conf && \ RUN rm -f /etc/krb5.conf && \
@ -36,114 +36,3 @@ items:
name: bodhi-base:latest name: bodhi-base:latest
kind: List kind: List
metadata: {} metadata: {}
---
apiVersion: v1
items:
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
build: bodhi-web
name: bodhi-web
spec:
runPolicy: Serial
source:
dockerfile: |-
FROM bodhi-base
LABEL \
name="bodhi-web" \
vendor="Fedora Infrastructure" \
license="MIT"
#RUN dnf install --refresh -y bodhi-docs-{{bodhi_version}} python3-pyramid_sawing
RUN dnf install --refresh -y https://kojipkgs.fedoraproject.org//packages/bodhi/5.1.0/2.fc30.infra/noarch/bodhi-docs-5.1.0-2.fc30.infra.noarch.rpm python3-pyramid_sawing
EXPOSE 8080
ENTRYPOINT bash /etc/bodhi/start.sh
type: Dockerfile
strategy:
type: Docker
dockerStrategy:
from:
kind: "ImageStreamTag"
name: "bodhi-base:latest"
noCache: false
triggers:
- type: "imageChange"
imageChange: {}
output:
to:
kind: ImageStreamTag
name: bodhi-web:latest
kind: List
metadata: {}
---
apiVersion: v1
items:
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
build: bodhi-consumer
name: bodhi-consumer
spec:
runPolicy: Serial
source:
dockerfile: |-
FROM bodhi-base
LABEL \
name="bodhi-consumer" \
vendor="Fedora Infrastructure" \
license="MIT"
ENTRYPOINT /usr/bin/fedora-messaging consume
type: Dockerfile
strategy:
type: Docker
dockerStrategy:
from:
kind: "ImageStreamTag"
name: "bodhi-base:latest"
noCache: false
triggers:
- type: "imageChange"
imageChange: {}
output:
to:
kind: ImageStreamTag
name: bodhi-consumer:latest
kind: List
metadata: {}
---
apiVersion: v1
items:
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
build: bodhi-celery
name: bodhi-celery
spec:
runPolicy: Serial
source:
dockerfile: |-
FROM bodhi-base
LABEL \
name="bodhi-celery" \
vendor="Fedora Infrastructure" \
license="MIT"
ENTRYPOINT /usr/bin/celery worker -A bodhi.server.tasks.app -l info -Q celery
type: Dockerfile
strategy:
type: Docker
dockerStrategy:
from:
kind: "ImageStreamTag"
name: "bodhi-base:latest"
noCache: false
triggers:
- type: "imageChange"
imageChange: {}
output:
to:
kind: ImageStreamTag
name: bodhi-celery:latest
kind: List
metadata: {}

View file

@ -57,13 +57,9 @@ items:
spec: spec:
containers: containers:
- name: bodhi-web - name: bodhi-web
{% if env == "staging" %}
image: bodhi-base:latest image: bodhi-base:latest
command: ["bash"] command: ["bash"]
args: ["/etc/bodhi/start.sh"] args: ["/etc/bodhi/start.sh"]
{% else %}
image: bodhi-web:latest
{% endif %}
ports: ports:
- containerPort: 8080 - containerPort: 8080
resources: {} resources: {}
@ -95,22 +91,14 @@ items:
timeoutSeconds: 10 timeoutSeconds: 10
initialDelaySeconds: 5 initialDelaySeconds: 5
httpGet: httpGet:
{% if env == "staging" %}
path: /healthz/ready path: /healthz/ready
{% else %}
path: /
{% endif %}
port: 8080 port: 8080
livenessProbe: livenessProbe:
timeoutSeconds: 10 timeoutSeconds: 10
initialDelaySeconds: 30 initialDelaySeconds: 30
periodSeconds: 30 periodSeconds: 30
httpGet: httpGet:
{% if env == "staging" %}
path: /healthz/live path: /healthz/live
{% else %}
path: /
{% endif %}
port: 8080 port: 8080
volumes: volumes:
- name: config-volume - name: config-volume
@ -140,11 +128,7 @@ items:
- bodhi-web - bodhi-web
from: from:
kind: ImageStreamTag kind: ImageStreamTag
{% if env == "staging" %}
name: bodhi-base:latest name: bodhi-base:latest
{% else %}
name: bodhi-web:latest
{% endif %}
namespace: bodhi namespace: bodhi
type: ImageChange type: ImageChange
- type: ConfigChange - type: ConfigChange
@ -189,13 +173,9 @@ items:
spec: spec:
containers: containers:
- name: bodhi-consumer - name: bodhi-consumer
{% if env == "staging" %}
image: bodhi-base:latest image: bodhi-base:latest
command: ["/usr/bin/fedora-messaging"] command: ["/usr/bin/fedora-messaging"]
args: ["consume"] args: ["consume"]
{% else %}
image: bodhi-consumer:latest
{% endif %}
resources: {} resources: {}
volumeMounts: volumeMounts:
- name: config-volume - name: config-volume
@ -245,11 +225,7 @@ items:
- bodhi-consumer - bodhi-consumer
from: from:
kind: ImageStreamTag kind: ImageStreamTag
{% if env == "staging" %}
name: bodhi-base:latest name: bodhi-base:latest
{% else %}
name: bodhi-consumer:latest
{% endif %}
namespace: bodhi namespace: bodhi
type: ImageChange type: ImageChange
- type: ConfigChange - type: ConfigChange
@ -294,13 +270,9 @@ items:
spec: spec:
containers: containers:
- name: bodhi-celery - name: bodhi-celery
{% if env == "staging" %}
image: bodhi-base:latest image: bodhi-base:latest
command: ["/usr/bin/celery"] command: ["/usr/bin/celery"]
args: ["worker", "-A", "bodhi.server.tasks.app", "-l", "info", "-Q", "celery"] args: ["worker", "-A", "bodhi.server.tasks.app", "-l", "info", "-Q", "celery"]
{% else %}
image: bodhi-celery:latest
{% endif %}
resources: {} resources: {}
volumeMounts: volumeMounts:
- name: config-volume - name: config-volume
@ -350,17 +322,12 @@ items:
- bodhi-celery - bodhi-celery
from: from:
kind: ImageStreamTag kind: ImageStreamTag
{% if env == "staging" %}
name: bodhi-base:latest name: bodhi-base:latest
{% else %}
name: bodhi-celery:latest
{% endif %}
namespace: bodhi namespace: bodhi
type: ImageChange type: ImageChange
- type: ConfigChange - type: ConfigChange
kind: List kind: List
metadata: {} metadata: {}
{% if env == "staging" %}
--- ---
apiVersion: v1 apiVersion: v1
items: items:
@ -397,14 +364,10 @@ items:
spec: spec:
containers: containers:
- name: bodhi-celery-beat - name: bodhi-celery-beat
{% if env == "staging" %}
image: bodhi-base:latest image: bodhi-base:latest
workingDir: "/tmp" workingDir: "/tmp"
command: ["/usr/bin/celery"] command: ["/usr/bin/celery"]
args: ["beat", "-A", "bodhi.server.tasks.app", "-l", "info"] args: ["beat", "-A", "bodhi.server.tasks.app", "-l", "info"]
{% else %}
image: bodhi-celery-beat:latest
{% endif %}
resources: {} resources: {}
volumeMounts: volumeMounts:
- name: config-volume - name: config-volume
@ -454,14 +417,9 @@ items:
- bodhi-celery-beat - bodhi-celery-beat
from: from:
kind: ImageStreamTag kind: ImageStreamTag
{% if env == "staging" %}
name: bodhi-base:latest name: bodhi-base:latest
{% else %}
name: bodhi-celery-beat:latest
{% endif %}
namespace: bodhi namespace: bodhi
type: ImageChange type: ImageChange
- type: ConfigChange - type: ConfigChange
kind: List kind: List
metadata: {} metadata: {}
{% endif %}