Merge branch 'containerize'

This commit is contained in:
Nils Philippsen
2016-08-17 12:11:50 +02:00
5 changed files with 86 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,20 @@ 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
It may happen that you will run into issues and the container won't start properly. Best thing to do in that case is to rebuild the environment from scratch::
$ sudo docker-compose down -v
$ sudo docker-compose build --no-cache --pull
First command will stop and remove all containers and volumes and second command will pull latest base image and perform a clean build without cache.

2
Vagrantfile vendored
View File

@@ -6,6 +6,8 @@ $script = <<SCRIPT
pip install -r /opt/fm-orchestrator/src/requirements.txt
pip install -r /opt/fm-orchestrator/src/test-requirements.txt
cd /opt/fm-orchestrator/src
mkdir -p /etc/rida
cp -av koji.conf /etc/rida/
python manage.py upgradedb
./generate_localhost_cert.sh
SCRIPT

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/:Z # rida sources are bind-mounted, so you don't have to rebuild
- ~/.fedora.cert:/root/.fedora.cert:Z # koji credentials are mounted inside
- ~/.fedora-server-ca.cert:/root/.fedora-server-ca.cert:Z
- ~/.fedora-upload-ca.cert:/root/.fedora-upload-ca.cert:Z
rida:
build:
context: .
ports:
- "5000:5000"
links:
- ridad
volumes:
- ./rida/:/opt/fm-orchestrator/rida/:Z

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