containerize!

This commit is contained in:
Tomas Tomecek
2016-08-12 11:19:59 +02:00
parent 4a994d71e7
commit f24898db79
4 changed files with 78 additions and 0 deletions

16
Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM fedora:24
# so we don't have to compile those when fetched from PyPI
RUN dnf install -y python-pip python2-setuptools python2-cffi python2-zmq python2-cryptography koji python2-pdc-client && \
dnf autoremove -y && dnf clean all && \
mkdir /opt/fm-orchestrator/
WORKDIR /opt/fm-orchestrator/
COPY ./requirements.txt /opt/fm-orchestrator/
RUN pip install --user -r ./requirements.txt
COPY koji.conf /etc/rida/
COPY . /opt/fm-orchestrator/
RUN python2 ./manage.py upgradedb && ./generate_localhost_cert.sh
CMD ["python2", "manage.py", "runssl"]

View File

@@ -315,3 +315,14 @@ E.g. ``"scmurl": "git://pkgs.stg.fedoraproject.org/modules/testmodule.git?#020ea
The toplevel directory containing the trees for each architecture of a module.
This field is only present when a module finished building, i.e. with the
states 'done' or 'ready'.
Development
===========
You can use docker containers for development. Here's a guide how to setup `docker <https://developer.fedoraproject.org/tools/docker/about.html>`_ and `docker-compose <https://developer.fedoraproject.org/tools/docker/compose.html>`_.
After your docker engine is set up and running, and docker-compose installed you can start whole system with a single command::
$ sudo docker-compose up

20
docker-compose.yml Normal file
View File

@@ -0,0 +1,20 @@
version: "2"
services:
ridad:
build:
context: .
command: python2 /opt/fm-orchestrator/ridad.py
volumes:
- ./rida/:/opt/fm-orchestrator/rida/ # rida sources are bind-mounted, so you don't have to rebuild
- ~/.fedora.cert:/root/.fedora.cert # koji credentials are mounted inside
- ~/.fedora-server-ca.cert:/root/.fedora-server-ca.cert
- ~/.fedora-upload-ca.cert:/root/.fedora-upload-ca.cert
rida:
build:
context: .
ports:
- "5000:5000"
links:
- ridad
volumes:
- ./rida/:/opt/fm-orchestrator/rida/

31
koji.conf Normal file
View File

@@ -0,0 +1,31 @@
[koji]
;configuration for koji cli tool
;url of XMLRPC server
server = http://koji.stg.fedoraproject.org/kojihub
;url of web interface
weburl = http://koji.stg.fedoraproject.org/koji
;url of package download site
topurl = http://kojipkgs.fedoraproject.org/
;path to the koji top directory
;topdir = /mnt/koji
;configuration for Kerberos authentication
;the service name of the principal being used by the hub
;krbservice = host
;configuration for SSL authentication
authtype = ssl
;client certificate
cert = ~/.fedora.cert
;certificate of the CA that issued the client certificate
ca = ~/.fedora-server-ca.cert
;certificate of the CA that issued the HTTP server certificate
serverca = ~/.fedora-server-ca.cert