diff --git a/MANIFEST.in b/MANIFEST.in index 834149fb..69f1a0c3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,6 +6,8 @@ include tensorhive/api/*.yml include tensorhive/controllers/responses.yml include tensorhive/*.ini graft tensorhive/app/web/dist +include tensorhive/alembic.ini +graft tensorhive/migrations global-exclude *.py[co] prune tensorhive/app/web/dev diff --git a/README.md b/README.md index c11c95d5..60f1fcce 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ TensorHive === -![](https://img.shields.io/badge/release-v0.3.4-brightgreen.svg?style=popout-square) -![](https://img.shields.io/badge/pypi-v0.3.4-brightgreen.svg?style=popout-square) +![](https://img.shields.io/badge/release-v0.3.5-brightgreen.svg?style=popout-square) +![](https://img.shields.io/badge/pypi-v0.3.5-brightgreen.svg?style=popout-square) ![](https://img.shields.io/badge/Issues%20and%20PRs-welcome-yellow.svg?style=popout-square) ![](https://img.shields.io/badge/platform-Linux-blue.svg?style=popout-square) ![](https://img.shields.io/badge/hardware-Nvidia-green.svg?style=popout-square) diff --git a/setup.cfg b/setup.cfg index 5bea031e..c8ebff65 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,7 +7,7 @@ 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/ +exclude = tensorhive/migrations/,tensorhive/app/web/dev/node_modules/ [mypy] python_version = 3.6 diff --git a/setup.py b/setup.py index f59cfd9c..ea45bba4 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,12 @@ from setuptools import setup, find_packages import tensorhive +import os + +this_directory = os.path.abspath(os.path.dirname(__file__)) +with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f: + long_description = f.read() -# TODO Add platform and license setup( name='tensorhive', version=tensorhive.__version__, @@ -15,11 +19,13 @@ ], }, description='A user-friendly GPU management tool for distributed machine learning workloads', + long_description=long_description, + long_description_content_type='text/markdown', author='Pawel Rosciszewski, Michal Martyniak, Filip Schodowski', author_email='pawel.rosciszewski@pg.edu.pl', url='https://github.com/roscisz/TensorHive', download_url='https://github.com/roscisz/TensorHive/archive/{}.tar.gz'.format(tensorhive.__version__), - keywords='reservation monitoring machine learning distributed tensorflow pytorch', + keywords='gpu reservation calendar monitoring machine learning distributed tensorflow pytorch', install_requires=[ 'parallel-ssh==1.9.1', 'passlib==1.7.1', diff --git a/tensorhive/__init__.py b/tensorhive/__init__.py index bfeb9e74..40ed83d9 100644 --- a/tensorhive/__init__.py +++ b/tensorhive/__init__.py @@ -1 +1 @@ -__version__ = '0.3.4' +__version__ = '0.3.5' diff --git a/alembic.ini b/tensorhive/alembic.ini similarity index 100% rename from alembic.ini rename to tensorhive/alembic.ini diff --git a/tensorhive/app/web/dev/package.json b/tensorhive/app/web/dev/package.json index 6414022d..f559a61a 100644 --- a/tensorhive/app/web/dev/package.json +++ b/tensorhive/app/web/dev/package.json @@ -1,6 +1,6 @@ { "name": "tensorhive_web_app", - "version": "0.3.4", + "version": "0.3.5", "description": "Web aplication based on CoPilot admin template", "author": "filschod", "license": "MIT", diff --git a/tensorhive/config.py b/tensorhive/config.py index 8b49331f..362e70b3 100644 --- a/tensorhive/config.py +++ b/tensorhive/config.py @@ -24,6 +24,9 @@ class CONFIG_FILES: HOSTS_CONFIG_TEMPLATE_PATH = str(tensorhive_package_dir / 'hosts_config.ini') MAILBOT_TEMPLATE_CONFIG_PATH = str(tensorhive_package_dir / 'mailbot_config.ini') + ALEMBIC_CONFIG_PATH = str(tensorhive_package_dir / 'alembic.ini') + MIGRATIONS_CONFIG_PATH = str(tensorhive_package_dir / 'migrations') + class ConfigInitilizer: '''Makes sure that all default config files exist''' diff --git a/tensorhive/database.py b/tensorhive/database.py index d7833066..117a4403 100644 --- a/tensorhive/database.py +++ b/tensorhive/database.py @@ -2,7 +2,7 @@ from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.ext.declarative import declarative_base from sqlalchemy_utils import database_exists -from tensorhive.config import DB +from tensorhive.config import DB, CONFIG_FILES from alembic import command from alembic.config import Config from alembic.migration import MigrationContext @@ -71,7 +71,8 @@ def ensure_db_with_current_schema() -> None: """Makes sure that there is a DB in proper version and creates or upgrades the DB if needed""" _import_models() - alembic_config = Config('alembic.ini') + alembic_config = Config(CONFIG_FILES.ALEMBIC_CONFIG_PATH) + alembic_config.set_main_option("script_location", CONFIG_FILES.MIGRATIONS_CONFIG_PATH) if not check_if_db_exists(): initialize_db(alembic_config) diff --git a/migrations/README b/tensorhive/migrations/README similarity index 100% rename from migrations/README rename to tensorhive/migrations/README diff --git a/migrations/env.py b/tensorhive/migrations/env.py similarity index 100% rename from migrations/env.py rename to tensorhive/migrations/env.py diff --git a/migrations/script.py.mako b/tensorhive/migrations/script.py.mako similarity index 100% rename from migrations/script.py.mako rename to tensorhive/migrations/script.py.mako diff --git a/migrations/versions/05eca1c82f14_add_email_column_to_user.py b/tensorhive/migrations/versions/05eca1c82f14_add_email_column_to_user.py similarity index 100% rename from migrations/versions/05eca1c82f14_add_email_column_to_user.py rename to tensorhive/migrations/versions/05eca1c82f14_add_email_column_to_user.py diff --git a/migrations/versions/06ce06e9bb85_add_is_cancelled_column_to_the_.py b/tensorhive/migrations/versions/06ce06e9bb85_add_is_cancelled_column_to_the_.py similarity index 100% rename from migrations/versions/06ce06e9bb85_add_is_cancelled_column_to_the_.py rename to tensorhive/migrations/versions/06ce06e9bb85_add_is_cancelled_column_to_the_.py diff --git a/migrations/versions/131eb148fd57_add_task_table.py b/tensorhive/migrations/versions/131eb148fd57_add_task_table.py similarity index 100% rename from migrations/versions/131eb148fd57_add_task_table.py rename to tensorhive/migrations/versions/131eb148fd57_add_task_table.py diff --git a/migrations/versions/5279ea22b197_merge_emails_and_summaries.py b/tensorhive/migrations/versions/5279ea22b197_merge_emails_and_summaries.py similarity index 100% rename from migrations/versions/5279ea22b197_merge_emails_and_summaries.py rename to tensorhive/migrations/versions/5279ea22b197_merge_emails_and_summaries.py diff --git a/migrations/versions/58a12e45663e_add_hostname_column_to_the_resources_.py b/tensorhive/migrations/versions/58a12e45663e_add_hostname_column_to_the_resources_.py similarity index 100% rename from migrations/versions/58a12e45663e_add_hostname_column_to_the_resources_.py rename to tensorhive/migrations/versions/58a12e45663e_add_hostname_column_to_the_resources_.py diff --git a/migrations/versions/7110c972b137_remove_unique_constraint_from_is_.py b/tensorhive/migrations/versions/7110c972b137_remove_unique_constraint_from_is_.py similarity index 100% rename from migrations/versions/7110c972b137_remove_unique_constraint_from_is_.py rename to tensorhive/migrations/versions/7110c972b137_remove_unique_constraint_from_is_.py diff --git a/migrations/versions/72fb5b78625f_add_is_default_column_to_the_groups_.py b/tensorhive/migrations/versions/72fb5b78625f_add_is_default_column_to_the_groups_.py similarity index 100% rename from migrations/versions/72fb5b78625f_add_is_default_column_to_the_groups_.py rename to tensorhive/migrations/versions/72fb5b78625f_add_is_default_column_to_the_groups_.py diff --git a/migrations/versions/81c2455baab1_create_resources_table.py b/tensorhive/migrations/versions/81c2455baab1_create_resources_table.py similarity index 100% rename from migrations/versions/81c2455baab1_create_resources_table.py rename to tensorhive/migrations/versions/81c2455baab1_create_resources_table.py diff --git a/migrations/versions/9d12594fe87b_create_restriction_schedules_and_.py b/tensorhive/migrations/versions/9d12594fe87b_create_restriction_schedules_and_.py similarity index 100% rename from migrations/versions/9d12594fe87b_create_restriction_schedules_and_.py rename to tensorhive/migrations/versions/9d12594fe87b_create_restriction_schedules_and_.py diff --git a/migrations/versions/bffd7d81d326_add_summary_fields_to_reservation.py b/tensorhive/migrations/versions/bffd7d81d326_add_summary_fields_to_reservation.py similarity index 100% rename from migrations/versions/bffd7d81d326_add_summary_fields_to_reservation.py rename to tensorhive/migrations/versions/bffd7d81d326_add_summary_fields_to_reservation.py diff --git a/migrations/versions/ce624ab2c458_create_tables.py b/tensorhive/migrations/versions/ce624ab2c458_create_tables.py similarity index 100% rename from migrations/versions/ce624ab2c458_create_tables.py rename to tensorhive/migrations/versions/ce624ab2c458_create_tables.py diff --git a/migrations/versions/e792ab930685_rename_columns_to_match_api.py b/tensorhive/migrations/versions/e792ab930685_rename_columns_to_match_api.py similarity index 100% rename from migrations/versions/e792ab930685_rename_columns_to_match_api.py rename to tensorhive/migrations/versions/e792ab930685_rename_columns_to_match_api.py diff --git a/migrations/versions/e935d47c4cde_create_restrictions_and_secondary_tables.py b/tensorhive/migrations/versions/e935d47c4cde_create_restrictions_and_secondary_tables.py similarity index 100% rename from migrations/versions/e935d47c4cde_create_restrictions_and_secondary_tables.py rename to tensorhive/migrations/versions/e935d47c4cde_create_restrictions_and_secondary_tables.py diff --git a/migrations/versions/ecd059f567b5_create_groups_and_user2group_tables.py b/tensorhive/migrations/versions/ecd059f567b5_create_groups_and_user2group_tables.py similarity index 100% rename from migrations/versions/ecd059f567b5_create_groups_and_user2group_tables.py rename to tensorhive/migrations/versions/ecd059f567b5_create_groups_and_user2group_tables.py