Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.8.0 #241

Merged
merged 20 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ clean:
@if [ -e dist/ ] ; then rm -rf dist/ ; fi
@if [ -e gxabm.egg-info ] ; then rm -rf gxabm.egg-info ; fi

format:
black -S abm/
isort abm/

test-deploy:
twine upload -r pypitest dist/*

Expand Down
2 changes: 1 addition & 1 deletion abm/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.6
2.8.0-dev.6
5 changes: 4 additions & 1 deletion abm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import os, sys
import os
import sys

sys.path.append(os.path.dirname(os.path.realpath(__file__)))


def getVersion():
dir = os.path.dirname(os.path.realpath(__file__))
version_file = os.path.join(dir, 'VERSION')
Expand Down
45 changes: 32 additions & 13 deletions abm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@

"""

import yaml
import sys
import os
import logging
from lib.common import Context
import os
import sys
from pprint import pprint
from abm import getVersion

import yaml
# These imports are required because we need Python to be load them to the
# symbol table so the parse_menu method can find them in globals()
from lib import job, dataset, workflow, history, library, folder, benchmark, helm, kubectl, config, experiment, users, cloudlaunch, invocation
from lib import (benchmark, cloudlaunch, config, dataset, experiment, folder,
helm, history, invocation, job, kubectl, library, users,
workflow)
from lib.common import Context

from abm import getVersion

log = logging.getLogger('abm')
handler = logging.StreamHandler()
Expand All @@ -29,11 +32,12 @@
log.addHandler(handler)


#VERSION = '2.0.0-dev'
# VERSION = '2.0.0-dev'

BOLD = '\033[1m'
CLEAR = '\033[0m'


def bold(text: str):
"""
Wraps the text in ANSI control sequences to generate bold text in the terminal.
Expand All @@ -50,17 +54,19 @@ def bold(text: str):
# Commands that do not depend on a cloud instance
stand_alone_commands = []


def head(text):
print(bold(text))


def command_list(commands:list):
def command_list(commands: list):
return '|'.join(bold(c) for c in commands)


def copyright():
print(f" Copyright 2023 The Galaxy Project. All Rights Reserved.\n")


def print_main_help(menu_data):
print()
head(" DESCRIPTION")
Expand All @@ -79,7 +85,9 @@ def print_main_help(menu_data):
print(" print this help screen and exit")
print()
head(" NOTES")
print(f" Available SUBCOMMANDS and OPTIONS depend on the command. Use the {bold('help')} subcommand")
print(
f" Available SUBCOMMANDS and OPTIONS depend on the command. Use the {bold('help')} subcommand"
)
print(f" to learn more about each of the commands. For example:\n")
print(f" $> abm workflow help\n")
copyright()
Expand All @@ -92,7 +100,7 @@ def print_help(menu_data, command):
submenu = menu_item
break
if submenu is None:
#print_main_help(menu_data)
# print_main_help(menu_data)
print(f"No help for {command} is available")
return

Expand All @@ -106,7 +114,9 @@ def print_help(menu_data, command):
print(f" {submenu['help']}\n")
head(" SUBCOMMANDS")
for menu_item in submenu['menu']:
print(f" {'|'.join(bold(x) for x in menu_item['name'])} {menu_item['params'] if 'params' in menu_item else ''}")
print(
f" {'|'.join(bold(x) for x in menu_item['name'])} {menu_item['params'] if 'params' in menu_item else ''}"
)
print(f" {menu_item['help']}")
print(f" {bold('help')}")
print(" print this help screen and exit")
Expand Down Expand Up @@ -181,6 +191,7 @@ def version():
print(f" Galaxy Automated Benchmarking v{version}")
copyright()


def _get_logopt(args: list):
OPTS = ['-log', '--log', '-logging', '--logging']
for i in range(len(args)):
Expand All @@ -193,12 +204,20 @@ def entrypoint():
# Check if log level is being set
logopt = _get_logopt(sys.argv)
if logopt >= 0:
if logopt+1 >= len(sys.argv):
if logopt + 1 >= len(sys.argv):
print("ERROR: no log level provided")
return

level = sys.argv[logopt + 1].upper()
if level not in ['DEBUG', 'INFO', 'WARN', 'WARNING', 'ERROR', 'FATAL', 'CRITICAL']:
if level not in [
'DEBUG',
'INFO',
'WARN',
'WARNING',
'ERROR',
'FATAL',
'CRITICAL',
]:
print(f"ERROR: Invalid logging level {sys.argv[logopt + 1]}")
return
print(f"Setting the log level to {level}")
Expand Down
11 changes: 7 additions & 4 deletions abm/lib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
import os, sys, json
import json
import os
import sys

sys.path.append(os.path.dirname(os.path.realpath(__file__)))

#from common import parse_profile
# from common import parse_profile

INVOCATIONS_DIR = "invocations"
METRICS_DIR = "metrics"

parser = None


class Keys:
NAME = 'name'
RUNS = 'runs'
INPUTS = 'inputs'
REFERENCE_DATA = 'reference_data'
WORKFLOW_ID = 'workflow_id'
DATASET_ID = 'dataset_id'
COLLECTION = 'collection'
HISTORY_BASE_NAME = 'output_history_base_name'
HISTORY_NAME = 'history_name'


Loading