Skip to content

Commit

Permalink
Merge pull request #17 from ottogroup/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
alattner committed Mar 7, 2016
2 parents c45432f + 7ad551e commit 5565746
Show file tree
Hide file tree
Showing 17 changed files with 97 additions and 36 deletions.
13 changes: 9 additions & 4 deletions .travis.yml
@@ -1,23 +1,28 @@
language: python
python:
- "3.3"
- "3.4"
- "3.5"
env:
- TRAVIS=yes
before_install:
# update R version
- codename=$(lsb_release -c -s)
- echo "deb https://cran.rstudio.com/bin/linux/ubuntu $codename/" | sudo tee -a /etc/apt/sources.list > /dev/null
- sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
- sudo add-apt-repository -y ppa:marutter/rdev
- sudo apt-get update -qq
- sudo apt-get install -qq libatlas-dev libatlas-base-dev liblapack-dev gfortran r-base
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
- export PATH=/home/travis/miniconda/bin:$PATH
- export PATH=/home/travis/miniconda2/bin:$PATH
- conda update --yes conda
- travis_retry conda install --yes python=$TRAVIS_PYTHON_VERSION --file requirements.txt
- sudo rm /home/travis/miniconda2/lib/libgfortran* # get rid of conflicting lib (rpy2/R)
- pip install pytest pytest-cov
- pip install coveralls
install:
- if [[ $TRAVIS_PYTHON_VERSION == 3.3* ]]; then conda config --add channels https://conda.binstar.org/asmeurer; conda install --yes singledispatch; fi
- travis_retry pip install rpy2==2.5.2
- travis_retry pip install rpy2==2.7.8
- travis_retry python setup.py dev
script: travis_wait py.test --runslow
after_success:
Expand Down
12 changes: 12 additions & 0 deletions CHANGES.txt
@@ -1,3 +1,15 @@
v1.0.1.dev1 - 2016-03-04
========================

- Updated requirements in order to use newer versions of dependencies

- Added information about virtual memory size (vms) to /alive entry
point

- Added Python 3.5 to and removed Python 3.3 from Travis CI test
settings


v1.0 - 2015-07-01
=================

Expand Down
5 changes: 5 additions & 0 deletions README.rst
Expand Up @@ -75,9 +75,14 @@ enterprise contexts for setting up productive services – like
pluggable decorator lists** in the configuration file of a service,
keeping track of service calls and corresponding permissions.

Everyone is welcome to contribute to Palladium. More information on
how to to contribute can be found in the FAQ section of the
`Palladium documentation <http://palladium.readthedocs.org>`_.

Links
-----

- Source code repository at GitHub: https://github.com/ottogroup/palladium
- Documentation including installation instructions and tutorial: http://palladium.readthedocs.org
- Mailing list: https://groups.google.com/forum/#!forum/pld-list
- Maintainer: `Andreas Lattner <https://github.com/alattner>`_
1 change: 1 addition & 0 deletions VERSION
@@ -0,0 +1 @@
1.0.1
4 changes: 2 additions & 2 deletions addons/docker/palladium_base_image/Dockerfile
Expand Up @@ -13,8 +13,8 @@ RUN conda config --add channels https://conda.binstar.org/ottogroup \
&& conda config --set ssl_verify false \
&& conda update --yes conda

RUN wget --no-check-certificate https://raw.githubusercontent.com/ottogroup/palladium/1.0/requirements.txt
RUN wget --no-check-certificate https://raw.githubusercontent.com/ottogroup/palladium/1.0.1/requirements.txt

RUN conda install --yes --file requirements.txt

RUN conda install --no-deps palladium==1.0
RUN conda install --no-deps palladium==1.0.1
11 changes: 8 additions & 3 deletions docs/conf.py
Expand Up @@ -68,6 +68,11 @@ class Dummy(object):

base.BaseEstimator = Dummy

# Retrieve version from file
doc_dir = os.path.dirname(os.path.abspath(__file__))
project_dir = os.path.dirname(doc_dir)
version_filename = os.path.join(project_dir, 'VERSION')

# on_rtd is whether we are on readthedocs.org, this line of code grabbed
# from docs.readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
Expand Down Expand Up @@ -108,16 +113,16 @@ class Dummy(object):

# General information about the project.
project = 'Palladium'
copyright = '2015, Otto Group BI'
copyright = '2016, Otto Group BI'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '1.0'
version = open(version_filename).read().strip()
# The full version, including alpha/beta/rc tags.
release = '1.0'
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
8 changes: 8 additions & 0 deletions docs/index.rst
Expand Up @@ -52,6 +52,14 @@ enterprise contexts for setting up productive services – like
pluggable decorator lists** in the configuration file of a service,
keeping track of service calls and corresponding permissions.

Links
-----

- Source code repository at GitHub: https://github.com/ottogroup/palladium
- Documentation including installation instructions and tutorial: http://palladium.readthedocs.org
- Mailing list: https://groups.google.com/forum/#!forum/pld-list
- Maintainer: `Andreas Lattner <https://github.com/alattner>`_

User's Guide
------------

Expand Down
4 changes: 2 additions & 2 deletions docs/user/deployment.rst
Expand Up @@ -127,9 +127,9 @@ Run ``docker build`` in your terminal:

.. code-block:: bash
sudo docker build -t myname/palladium-base:1.0 .
sudo docker build -t myname/palladium-base:1.0.1 .
A Docker image with the name ``myname/palladium-base:1.0`` should now
A Docker image with the name ``myname/palladium-base:1.0.1`` should now
be created. You can check this with:

.. code-block:: bash
Expand Down
22 changes: 22 additions & 0 deletions docs/user/faq.rst
Expand Up @@ -7,6 +7,28 @@ Frequently asked questions
.. contents::
:local:

How do I contribute to Palladium?
=================================

Everyone is welcome to contribute to Palladium. You can help us
to improve Palladium when you:

- Use Palladium and give us feedback or submit bug reports to GitHub.

- Improve existing code or documentation and send us a pull request on
GitHub.

- Suggest a new feature, and possibly send a pull request for it.

In case you intend to improve or to add code to Palladium, we kindly ask you to:

- Include documentation and tests for new code.

- Ensure that all existing tests still run successfully.

- Ensure backward compatibility in the general case.


How do I configure where output is logged to?
=============================================

Expand Down
2 changes: 1 addition & 1 deletion docs/user/installation.rst
Expand Up @@ -4,7 +4,7 @@
Installation
============

Palladium requires Python 3.3 or better to run. If you are currently using
Palladium requires Python 3.4 or better to run. If you are currently using
an older version of Python, you might want to check the :ref:`FAQ
entry about virtual environments <virtual-env>`. Some of Palladium's
dependencies such as ``numpy``, ``scipy`` and ``scikit-learn`` may
Expand Down
6 changes: 4 additions & 2 deletions palladium/server.py
Expand Up @@ -212,10 +212,12 @@ def alive(alive=None):
if alive is None:
alive = {}

mem, mem_vms = memory_usage_psutil()
info = {
'memory_usage': int(memory_usage_psutil()),
'memory_usage': mem, # rss, resident set size
'memory_usage_vms': mem_vms, # vms, virtual memory size
'palladium_version': __version__,
}
}

info['service_metadata'] = get_config().get('service_metadata', {})

Expand Down
1 change: 1 addition & 0 deletions palladium/tests/test_server.py
Expand Up @@ -287,6 +287,7 @@ def test_empty_process_state(self, config, flask_client):
resp_data = json.loads(resp.get_data(as_text=True))

assert sorted(resp_data.keys()) == ['memory_usage',
'memory_usage_vms',
'palladium_version',
'service_metadata']
assert resp_data['service_metadata'] == config['service_metadata']
Expand Down
5 changes: 3 additions & 2 deletions palladium/util.py
Expand Up @@ -279,8 +279,9 @@ def memory_usage_psutil():
"""Return the current process memory usage in MB.
"""
process = psutil.Process(os.getpid())
mem = process.get_memory_info()[0] / float(2 ** 20)
return mem
mem = process.memory_info()[0] / float(2 ** 20)
mem_vms = process.memory_info()[1] / float(2 ** 20)
return mem, mem_vms


def version_cmd(argv=sys.argv[1:]): # pragma: no cover
Expand Down
8 changes: 4 additions & 4 deletions requirements-dev.txt
@@ -1,4 +1,4 @@
cov-core==1.14.0
coverage==3.7.1
pytest==2.6.4
pytest-cov==1.8.0
cov-core==1.15.0
coverage==4.0.3
pytest==2.8.5
pytest-cov==2.2.1
25 changes: 12 additions & 13 deletions requirements.txt
@@ -1,20 +1,19 @@
Flask==0.10.1
Jinja2==2.7.3
Jinja2==2.8
MarkupSafe==0.23
Werkzeug==0.10.4
Werkzeug==0.11.4
docopt==0.6.2
itsdangerous==0.24
joblib==0.8.4
# julia==0.1.1
numpy==1.9.2
pandas==0.16.2
psutil==2.2.1
numpy==1.10.4
pandas==0.17.1
psutil==3.4.2
python-dateutil==2.4.2
pytz==2015.4
# rpy2==2.5.2
scikit-learn==0.16.1
scipy==0.15.1
# singledispatch==3.4.0.3 # for Python 3.3
six==1.9.0
sqlalchemy==1.0.5
ujson==1.33
pytz==2015.7
# rpy2==2.7.8
scikit-learn==0.17.1
scipy==0.17.0
six==1.10.0
sqlalchemy==1.0.11
ujson==1.35
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -4,6 +4,6 @@ docs = develop easy_install palladium[docs]

[pytest]
addopts =
-p pytest_cov --cov=palladium --cov-report=term-missing --cov-config .coveragerc
--cov=palladium --cov-report=term-missing --cov-config .coveragerc
palladium/ examples/
python_files = test*py
4 changes: 2 additions & 2 deletions setup.py
@@ -1,7 +1,7 @@
import os
from setuptools import setup, find_packages

version = '1.0'
version = open('VERSION').read().rstrip()

install_requires = [
'docopt',
Expand Down Expand Up @@ -47,8 +47,8 @@
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
packages=find_packages(),
include_package_data=True,
Expand Down

0 comments on commit 5565746

Please sign in to comment.