Skip to content

Commit

Permalink
Merge pull request #157 from roscisz/develop
Browse files Browse the repository at this point in the history
Release v0.2.3
  • Loading branch information
roscisz authored Mar 11, 2019
2 parents ba42e27 + 6555177 commit bc5711c
Show file tree
Hide file tree
Showing 77 changed files with 20,848 additions and 2,090 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ build/
\.idea

# database
**/*.db
**/*.db

# config
tensorhive/app/web/dist/static/config.json
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ python:
cache: pip
install:
- pip install .
- pip install -r requirements-dev.txt
before_script:
- python -m flake8 tensorhive
script:
- python -m tensorhive --version
- pytest
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ include README.md
include LICENSE

include setup.py
include main_config.ini
include hosts_config.ini
include tensorhive/api/*.yml
include tensorhive/controllers/responses.yml
include tensorhive/*.ini
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ TensorHive
===


![](https://img.shields.io/badge/release-v0.2.2-brightgreen.svg?style=popout-square)
![](https://img.shields.io/badge/pypi-v0.2.2-brightgreen.svg?style=popout-square)
![](https://img.shields.io/badge/release-v0.2.3-brightgreen.svg?style=popout-square)
![](https://img.shields.io/badge/pypi-v0.2.3-brightgreen.svg?style=popout-square)
![](https://img.shields.io/badge/platform-Linux-blue.svg?style=popout-square)
![](https://img.shields.io/badge/python-3.5%20|%203.6%20|%203.7-blue.svg?style=popout-square)
![](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=popout-square)
Expand Down Expand Up @@ -56,6 +56,10 @@ Sample output:

The Web application and API Documentation can be accessed through te given URLs.

If you need the Web application to be accessible from remote machines, set the `host` and `port` fields in the
`[web_app.server]` section in `~/.config/TensorHive/main_config.ini`. The host field should be set to a hostname
or IP that resolves to an external network interface.

#### Monitor infrastructure

The available infrastructure can be monitored in the Nodes overview tab. Sample screenshot:
Expand Down Expand Up @@ -83,10 +87,10 @@ Features
- [x] :mag_right: Monitor GPU parameters on each host
- [x] :customs: Protection of reserved resources
- [x] :warning: Send warning messages to terminal of users who violate the rules
- [ ] :mailbox_with_no_mail: Send e-mail warnings
- [x] :mailbox_with_no_mail: Send e-mail warnings
- [ ] :bomb: Kill unwated processes
- [ ] :rocket: Automatic execution of user's predefined command
- [ ] :watch: Track wasted reservation time (idle)
- [x] :watch: Track wasted reservation time (idle)
- [ ] Remind user when his reservation starts and ends
- [ ] Send e-mail if idle for too long
#### Dashboard
Expand All @@ -95,7 +99,7 @@ Features
- [ ] CPU, RAM, HDD metrics
- [x] :calendar: Calendar view
- [x] Allow making reservations for selected GPUs
- [ ] Edit reservations
- [x] Edit reservations
- [x] Cancel reservations
- [ ] :scroll: Detailed hardware specification view
- [ ] :penguin: Admin panel
Expand Down
28 changes: 28 additions & 0 deletions migrations/versions/05eca1c82f14_add_email_column_to_user.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""Add email column to User
Revision ID: 05eca1c82f14
Revises: ce624ab2c458
Create Date: 2019-01-29 22:31:48.215468
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '05eca1c82f14'
down_revision = 'ce624ab2c458'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('email', sa.String(length=64), server_default='<email_missing>', nullable=False))
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'email')
# ### end Alembic commands ###
24 changes: 24 additions & 0 deletions migrations/versions/5279ea22b197_merge_emails_and_summaries.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""merge emails and summaries
Revision ID: 5279ea22b197
Revises: bffd7d81d326, 05eca1c82f14
Create Date: 2019-03-08 13:07:03.446641
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '5279ea22b197'
down_revision = ('bffd7d81d326', '05eca1c82f14')
branch_labels = None
depends_on = None


def upgrade():
pass


def downgrade():
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Add summary fields to Reservation
Revision ID: bffd7d81d326
Revises: ce624ab2c458
Create Date: 2019-02-21 20:48:59.993973
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'bffd7d81d326'
down_revision = 'ce624ab2c458'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('reservations', sa.Column('gpu_util_avg', sa.Integer(), nullable=True))
op.add_column('reservations', sa.Column('mem_util_avg', sa.Integer(), nullable=True))
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('reservations', 'mem_util_avg')
op.drop_column('reservations', 'gpu_util_avg')
# ### end Alembic commands ###
4 changes: 3 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[pytest]
testpaths = tests/
python_files = *.py
addopts = --verbose
addopts = --verbose
env =
PYTEST=1
9 changes: 6 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
pytest
pytest-faker
alembic
pytest==4.0.1
pytest-faker==2.0.0
pytest-env==0.6.2
alembic==1.0.3
flake8==3.6.0

8 changes: 8 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
[metadata]
description-file = README.md

[flake8]
max-line-length = 119
ignore = F401,E731
# F401 - Module imported but unused
# E731 - Do not assign lambda expression, use a def
# Source: https://lintlyci.github.io/Flake8Rules/
exclude = tensorhive/snippet.py,tensorhive/app/web/dev/node_modules/
51 changes: 12 additions & 39 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,5 @@
from setuptools import setup, find_packages
from pathlib import PosixPath
import tensorhive
import shutil


def copy_configuration_files():
target_dir = PosixPath.home() / '.config/TensorHive'
# destination is given explicitly, just in case we'd want to rename file during the installation process
hosts_config_path = {'src': 'hosts_config.ini', 'dst': str(target_dir / 'hosts_config.ini')}
config_path = {'src': 'main_config.ini', 'dst': str(target_dir / 'main_config.ini')}

def safe_copy(src: str, dst: str):
'''It won't override existing configuration'''
if PosixPath(dst).exists():
print('Skipping, file already exists: {}'.format(dst))
else:
shutil.copy(src, dst)
print('Creating file {}'.format(dst))

try:
target_dir.mkdir(parents=True, exist_ok=True)
safe_copy(hosts_config_path['src'], hosts_config_path['dst'])
safe_copy(config_path['src'], config_path['dst'])
except Exception:
# FIXME Prints are only visible with `pip install foobar --verbose`
print('Unable to copy configuration files to {}'.format(target_dir))


# TODO Add platform and license
Expand All @@ -46,20 +21,18 @@ def safe_copy(src: str, dst: str):
download_url='https://github.com/roscisz/TensorHive/archive/{}.tar.gz'.format(tensorhive.__version__),
keywords='distributed machine learning tensorflow resource management',
install_requires=[
'parallel-ssh',
'passlib',
'sqlalchemy',
'sqlalchemy-utils',
'click',
'connexion',
'flask_cors',
'flask_jwt_extended',
'gunicorn',
'coloredlogs',
'Safe',
'python-usernames'
'parallel-ssh==1.9.1',
'passlib==1.7.1',
'sqlalchemy==1.2.14',
'sqlalchemy-utils==0.33.8',
'click==7.0',
'connexion==1.5.3',
'flask_cors==3.0.7',
'flask_jwt_extended==3.13.1',
'gunicorn==19.9.0',
'coloredlogs==10.0',
'Safe==0.4',
'python-usernames==0.2.2'
],
zip_safe=False
)

copy_configuration_files()
2 changes: 1 addition & 1 deletion tensorhive/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.2.2'
__version__ = '0.2.3'
2 changes: 1 addition & 1 deletion tensorhive/api/APIServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def shutdown_session(exception=None):

app.add_api(API.SPEC_FILE,
arguments={
'title': API.TITLE,
'title': API.TITLE,
'version': API.VERSION,
'url_prefix': API.URL_PREFIX,
'RESPONSES': API.RESPONSES
Expand Down
Loading

0 comments on commit bc5711c

Please sign in to comment.