-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs: update REST API wsgi scripts (#4488)
The wsgi scripts for deploying the AiiDA REST in production were outdated and are updated. The how-to on deploying your own REST API server is significantly streamlined and now includes the wsgi files as well as the examplary apache virtualhost configuration. Co-authored-by: Giovanni Pizzi <[email protected]>
- Loading branch information
1 parent
191dc90
commit 09ac916
Showing
15 changed files
with
71 additions
and
388 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,32 @@ | ||
# Apache virtual host configuration file for AiiDA REST API | ||
# Copy to /etc/apache2/sites-enabled/aiida-rest.conf | ||
|
||
<VirtualHost *:80> | ||
|
||
LogLevel debug | ||
|
||
# Let the app do authorization | ||
WSGIPassAuthorization On | ||
|
||
# Require privileges on the wsgi directory | ||
<Directory "/home/ubuntu/wsgi"> | ||
Require all granted | ||
</Directory> | ||
|
||
# BEGIN SECTION for "myprofile" AiiDA profile | ||
# Use 5 threads and "aiida" virtual python environment | ||
WSGIDaemonProcess rest-myprofile \ | ||
user=ubuntu group=ubuntu \ | ||
threads=5 \ | ||
python-home=/home/ubuntu/.virtualenvs/aiida \ | ||
display-name=aiida-rest-myprofile | ||
|
||
# REST API will be served on <host>/myprofile/api/v4 | ||
WSGIScriptAlias /myprofile /home/ubuntu/wsgi/myprofile-rest.wsgi | ||
<Location /myprofile> | ||
WSGIProcessGroup myprofile | ||
</Location> | ||
# END SECTION for "myprofile" AiiDA profile | ||
|
||
|
||
</VirtualHost> |
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,9 @@ | ||
# -*- coding: utf-8 -*- | ||
# wsgi script for AiiDA profile 'myprofile' | ||
from aiida.restapi.run_api import configure_api | ||
from aiida.manage.configuration import load_profile | ||
|
||
load_profile('myprofile') | ||
|
||
api = configure_api() | ||
application = api.app |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.