Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/scossu/lakesuperior
Browse files Browse the repository at this point in the history
…into development
  • Loading branch information
Stefano Cossu committed Apr 3, 2018
2 parents 62154a3 + 356b66b commit 83cc46a
Show file tree
Hide file tree
Showing 17 changed files with 283 additions and 133 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ python:
- "3.5"
- "3.6"
install:
- pip install -r requirements.txt
- coilmq&
- pip install -e .
script:
- pytest tests
- python setup.py test
19 changes: 8 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,17 @@ Dependencies
Installation steps
~~~~~~~~~~~~~~~~~~

1. Create a virtualenv in a project folder:
``virtualenv -p <python 3.5+ exec path> <virtualenv folder>``
2. Activate the virtualenv: ``source <path_to_virtualenv>/bin/activate``
3. Clone this repo:
``git clone https://github.com/scossu/lakesuperior.git``
4. ``cd`` into repo folder
5. Install dependencies: ``pip install -r requirements.txt``
6. Start your STOMP broker, e.g.: ``coilmq &``. If you have another
#. Create a virtualenv in a project folder:
``python3 -m venv <virtualenv folder>``
#. Activate the virtualenv: ``source <path_to_virtualenv>/bin/activate``
#. Install dependencies: ``pip install -r requirements.txt``
#. Start your STOMP broker, e.g.: ``coilmq &``. If you have another
queue manager listening to port 61613 you can either configure a
different port on the application configuration, or use the existing
message queue.
7. Run ``./lsup-admin bootstrap`` to initialize the binary and graph
stores
8. Run ``./fcrepo``.
#. Run ``lsup-admin bootstrap`` to initialize the binary and graph
stores.
#. Run ``fcrepo``.

Contributing
------------
Expand Down
5 changes: 3 additions & 2 deletions docker/docker_entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

mkdir -p /data/log /data/run /data/bootstrap
cp ./data/bootstrap/* /data/bootstrap
pip install -e .
coilmq &
if [ ! -d /data/ldpnr_store ] && [ ! -d /data/ldprs_store ]; then
echo yes | ./lsup-admin bootstrap
echo yes | lsup-admin bootstrap
fi
exec ./fcrepo
exec fcrepo
31 changes: 0 additions & 31 deletions docker/etc/gunicorn.py

This file was deleted.

24 changes: 24 additions & 0 deletions docker/etc/gunicorn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Set up main GUnicorn options.
# See: http://docs.gunicorn.org/en/stable/settings.html

# Commented values are the application defaults.

# Directory where the WSGI server data are stored.
data_dir: 'data'

# Set app_mode to either 'prod', 'test' or 'dev'.
# 'prod' is normal running mode. 'test' is used for running test suites.
# 'dev' is similar to normal mode but with reload and debug enabled.
app_mode: 'dev'

#listen_addr: '0.0.0.0'
#listen_port: 8000
#workers: 4
#worker_class: 'gevent'
#max_requests: 512

#user: ''
#group: ''

#preload_app: True

34 changes: 11 additions & 23 deletions docs/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,14 @@ Installation steps
#. Create a virtualenv in a project folder:
``python3 -m venv <virtualenv folder>``
#. Activate the virtualenv: ``source <path_to_virtualenv>/bin/activate``
#. Clone this repo:
``git clone https://github.com/scossu/lakesuperior.git``
#. ``cd`` into repo folder
#. Install dependencies: ``pip install -r requirements.txt``

- (Optional) For a development server, install additional dependencies:
``pip install -r requirements_dev.txt``. These include some heavyweight
packages needed for development and testing but not for regular operation.

#. Start your STOMP broker, e.g.: ``coilmq &``.

- If you have another
queue manager listening to port 61613 you can either configure a
different port on the application configuration, or use the existing
message queue.

#. Make sure that the ``lsup-admin`` and ``fcrepo`` files are executable.
#. Run ``./lsup-admin bootstrap`` to initialize the binary and graph
#. Start your STOMP broker, e.g.: ``coilmq &``. If you have another
queue manager listening to port 61613 you can either configure a
different port on the application configuration, or use the existing
message queue.
#. Run ``lsup-admin bootstrap`` to initialize the binary and graph
stores.
#. Run ``./fcrepo``.
#. Run ``fcrepo``.

Configuration
-------------
Expand All @@ -79,14 +67,14 @@ the ``data`` directory.

To change the default configuration you should:

1. Copy the ``etc.skeleton`` folder to a separate location
2. Set the configuration folder location in the environment:
#. Copy the ``etc.skeleton`` folder to a separate location
#. Set the configuration folder location in the environment:
``export FCREPO_CONFIG_DIR=<your config dir location>`` (you can add
this line at the end of your virtualenv ``activate`` script)
3. Configure the application
4. Bootstrap the app or copy the original data folders to the new
#. Configure the application
#. Bootstrap the app or copy the original data folders to the new
location if any loction options changed
5. (Re)start the server: ``./fcrepo``
#. (Re)start the server: ``./fcrepo``

The configuration options are documented in the files.

Expand Down
32 changes: 0 additions & 32 deletions etc.defaults/gunicorn.py

This file was deleted.

24 changes: 24 additions & 0 deletions etc.defaults/gunicorn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Set up main GUnicorn options.
# See: http://docs.gunicorn.org/en/stable/settings.html

# Commented values are the application defaults.

# Directory where the WSGI server data are stored.
data_dir: 'data'

# Set app_mode to either 'prod', 'test' or 'dev'.
# 'prod' is normal running mode. 'test' is used for running test suites.
# 'dev' is similar to normal mode but with reload and debug enabled.
app_mode: 'dev'

#listen_addr: '0.0.0.0'
#listen_port: 8000
#workers: 4
#worker_class: 'gevent'
#max_requests: 512

#user: ''
#group: ''

#preload_app: True

5 changes: 0 additions & 5 deletions fcrepo

This file was deleted.

1 change: 0 additions & 1 deletion lsup-admin → lsup_admin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
import click
import click_log
import json
Expand Down
6 changes: 3 additions & 3 deletions profiler.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

import logging
from logging.config import dictConfig
from werkzeug.contrib.profiler import ProfilerMiddleware
Expand All @@ -18,9 +16,11 @@

from lakesuperior.app import create_app

if __name__ == '__main__':
def run():
fcrepo = create_app(config['application'])
fcrepo.wsgi_app = ProfilerMiddleware(fcrepo.wsgi_app, **options)
fcrepo.config['PROFILE'] = True
fcrepo.run(debug = True)

if __name__ == '__main__':
run()
16 changes: 2 additions & 14 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,2 @@
CoilMQ==1.0.1
Flask==0.12.2
HiYaPyCo==0.4.11
PyYAML==3.12
arrow==0.10.0
click==6.7
click-log==0.2.1
gevent==1.2.2
gunicorn==19.7.1
lmdb==0.93
rdflib==4.2.2
requests-toolbelt==0.8.0
requests==2.18.4
stomp.py==4.1.20
--index-url https://pypi.python.org/lakesuperior/
-e .
6 changes: 0 additions & 6 deletions requirements_dev.txt

This file was deleted.

2 changes: 0 additions & 2 deletions server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

import logging
from logging.config import dictConfig

Expand Down
6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[aliases]
test = pytest

[tool:pytest]
addopts = --verbose
#python_files = tests

0 comments on commit 83cc46a

Please sign in to comment.