-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from ESGF/devel
Devel
- Loading branch information
Showing
33 changed files
with
472 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
Developers Guide | ||
================ | ||
|
||
Adding WSGI services to an ESGF node | ||
------------------------------------ | ||
|
||
It's easy to add new services developed with Flask, Django, etc. and proxy using the esgf-httpd configuration and mod_wsgi express. | ||
|
||
This guide assumes you have set up a project using flask at the example location ``/opt/esgf/flaskdemo/demo`` and you have the application entry point accessible in the ``/opt/esgf/flaskdemo/demo.wsgi``. Your demo app must world-readable and recommended to be owned by the ``apache`` user and group. These instructions assume to be run by a root user, as many server configs disallow a shell run under the apache user, but a regular user can be used to run the service for testing purposes. | ||
|
||
- Create and activate a conda environment to run your webapp. | ||
|
||
.. code:: console | ||
source /usr/local/conda/bin/activate | ||
conda create -n flaskdemo | ||
conda activate flaskdemo | ||
.. note:: | ||
if your app was developed in Python 2.7 you'll need to create the environment with the following instead: | ||
|
||
.. code:: console | ||
conda create -n flaskdemo 'python<3.0' | ||
- Install modules needed to run your app. Our demo uses flask, but you could use django (and expect additional required packages.) Note that diffculty has been encountered with mod_wsgi version 4.6.7, so we recommend an earlier version: | ||
|
||
.. code:: console | ||
pip install flask 'mod_wsgi<4.6' | ||
- Run the `mod_wsgi-express` command to create a httpd service instance for your webapp and start the instance. | ||
|
||
.. code:: console | ||
cd /opt/esgf/flaskdemo/demo | ||
mod_wsgi-express setup-server --server-root /etc/wsgi-demo --user apache --group apache --host localhost --port 8087 --mount-point /demo demo.wsgi | ||
/etc/wsgi-demo/apachectl start | ||
- You should be able to access the demo now under ``http://localhost:8087/demo`` using ``curl`` or ``wget``. | ||
|
||
- For external access on 443 for https, add the following directives to `/etc/httpd/conf/httpd.ssl.conf`: | ||
|
||
.. code:: console | ||
ProxyPass /demo http://localhost:8087/demo | ||
ProxyPassReverse /demo http://localhost:8087/demo | ||
- Restart httpd | ||
|
||
- If you want the site available also on 80 for old insecure http, you can add the same directives to ``/etc/httpd/conf/esgf-httpd.conf``. In addition you need to add a rule to exempt ``/demo`` from the automatic redirection of http traffic to https as done for several of the ESGF Tomcat webapps that are proxied in that section. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Comparison of ESGF v2 vs v4 | ||
=========================== | ||
|
||
In the following table, if no context given, items in the table in the v2 column are the command line flag to the `esg-node` script. Items in the v4 column are a playbook .yml file | ||
|
||
+--------------------------+------------------------+------------------------------+ | ||
| Action or Location | ESGF v2 (Bash scripts) | ESGF v4 (Ansible) | | ||
+==========================+========================+==============================+ | ||
| CoG location | NA (mod_wsgi in httpd) | /etc/cog-wsgi-8889 | | ||
+--------------------------+------------------------+------------------------------+ | ||
| SLCS | NA (mod_wsgi in httpd) | /etc/slcs-wsgi-8888 | | ||
+--------------------------+------------------------+------------------------------+ | ||
| Tomcat control | esg-node function | catalina.sh | | ||
+--------------------------+------------------------+------------------------------+ | ||
| Solr index location | /esg/solr-index | /usr/local/solr-home | | ||
+--------------------------+------------------------+------------------------------+ | ||
| Bootstrap | - wget esg-bootstrap | - (No bootstrap) | | ||
| | - ./esg-bootstrap | - git clone esgf-ansible | | ||
+--------------------------+------------------------+------------------------------+ | ||
| Configuration | esg-autoinstall.conf | inventory file | | ||
| (auto-installation) | | host variables files | | ||
+--------------------------+------------------------+------------------------------+ | ||
| Install latest | --install (--upgrade) | install.yml | | ||
| ESGF version | | | | ||
+--------------------------+------------------------+------------------------------+ | ||
| CSR | --generate-esgf-csrs | local_certs.yml | | ||
+--------------------------+------------------------+------------------------------+ | ||
| Certs / CA | --update-temp-ca | local_certs.yml | | ||
+--------------------------+------------------------+------------------------------+ | ||
| Stop | --stop | stop.yml | | ||
+--------------------------+------------------------+------------------------------+ | ||
| Start | --start | start.yml | | ||
+--------------------------+------------------------+------------------------------+ | ||
| Restart | --restart | stop.yml + start.yml | | ||
+--------------------------+------------------------+------------------------------+ | ||
| Status | --status | status.yml | | ||
+--------------------------+------------------------+------------------------------+ | ||
| Certificate Installation | - --install-local-certs| local_certs.yml | | ||
+--------------------------+------------------------+------------------------------+ | ||
| (Web) | - --install-keypair | web_certs.yml | | ||
+--------------------------+------------------------+------------------------------+ | ||
| LetsEncrypt request | NA | install.yml (tryletsencript) | | ||
+--------------------------+------------------------+------------------------------+ | ||
| Shard Replicas | --add-replica-shard | shards.yml | | ||
+--------------------------+------------------------+------------------------------+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
- hosts: all | ||
# strategy: free | ||
become: yes | ||
connection: paramiko | ||
any_errors_fatal: true | ||
tasks: | ||
# Get the admin password | ||
- name: Include the admin passwd role | ||
block: | ||
- include_role: | ||
name: passwd | ||
tags: always | ||
|
||
- name: Node Status | ||
block: | ||
- include_role: | ||
name: node_status | ||
tags: index | ||
when: "'index' in group_names" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,5 +21,5 @@ dependencies: | |
} | ||
- { | ||
role: 'myproxy_certs', | ||
when: "'idp' is in group_names" | ||
when: "'idp' in group_names" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.