diff --git a/bin/run-radiopadre b/bin/run-radiopadre index a7f639f..2ed7b06 100755 --- a/bin/run-radiopadre +++ b/bin/run-radiopadre @@ -324,7 +324,7 @@ import signal signal.signal(signal.SIGHUP, _handle_hup) # work out browser -if config.BROWSER.upper() in ("NONE", "FALSE", "0"): +if str(config.BROWSER).upper() in ("NONE", "FALSE", "0"): config.BROWSER = None diff --git a/iglesia/__init__.py b/iglesia/__init__.py index 9367c27..d8132ee 100644 --- a/iglesia/__init__.py +++ b/iglesia/__init__.py @@ -186,7 +186,7 @@ def get_carta_url(*args): url = f"http://localhost:{CARTA_PORT}" if CARTA_VERSION < "2": - args = [f"socketUrl=ws://localhost:{CARTA_WS_PORT}"] + args + args = [f"socketUrl=ws://localhost:{CARTA_WS_PORT}"] + list(args) args += [f"token={uuid.UUID(SESSION_ID)}"] if args: diff --git a/iglesia/utils.py b/iglesia/utils.py index 7e48090..42363ad 100644 --- a/iglesia/utils.py +++ b/iglesia/utils.py @@ -34,10 +34,13 @@ def bye(x, code=1): message(x, level=logging.ERROR) sys.exit(code) -def shell(cmd, ignore_fail=False): +def shell(cmd, ignore_fail=False, env=None): """Runs shell command. If ignore_fail is set, returns None on failure""" + if env is not None: + env = dict(**env) + env.update(os.environ) try: - return subprocess.check_call(cmd, shell=True) + return subprocess.check_call(cmd, shell=True, env=env) except subprocess.CalledProcessError as exc: if ignore_fail: return None diff --git a/radiopadre_client/backends/venv.py b/radiopadre_client/backends/venv.py index 3abe534..65ce2be 100644 --- a/radiopadre_client/backends/venv.py +++ b/radiopadre_client/backends/venv.py @@ -120,9 +120,14 @@ def update_installation(): else: bye("no radiopadre installation method specified (see --server-install options)") + if config.VENV_IGNORE_JS9: + env = dict(RADIOPADRE_JS9_IGNORE_ERRORS='1') + else: + env = None + cmd = f"{pip_install} -U {install}" message(f"Running {cmd}") - shell(cmd) + shell(cmd, env=env) # if not config.INSIDE_CONTAINER_PORTS: # message(f" Radiopadre has been installed from {config.SERVER_INSTALL_PATH}") diff --git a/radiopadre_client/remote.py b/radiopadre_client/remote.py index 0b8f7f0..2061e01 100644 --- a/radiopadre_client/remote.py +++ b/radiopadre_client/remote.py @@ -223,10 +223,11 @@ def check_remote_command(command): if not check_remote_file(f"{config.RADIOPADRE_VENV}/bin/activate", "-f"): message(f"Creating virtualenv {remote_venv}") ssh_remote_v(f"virtualenv -p python3 {config.RADIOPADRE_VENV}") + extras = "pip setuptools" if config.VENV_EXTRAS: - extras = " ".join(config.VENV_EXTRAS.split(",")) - message(f"Installing specified extras: {extras}") - ssh_remote_v(f"source {config.RADIOPADRE_VENV}/bin/activate && {pip_install} {extras}") + extras += " ".join(config.VENV_EXTRAS.split(",")) + message(f"Installing {extras}") + ssh_remote_v(f"source {config.RADIOPADRE_VENV}/bin/activate && {pip_install} -U {extras}") else: message(f"Installing into existing virtualenv {remote_venv}") @@ -314,6 +315,7 @@ def check_remote_command(command): for _ in range(NUM_PORTS): starting_port = find_unused_port(starting_port + 1, 10000) ports.append(starting_port) + iglesia.set_userside_ports(ports) remote_config["remote"] = ":".join(map(str, ports)) @@ -422,6 +424,7 @@ def check_remote_command(command): iglesia.CARTA_VERSION = match.group(1) if config.CARTA_BROWSER: urls.append(iglesia.get_carta_url()) + message(f"Remote CARTA version is {iglesia.CARTA_VERSION} ({config.CARTA_BROWSER})") continue if "jupyter notebook server is running" in line: