diff --git a/couchdb/packing.rst b/couchdb/packing.rst index 88ac1c1..b448405 100644 --- a/couchdb/packing.rst +++ b/couchdb/packing.rst @@ -1,7 +1,78 @@ -Packing the Couch Application into RPM --------------------------------------- +Packing the Couch Application into RPM and deploying on CMSWEB +-------------------------------------------------------------- -Setting up external dependencies -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +This section shall provide sufficient knowledge base for +deploying pure CouchApp on the CMSWEB. It refers to a particular +CouchApp example developed. +This instructions list summarizes steps done while finalizing +development on the AlertsCollector CouchApp - defining the +RPM spec file and gathering further knowledge to make +the RPM deployable on the CMSWEB via standard procedures. + +Additional files required for CMSWEB CouchDB deployment +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +These files were added to the CouchApp +(``src/couchapps/AlertsCollector``): + + * ``rewrites.json`` (defines URL rewrite rules) + * ``filters/repfilter.js`` (replication filter - exclude design documents) + * ``validate_doc_update.js`` (allow only authorized users manipulate documents) + + +Defining RPM spec file +^^^^^^^^^^^^^^^^^^^^^^ + +Since ``AlertsCollector`` is rather simple and pure CouchApp, +the spec is relatively simple. It is stored in CMSSW CVS +repository under ``CMSDIST/alertscollector.spec`` and has +parts annotated. Although the package doesn't really depend on +anything ``cherrypy and py2-sphinx`` packages are required +by the build process. The chain of dependencies can be tracked +by looking at ``WMCore/setup_*.py`` files. + +Particularly ``setup_dependencies.py`` file defines which code +files constitute the software package: + + 'alertscollector': + { + 'statics': ['src/couchapps/AlertsCollector+'], + }, + + +Without the ending ``+``, the subdirectories will not be included +in the result RPM package. + +Once the build and subsequent RPM repository upload process succeeds, +the spec files shall be stored in the CVS repository. + + +Deploying on CMSWEB +^^^^^^^^^^^^^^^^^^^ + +While developing/validating the deployment procedure for our newly +created package, we work against private Github ``dmwm/deployment`` +repository. + +1. New files - the files added by the AlertsCollector app to the +deployment repository are following: + +* ``alertscollector/deploy`` + Since the CouchApp is managed via CouchDB, there is no manage script. + The CouchApp is pushed every time the server is restarted. + +* ``frontend/app_alertscollector_nossl.conf`` +* ``frontend/app_alertscollector_ssl.conf`` + +2. Files modified: + +* ``system/deploy`` + This file defines new Unix group and username for the application. + It is necessary this modified file is run during the initial + basic installation of the deployment procedure else the deployment + will later fail with unknown user/group error. + +The standard VM development and CMSWEB application deployment procedures shall +now be functional.