Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
Merge pull request #136 from phovea/release-7.0.0
Browse files Browse the repository at this point in the history
Release 7.0.0
  • Loading branch information
Anita Steiner authored Feb 12, 2021
2 parents 2e1d737 + 9d338e0 commit 6ad2a61
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 30 deletions.
54 changes: 47 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
version: 2
jobs:
build:
version: 2.1

executors:
python-executor:
working_directory: ~/phovea
docker:
- image: circleci/python:3.7-buster-node-browsers # for node version see Dockerfile on https://hub.docker.com/r/circleci/python
jobs:
build:
executor: python-executor
steps:
- checkout
- run:
Expand Down Expand Up @@ -48,8 +52,34 @@ jobs:
npm run dist
- store_artifacts:
path: dist
destination: dist
- persist_to_workspace:
root: ~/phovea
paths: .
publish:
executor: python-executor
steps:
- attach_workspace:
at: ~/phovea
- run:
name: Install twine
command: |
. ~/venv/bin/activate \
pip install twine \
- run:
name: Authentication
command: |
echo -e "[pypi]" >> ~/.pypirc
echo -e "repository = $PYPI_REPOSITORY" >> ~/.pypirc
echo -e "username = $PYPI_USERNAME" >> ~/.pypirc
echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc
- run:
name: Publish package
command: |
. venv/bin/activate
twine upload dist/*
workflows:
version: 2
version: 2.1
# build-nightly:
# triggers:
# - schedule:
Expand All @@ -60,17 +90,27 @@ workflows:
# - develop
# jobs:
# - build
build-branch:
build-branches-only:
jobs:
- build:
filters:
tags:
ignore: /^v.*/
build-tag:
ignore: /.*/
build-publish-tag:
jobs:
- build:
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
- publish:
context:
- org-public
requires:
- build
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
3 changes: 3 additions & 0 deletions deploy/docker-compose.partial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ services:
- '9000:80'
volumes:
- .:/phovea
# Add support for PDB debugger
# stdin_open: true
# tty: true
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "phovea_server",
"description": "Python server implementation of Phovea",
"version": "6.0.1",
"version": "7.0.0",
"author": {
"name": "The Caleydo Team",
"email": "[email protected]",
Expand Down
9 changes: 6 additions & 3 deletions phovea_server/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
# Copyright (c) The Caleydo Team. All rights reserved.
# Licensed under the new BSD license, available at http://caleydo.org/license
###############################################################################
from gevent import monkey
monkey.patch_all()

import logging.config
import logging
from . import config

import logging.config # noqa: E402
import logging # noqa: E402
from . import config # noqa: E402


# set configured registry
Expand Down
6 changes: 6 additions & 0 deletions phovea_server/mainapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ def _build_info():
return ns.jsonify(build_info)


# health check for docker-compose, kubernetes
def _health():
return 'ok', 200


def default_app():
# from .config import view, _initialize
from phovea_server import config
Expand All @@ -141,4 +146,5 @@ def default_app():
else:
app.add_url_rule('/<path:path>', 'deliver', _deliver_production)
app.add_url_rule('/api/buildInfo.json', 'build_info', _build_info)
app.add_url_rule('/health', 'health', _health)
return app
2 changes: 0 additions & 2 deletions phovea_server/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,10 @@ def __init__(self, desc):
def load(self):
if self._impl is None:
import importlib
import gevent.monkey
_log = logging.getLogger(__name__)
_log.info('importing %s', self.module)

m = importlib.import_module(self.module)
gevent.monkey.patch_all() # ensure the standard libraries are patched
if hasattr(m, '_plugin_initialize'): # init method
# import inspect
# inspect.getcallargs()
Expand Down
22 changes: 20 additions & 2 deletions phovea_server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ def create(parser):
help='server port')
parser.add_argument('--address', '-a', default=cc.get('address'), # get default value from config.json
help='server address')
parser.add_argument('--certfile', '-c', default=cc.get('certfile'), # get default value from config.json
help='ssl certificate')
parser.add_argument('--keyfile', '-k', default=cc.get('keyfile'), # get default value from config.json
help='keyfile for ssl certificate')

def _launcher(args):
"""
Expand All @@ -202,12 +206,26 @@ def _launcher(args):
"""
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
from flask.logging import default_handler
import logging
# from gevent import monkey

# create phovea server application
application = create_application()

_log.info('prepare server that will listen on %s:%s', args.address, args.port)
http_server = WSGIServer((args.address, args.port), application, handler_class=WebSocketHandler)
# add handler for wsgi's logger
logger = logging.getLogger('wsgi')
logger.setLevel(logging.INFO)
_log.addHandler(default_handler)

_log.info('prepare server that will listen on %s:%s [cert=%s, key=%s]', args.address, args.port, args.certfile, args.keyfile)
# Test whether monkey.patch_all() has been used correctly,
# keys have to be set
# _log.warn(monkey.saved.keys())
if args.certfile and args.keyfile:
http_server = WSGIServer((args.address, args.port), application, keyfile=args.keyfile, certfile=args.certfile, handler_class=WebSocketHandler)
else:
http_server = WSGIServer((args.address, args.port), application, handler_class=WebSocketHandler)

server = http_server.serve_forever # return function name only; initialization will be done later

Expand Down
19 changes: 8 additions & 11 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
Flask==1.1.1
Flask==1.1.2
flask-restplus==0.13.0
Flask-Sockets==0.2.1
gevent==1.4.0
gevent==20.9.0
gevent-websocket==0.10.1
numpy==1.18.1
scipy==1.4.1
pandas==1.0.1
matplotlib==3.1.3
Pillow==7.0.0
json-cfg==0.4.2

# pin greenlet version (see https://github.com/phovea/phovea_server/issues/130)
greenlet==0.4.16
numpy==1.19.4
scipy==1.5.4
pandas==1.1.4
matplotlib==3.3.3
Pillow==8.0.1
json-cfg==0.4.2
8 changes: 4 additions & 4 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
flake8==3.7.9
pep8-naming==0.9.1
pytest==5.3.5
flake8==3.8.4
pep8-naming==0.11.1
pytest==6.1.2
pytest-runner==5.2
Sphinx==2.4.2
Sphinx==3.3.1
recommonmark==0.6.0

0 comments on commit 6ad2a61

Please sign in to comment.