From b4082dc55118f53199e3a988b0a8361b1119587e Mon Sep 17 00:00:00 2001 From: Matt Prahl Date: Fri, 21 Oct 2016 10:40:44 -0400 Subject: [PATCH] Rename module from rida to module_build_service Rename routes from /rida/1/module-builds/ to /module-build-service/1/module-builds/ --- .gitignore | 2 +- Dockerfile | 10 +-- README.rst | 56 ++++++------ Vagrantfile | 16 ++-- cleanup-koji-stg.sh | 6 +- config.py | 17 ++-- docker-compose.yml | 12 +-- fedmsg.d/{rida.py => module_build_service.py} | 4 +- jenkins-check-Dockerfile | 8 +- jenkins-check.sh | 4 +- manage.py | 12 +-- {rida => module_build_service}/__init__.py | 15 ++-- {rida => module_build_service}/auth.py | 2 +- {rida => module_build_service}/builder.py | 20 ++--- {rida => module_build_service}/config.py | 6 +- {rida => module_build_service}/errors.py | 0 {rida => module_build_service}/logger.py | 0 {rida => module_build_service}/messaging.py | 16 ++-- {rida => module_build_service}/models.py | 18 ++-- {rida => module_build_service}/pdc.py | 2 +- .../scheduler/__init__.py | 0 .../scheduler/handlers/__init__.py | 0 .../scheduler/handlers/components.py | 10 +-- .../scheduler/handlers/modules.py | 22 ++--- .../scheduler/handlers/repos.py | 14 +-- .../scheduler/main.py | 40 ++++----- {rida => module_build_service}/scm.py | 8 +- {rida => module_build_service}/utils.py | 6 +- {rida => module_build_service}/views.py | 28 +++--- ridad.py => module_build_service_daemon.py | 4 +- submit-build.sh | 4 +- tests/__init__.py | 10 +-- tests/test_auth.py | 16 ++-- .../test_messaging_functions.py | 22 ++--- tests/test_scheduler/test_module_wait.py | 16 ++-- tests/test_scheduler/test_repo_done.py | 39 ++++----- tests/test_views/test_views.py | 86 +++++++++---------- 37 files changed, 276 insertions(+), 275 deletions(-) rename fedmsg.d/{rida.py => module_build_service.py} (89%) rename {rida => module_build_service}/__init__.py (90%) rename {rida => module_build_service}/auth.py (98%) rename {rida => module_build_service}/builder.py (97%) rename {rida => module_build_service}/config.py (98%) rename {rida => module_build_service}/errors.py (100%) rename {rida => module_build_service}/logger.py (100%) rename {rida => module_build_service}/messaging.py (96%) rename {rida => module_build_service}/models.py (95%) rename {rida => module_build_service}/pdc.py (99%) rename {rida => module_build_service}/scheduler/__init__.py (100%) rename {rida => module_build_service}/scheduler/handlers/__init__.py (100%) rename {rida => module_build_service}/scheduler/handlers/components.py (93%) rename {rida => module_build_service}/scheduler/handlers/modules.py (89%) rename {rida => module_build_service}/scheduler/handlers/repos.py (89%) rename {rida => module_build_service}/scheduler/main.py (87%) rename {rida => module_build_service}/scm.py (97%) rename {rida => module_build_service}/utils.py (97%) rename {rida => module_build_service}/views.py (91%) rename ridad.py => module_build_service_daemon.py (93%) diff --git a/.gitignore b/.gitignore index f1a5c7b0..ad526abd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ *.pyc -rida.db +module_build_service.db server.crt server.key .vagrant diff --git a/Dockerfile b/Dockerfile index c646ed2a..d3569e2a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,14 +3,14 @@ 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 python-m2ext && \ dnf autoremove -y && dnf clean all && \ - mkdir /opt/fm-orchestrator/ -WORKDIR /opt/fm-orchestrator/ -COPY ./requirements.txt /opt/fm-orchestrator/ + mkdir /opt/module_build_service/ +WORKDIR /opt/module_build_service/ +COPY ./requirements.txt /opt/module_build_service/ RUN pip install --user -r ./requirements.txt -COPY koji.conf /etc/rida/ +COPY koji.conf /etc/module_build_service/ -COPY . /opt/fm-orchestrator/ +COPY . /opt/module_build_service/ RUN python2 ./manage.py upgradedb && python2 manage.py generatelocalhostcert CMD ["python2", "manage.py", "runssl"] diff --git a/README.rst b/README.rst index e1151040..bc6e008a 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ -The module build orchestrator for Modularity -============================================ +The module build service for Modularity +======================================= The orchestrator coordinates module builds and is responsible for a number of tasks: @@ -27,7 +27,7 @@ Module submission is done via posting the modulemd SCM URL. :: - POST /rida/module-builds/ + POST /module-build-service/1/module-builds/ :: @@ -55,7 +55,7 @@ build task's URL. Querying the BPO service might be preferred, however. :: - GET /rida/module-builds/42 + GET /module-build-service/1/module-builds/42 The response, if the task exists, would include various pieces of information about the referenced build task. @@ -93,7 +93,7 @@ There are a number of configurable GET parameters to change how the module build An example of querying the "module-builds" resource without any additional parameters:: - GET /rida/module-builds/ + GET /module-build-service/1/module-builds/ :: @@ -145,9 +145,9 @@ An example of querying the "module-builds" resource without any additional param } ], "meta": { - "first": "https://rida.fedora.local:5000/rida/module-builds/?per_page=10&page=1", - "last": "https://rida.fedora.local:5000/rida/module-builds/?per_page=10&page=3", - "next": "https://rida.fedora.local:5000/rida/module-builds/?per_page=10&page=2", + "first": "https://127.0.0.1:5000/module-build-service/1/module-builds/?per_page=10&page=1", + "last": "https://127.0.0.1:5000/module-build-service/1/module-builds/?per_page=10&page=3", + "next": "https://127.0.0.1:5000/module-build-service/1/module-builds/?per_page=10&page=2", "page": 1, "pages": 3, "per_page": 10, @@ -158,7 +158,7 @@ An example of querying the "module-builds" resource without any additional param An example of querying the "module-builds" resource with the "verbose", "per_page", and the "page" parameters:: - GET /rida/module-builds/?verbose=true&per_page=3&page=1 + GET /module-build-service/1/module-builds/?verbose=true&per_page=3&page=1 :: @@ -209,9 +209,9 @@ An example of querying the "module-builds" resource with the "verbose", "per_pag } ], "meta": { - "first": "https://127.0.0.1:5000/rida/module-builds/?per_page=3&page=1", - "last": "https://127.0.0.1:5000/rida/module-builds/?per_page=3&page=10", - "next": "https://127.0.0.1:5000/rida/module-builds/?per_page=3&page=2", + "first": "https://127.0.0.1:5000/module-build-service/1/module-builds/?per_page=3&page=1", + "last": "https://127.0.0.1:5000/module-build-service/1/module-builds/?per_page=3&page=10", + "next": "https://127.0.0.1:5000/module-build-service/1/module-builds/?per_page=3&page=2", "page": 1, "pages": 10, "per_page": 3, @@ -236,7 +236,7 @@ The module-builds can be filtered by a variety of GET parameters. These paramter An example of querying the "module-builds" resource with the "state", and the "submitted_before" parameters:: - GET /rida/module-builds/?state=done&submitted_before=2016-08-23T08:10:07Z + GET /module-build-service/1/module-builds/?state=done&submitted_before=2016-08-23T08:10:07Z :: @@ -260,8 +260,8 @@ An example of querying the "module-builds" resource with the "state", and the "s } ], "meta": { - "first": "https://127.0.0.1:5000/rida/module-builds/?per_page=10&page=1", - "last": "https://127.0.0.1:5000/rida/module-builds/?per_page=10&page=1", + "first": "https://127.0.0.1:5000/module-build-service/1/module-builds/?per_page=10&page=1", + "last": "https://127.0.0.1:5000/module-build-service/1/module-builds/?per_page=10&page=1", "page": 1, "pages": 1, "per_page": 3, @@ -292,7 +292,7 @@ _`Module Build States` You can see the list of possible states with:: - from rida.models import BUILD_STATES + from module_build_service.models import BUILD_STATES print(BUILD_STATES) Here's a description of what each of them means: @@ -346,8 +346,8 @@ Message Topic The suffix for message topics concerning changes in module state is ``module.state.change``. Currently, it is expected that these messages are sent -from koji or ridad, i.e. the topic is prefixed with ``*.buildsys.`` or -``*.rida.``, respectively. +from koji or module_build_service_daemon, i.e. the topic is prefixed with ``*.buildsys.`` or +``*.module_build_service.``, respectively. Message Body ------------ @@ -385,8 +385,8 @@ Development ``Logging`` ---------- -If you're running rida from scm then the DevConfiguration from config.py which contains LOG_LEVEL=debug should get applied. If you're having trouble just change LOG_LEVEL in BaseConfiguration. -See more about it in rida/__init__.py config.from_object() +If you're running module_build_service from scm then the DevConfiguration from config.py which contains LOG_LEVEL=debug should get applied. If you're having trouble just change LOG_LEVEL in BaseConfiguration. +See more about it in module_build_service/__init__.py config.from_object() ``Docker`` @@ -416,9 +416,9 @@ Once your environment is setup, run (depending on your OS, you may need to run i $ vagrant up -This will start fm-orchestrator's frontend (API) and scheduler. To access the frontend, visit the following URL:: +This will start module_build_service's frontend (API) and scheduler. To access the frontend, visit the following URL:: - https://127.0.0.1:5000/rida/1/module-builds/ + https://127.0.0.1:5000/module-build-service/1/module-builds/ At any point you may enter the guest VM with:: @@ -426,13 +426,13 @@ At any point you may enter the guest VM with:: To start the frontend manually, run the following inside the guest:: - $ cd /opt/fm-orchestrator/src + $ cd /opt/module_build_service/src $ python manage.py runssl --debug To start the scheduler manually, run the following inside the guest:: - $ cd /opt/fm-orchestrator/src - $ python ridad.py + $ cd /opt/module_build_service/src + $ python module_build_service_daemon.py Alternatively, you can restart the Vagrant guest, which inherently starts/restarts the frontend and the scheduler with:: @@ -453,11 +453,11 @@ Setup Apache to host the CRL:: $ dnf install httpd && systemctl enable httpd && systemctl start httpd $ mkdir -p /var/www/html/crl - $ ln -s /opt/fm-orchestrator/pki/ca.crl /var/www/html/crl/ca.crl - $ ln -s /opt/fm-orchestrator/pki/ca.crt /var/www/html/crl/ca.crt + $ ln -s /opt/module_build_service/pki/ca.crl /var/www/html/crl/ca.crl + $ ln -s /opt/module_build_service/pki/ca.crt /var/www/html/crl/ca.crt Create a directory to house the fedmsg cache:: $ mkdir -p /etc/pki/fedmsg -Then uncomment the fedmsg signing configuration in fedmsg.d/rida.py. +Then uncomment the fedmsg signing configuration in fedmsg.d/module_build_service.py. diff --git a/Vagrantfile b/Vagrantfile index 9f398c9f..add42dc5 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -3,11 +3,11 @@ $script = <