From 21be5d23f7ff889cc6b4def7d8ee74652c176209 Mon Sep 17 00:00:00 2001 From: Clement Verna Date: Dec 05 2018 06:25:10 +0000 Subject: Add FPDC sop Signed-off-by: Clement Verna --- diff --git a/docs/sysadmin-guide/sops/fpdc.rst b/docs/sysadmin-guide/sops/fpdc.rst new file mode 100644 index 0000000..28c5213 --- /dev/null +++ b/docs/sysadmin-guide/sops/fpdc.rst @@ -0,0 +1,93 @@ +.. title: Fedora Product Definition Center SOP +.. slug: infra-fpdc +.. date: 2018-11-14 +.. taxonomy: Contributors/Infrastructure + +============== +FPDC SOP +============== + +Fedora Product Definition Center is a service that aims to replace `PDC `_ in Fedora. +It is meant to be a database with REST API access used to store data needed by other services. + +Contact Information +=================== + +Owner + Infrastructure Team + +Contact + #fedora-apps, #fedora-admin + +Persons + cverna, abompard + +Location + Phoenix (Openshift) + +Public addresses + - fpdc.fedoraproject.org + - fpdc.stg.fedoraproject.org + +Servers + - os.fedoraproject.org + - os.stg.fedoraproject.org + +Purpose + Centralize metadata and facilitate access. + + +Systems +======= + +FPDC is built using the DJANGO REST FRAMEWORK and uses a POSTGRESQL database to store the metadata. +The application is run on Openshift and uses the Source-to-image technology to build the container directly from the `git repository `_. + +In the staging environment the appplication is automatically rebuilt for every new commit in the master branch, +this is achieved by configuring the github webhook's to trigger an openshift deployment. + +The production deployment is currently manual and is done using the following ansible playbook :: + + sudo rbac-playbook openshift-apps/fpdc.yml -l os-masters + + +Logs +==== + +Logs can be retrive using the openshift command line:: + + $ oc login os-master01.phx2.fedoraproject.org + You must obtain an API token by visiting https://os.fedoraproject.org/oauth/token/request + + $ oc login os-master01.phx2.fedoraproject.org --token= + $ oc get pods + fpdc-28-bfj52 1/1 Running 522 28d + $ oc logs fpdc-28-bfj52 + + +Database migrations +=================== + +FPDC uses the `recreate` deployment configuration of openshift, which means that openshift will bring down the pods currently running and recreate new ones with the new version of the application. +In the phase between the pods being down and the new pods being up, the database migrations are run in an independent pod. + + +Things that could go wrong +========================== + +Hopefully not much. If something goes wrong is it currently advised to kill the pods to trigger a fresh deployment. :: + + $ oc login os-master01.phx2.fedoraproject.org + You must obtain an API token by visiting https://os.fedoraproject.org/oauth/token/request + + $ oc login os-master01.phx2.fedoraproject.org --token= + $ oc get pods + fpdc-28-bfj52 1/1 Running 522 28d + $ oc delete pod fpdc-28-bfj52 + +It is also possible to rollback to a previous version :: + + $ oc get dc + NAME REVISION DESIRED CURRENT TRIGGERED BY + fpdc 39 1 1 config,image(fpdc:latest) + $ oc rollback fpdc