Skip to content

Commit

Permalink
1.1.0 release (#34)
Browse files Browse the repository at this point in the history
* started 1.0.x dev branch

* fixes #33

* release 1.1

* 1.1.0 release

* changed URL order so that CARTA is first (so isn't the front tab)

* changed URL order to reverse
  • Loading branch information
o-smirnov authored Oct 30, 2020
1 parent f800861 commit d6e0596
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 16 deletions.
11 changes: 7 additions & 4 deletions bin/run-radiopadre
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@ from collections import OrderedDict
# ### some globals
import iglesia
from radiopadre_client import config, sessions
from radiopadre_client.default_config import __version__

from iglesia.utils import message, debug, bye, ff, INPUT

from iglesia import logger

parser = argparse.ArgumentParser(description="""
Manages local or remote Jupyter sessions with radiopadre notebooks.
""",
run-radiopadre (v{}): manage local or remote Jupyter sessions for radiopadre notebooks.
""".format(__version__),
formatter_class=argparse.RawTextHelpFormatter)

parser.add_argument("-b", "--browser", type=str, metavar="COMMAND[:OPT[:OPT...]]", default=config.DEFAULT_VALUE,
help=ff("browser command to run. Default is {config.BROWSER} (can also set RADIOPADRE_BROWSER)."))
help=ff("browser command to run. Default is {config.BROWSER} (can also set RADIOPADRE_BROWSER). "
"OPT can include 'bg' to run the command as a background process, and '*' to run "
"the command with muitple URLs if needed (as opposed to running one command per URL)"))
parser.add_argument("-n", "--no-browser", action="store_false", dest="browser",
help="do not open a browser session.")

Expand Down Expand Up @@ -176,7 +179,7 @@ logger.init('radiopadre.client', boring=options.boring or options.non_interactiv
if options.non_interactive:
logger.logger.setLevel(logging.ERROR)

message("Welcome to the radiopadre client!", color="GREEN")
message("Welcome to the radiopadre client version {}!".format(__version__), color="GREEN")

# recent session management: only done for front-end sessions
manage_last_sessions = not options.remote and not options.inside_container and not options.non_interactive \
Expand Down
15 changes: 11 additions & 4 deletions radiopadre_client/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import ConfigParser as configparser

import iglesia
from iglesia.utils import make_dir, message, ff, make_radiopadre_dir
from iglesia.utils import make_dir, message, ff, make_radiopadre_dir, warning
from .default_config import DefaultConfig

# const object to use as default value in ArgumentParser. Will be replaced by contents
Expand Down Expand Up @@ -95,12 +95,19 @@

def _get_config_value(section, key):
globalval = globals().get(key.upper())
value = section[key]
if globalval is None or isinstance(globalval, six.string_types):
return section[key]
return value
elif type(globalval) is bool:
return bool(section[key])
if value.lower() in {'no', '0', 'false'}:
return False
elif value.lower() in {'yes', '1', 'true'}:
return True
else:
warning("unrecognized setting {} = {} in config, assuming False".format(key, value))
return False
elif type(globalval) is int:
return int(section[key])
return int(value)
else:
raise TypeError("unsupported type {} for option {}".format(type(globalval), key))

Expand Down
8 changes: 5 additions & 3 deletions radiopadre_client/default_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

import os.path

__version__ = "1.1.0"

DefaultConfig = OrderedDict(
AUTO_LOAD="radiopadre-auto.ipynb",
SKIP_CHECKS=False,
Expand All @@ -20,17 +22,17 @@
CARTA_BROWSER=True,
CONTAINER_DEV=False,
DEFAULT_NOTEBOOK="radiopadre-default.ipynb",
DOCKER_IMAGE="osmirnov/radiopadre:1.0", # change for each release
DOCKER_IMAGE="osmirnov/radiopadre:1.1.0", # change for each release
CONTAINER_DEBUG=False,
GRIM_REAPER=True,
REMOTE_RADIOPADRE_DIR="~/.radiopadre",
CLIENT_INSTALL_PATH="~/radiopadre-client",
CLIENT_INSTALL_REPO="", #"https://github.com/ratt-ru/radiopadre-client.git", # empty for pip release
CLIENT_INSTALL_BRANCH="b1.0", # change for each release
CLIENT_INSTALL_BRANCH="b1.1.0", # change for each release
CLIENT_INSTALL_PIP="radiopadre-client",
SERVER_INSTALL_PATH="~/radiopadre",
SERVER_INSTALL_REPO="", #"https://github.com/ratt-ru/radiopadre.git", # empty for pip release
SERVER_INSTALL_BRANCH="b1.0", # change for each release
SERVER_INSTALL_BRANCH="b1.1.0", # change for each release
SERVER_INSTALL_PIP="radiopadre",
SINGULARITY_IMAGE_DIR="",
SINGULARITY_AUTO_BUILD=True,
Expand Down
4 changes: 2 additions & 2 deletions radiopadre_client/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ def check_remote_command(command):
do_update = config.UPDATE

if config.SKIP_CHECKS:
runscript = ff("rs={config.RADIOPADRE_VENV}/bin/run-radiopadre; if [ ! -x $rs ]; then " +
"source {config.RADIOPADRE_VENV}/bin/activate; rs=run-radiopadre; fi; $rs ")
runscript = ff("if [ -f {config.RADIOPADRE_VENV}/bin/activate ]; then " +
"source {config.RADIOPADRE_VENV}/bin/activate; fi; run-radiopadre ")
do_update = False
else:
runscript = None
Expand Down
4 changes: 2 additions & 2 deletions radiopadre_client/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,14 +357,14 @@ def run_radiopadre_server(command, arguments, notebook_path, workdir=None):
for nb in LOAD_NOTEBOOK]

if not config.NBCONVERT:
for url in urls:
for url in urls[::-1]:
message(ff("Browse to URL: {url}"), color="GREEN")

if config.CARTA_BROWSER:
url = ff("http://localhost:{iglesia.CARTA_PORT}/?socketUrl=ws://localhost:{iglesia.CARTA_WS_PORT}")
message(ff("Browse to URL: {url} (CARTA file browser)"), color="GREEN")
urls.append(url)


# now we're ready to start the session

backend.start_session(container_name, selected_ports, userside_ports,
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from setuptools import setup
import os

__version__ = "1.0"
from radiopadre_client.default_config import __version__

build_root = os.path.dirname(__file__)

install_requires = ['six', 'psutil']
Expand Down

0 comments on commit d6e0596

Please sign in to comment.