We (Fedora QE) would like to host our Testdays app ( https://testdays.fedorainfracloud.org/ ) on the infrastructure OpenShift cluster. The app is important for Fedora Quality and Community Engagement.
It used to run on fedorainfracloud, then on Communishift and is currently deployed on temporary server (which is constantly overloaded and not designated for production).
The applications itself is a flask app, using postgresql and resultsdb as results storage. I've made changes to the app to support running on OpenShift, I am really not sure if it is the best practice, but that can be reworked based on feedback.
When running on OpenShift, it gets following information from env (both resultsdb and testdays require similar information):
POSTGRESQL_USER, POSTGRESQL_PASSWORD, POSTGRESQL_DATABASE
Username, password, database name. I've linked this from postgresql pod through configmap.
POSTGRESQL_SERVICE_HOST, POSTGRESQL_SERVICE_PORT
Host and port of the database. This was available for pod running testdays out of the box, without any config, I am not sure this is the case in infra cluster?
SECRET_KEY
Used for flask. I've filled this one manually by the output of "python -c 'import secrets; print(secrets.token_hex())'"
RESULTSDB_URL
URL to the pod with resultsdb. I believe this was available as resultsdb pod was running in the same project.
OPENSHIFT_PROD Indicates that the app should execute container codepath for confgiruation from env.
Apart from "RESULTSDB_URL", both testdays and resultsdb need the same information from env.
I've tried to put something for deployment, but I have no idea how can I test it locally. There are playbooks and deploymentconfigs taken from OpenShift demo ( https://learn.openshift.com/introduction/cluster-access/ ) and cleaned up a little bit. Building is done from resultsdb/testdays repositories through Dockerfiles present there.
I don't have much experience with OpenShift, I was able to set up testdays on communshift through web ui but I am lost a little bit here, so I'll be thankful for any help/mentoring and getting this up and running :)
Current WIP is here: https://pagure.io/fork/frantisekz/fedora-infra/ansible/commits/testdays_oc
Repositories and branches:
https://pagure.io/fedora-qa/testdays-web/ : branch develop
https://pagure.io/taskotron/resultsdb : branch openshift_WIP
Metadata Update from @smooge: - Issue priority set to: Waiting on Assignee (was: Needs Review) - Issue tagged with: dev, medium-gain, medium-trouble, ops
Dev to get items working and ops for any work in ansible (probably done by dev)
does it send fedora-messaging messages?
No, it does not.
Alright, so we have the application up and running on staging. It's set up with its database on db01.stg for now.
curl http://localhost:8080/events on the pod itself works fine.
curl http://localhost:8080/events
We need to: - finish the routing and set up the DNS - upload the current DB in db01.stg - test some :)
finish the routing and set up the DNS
I've started on this but apparently not enough :(
$ curl https://testdays.stg.fedoraproject.org/ -I |grep loca location: https://testdays-testdays.apps.os.fedorainfracloud.org
There is a rollout issue on new builds, discussed at: https://pagure.io/fedora-qa/testdays-web/pull-request/14#comment-133238
upload the current DB in db01.stg
I've uploaded this based on the dump provided by @frantisekz.
Note: I've only done the testdays part btw, I didn't do the resultsdb part.
@smooge @kevin We're having some issues with the dns configuration here. Do you have time to help here pretty please :) ? OpenShift is complaining about some issues with DNS parsing after deployment, app appears to be running just fine but it just can't be reached.
Thanks!
It wasn't dns, it was config on the proxy.
It was redirecting it to the fedorainfracloud.org ip. Then it wasn't reverse proxying to openshift.
I have fixed that and it seems reachable now?
It wasn't dns, it was config on the proxy. It was redirecting it to the fedorainfracloud.org ip. Then it wasn't reverse proxying to openshift. I have fixed that and it seems reachable now?
Yes, it's working now, thanks a lot!
Finished, app is deployed in Infra OpenShift.
Huge thanks @pingou !!!
Metadata Update from @frantisekz: - Issue close_status updated to: Fixed - Issue status updated to: Closed (was: Open)
Log in to comment on this ticket.