Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:
- name: Install Rose
working-directory: rose
run: |
pip install ."[tests,docs,rose-edit${{ (startsWith(matrix.os, 'ubuntu') && ',graph,rosa') || '' }}]"
pip install ."[tests,docs,rose-edit,graph,rosa,disco]"
yarn install

- name: Install Cylc
Expand Down Expand Up @@ -259,7 +259,7 @@ jobs:

- name: Install Rose
run: |
pip install -e .[docs,graph,edit] --upgrade-strategy='only-if-needed'
pip install -e .[docs,graph,edit,disco] --upgrade-strategy='only-if-needed'

- name: Install Cylc
uses: cylc/release-actions/install-cylc-components@v1
Expand Down
3 changes: 3 additions & 0 deletions changes.d/2985.feat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rosie: The `rosie disco` server has been restored restored to Rose 2.

It is now available as the pip package `rose[disco]` or the conda-forge package `metomi-rose`.
4 changes: 2 additions & 2 deletions conda-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ dependencies:
- metomi-isodatetime >=1!3.0,<1!4.0
- psutil >=5.6.0
- requests
- sqlalchemy >=1,<2
# - tornado (rosie disco is temporally disabled)

# output: metomi-rose
- pygraphviz >1.0,!=1.8
- pygobject >=3.50.0
- gtk3 >=3.24.43
- sqlalchemy >=1,<2
- tornado
Comment on lines +20 to +21
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move rosie-only dependencies out of core dependencies:

$ git grep --name-only sqlalchemy -- metomi
metomi/rose/check_software.py
metomi/rosie/db.py
metomi/rosie/db_create.py
metomi/rosie/svn_post_commit.py

$ git grep --name-only tornado -- metomi
metomi/rose/check_software.py
metomi/rosie/ws.py

2 changes: 0 additions & 2 deletions metomi/rose/rose.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ def iter_entry_points(name: str):
'This command has been replaced by: "cylc stop".',
('rose', 'suite-stop'):
'This command has been replaced by: "cylc stop".',
('rosie', 'disco'):
'Rosie Disco has been disabled pending fixes at a later release.',
('rosie', 'go'):
'This command has been removed.',
}
Expand Down
10 changes: 8 additions & 2 deletions metomi/rosie/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
from pathlib import Path
import pwd
import signal
import sys
from time import sleep

import jinja2
from tornado.ioloop import IOLoop, PeriodicCallback
import tornado.log
import tornado.web
import tornado.wsgi
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove residual remains of WSGI support.


from metomi.isodatetime.data import get_timepoint_from_seconds_since_unix_epoch
from metomi.rose import __version__ as ROSE_VERSION
Expand Down Expand Up @@ -104,7 +104,13 @@ def __init__(self, service_root_mode=False, *args, **kwargs):
)

db_url_map = {}
for key, node in rose_conf.get(["rosie-db"]).value.items():
rosie_db = rose_conf.get(["rosie-db"])
if not rosie_db or not rosie_db.value:
sys.exit(
'Please configure one or more rosie prefix in'
' "rose.conf[rosie-db]".'
)
for key, node in rosie_db.value.items():
if key.startswith("db.") and key[3:]:
db_url_map[key[3:]] = node.value
self.db_url_map = db_url_map
Expand Down
26 changes: 22 additions & 4 deletions metomi/rosie/ws_client_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,12 @@ def list_local_suites():
* `X` means that the suite is checked out but is corrupted.
''',
).add_my_options(
"no_headers", "prefixes", "print_format", "reverse", "sort", "user"
"no_headers",
"prefixes",
"print_format",
"reverse",
"sort",
"user",
)
opt_parser.modify_option(
'verbosity',
Expand Down Expand Up @@ -390,7 +395,7 @@ def _display_maps(opts, ws_client, dict_rows, url=None):
if "%" + key in opts.print_format:
keylist.append(key)

if not opts.no_headers:
if getattr(opts, 'no_pretty_mode', True) and not opts.no_headers:
dummy_row = {}
for key in all_keys:
dummy_row[key] = key
Expand All @@ -415,8 +420,21 @@ def _display_maps(opts, ws_client, dict_rows, url=None):
if url is not None:
report(URLEvent(url + "\n"), prefix="")
else:
cols = [x.replace('%', '') for x in opts.print_format.split()]
_rows = [[_dict[col] for col in cols] for _dict in dict_rows[2:]]
cols = [
col[1:]
for col in opts.print_format.split()
# NOTE: strip off anything which isn't a valid field
if col[0] == '%'
]
_rows = [
# NOTE: tolerate missing fields - column format used as placeholder
# (e.g, "access-list" might not be defined for all rows)
# NOTE: convert to string (e.g, "access-list" is a list)
[str(_dict.get(col, f"%{col}")) for col in cols]
for _dict in dict_rows
]
if opts.no_headers:
cols = None # turn header row off in table
try:
print(table(_rows, header=cols, max_width=terminal_cols))
except UnicodeDecodeError:
Expand Down
15 changes: 7 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ dependencies = [
"metomi-isodatetime==1!3.*",
"psutil>=5.6.0",
"requests",
"sqlalchemy==1.*",
]

[project.urls]
Expand Down Expand Up @@ -96,22 +95,22 @@ tutorials = [
"cylc-flow[tutorials]>=8.6.1"
]
rosa = []
# disco = [
# TODO: rosie disco has been disabled due to the removal of WSGI support at
# Tornado 6.
# tornado
# ]
edit = [
"pygobject>=3.50.0",
]
disco = [
"sqlalchemy==1.*",
"tornado",
]
all = [
"metomi-rose[lint]",
"metomi-rose[docs]",
"metomi-rose[graph]",
"metomi-rose[tests]",
"metomi-rose[tutorials]",
"metomi-rose[rosa]",
"metomi-rose[edit]",
"metomi-rose[tutorials]",
"metomi-rose[disco]",
]

[project.scripts]
Expand Down Expand Up @@ -145,7 +144,7 @@ rosa = "metomi.rose.rose:rosa"
"checkout" = "metomi.rosie.vc:checkout"
"create" = "metomi.rosie.vc:create"
"delete" = "metomi.rosie.vc:delete"
# "disco" = "metomi.rosie.ws:main [disco]"
"disco" = "metomi.rosie.ws:main [disco]"
"graph" = "metomi.rosie.graph:main [graph]"
"hello" = "metomi.rosie.ws_client_cli:hello"
"id" = "metomi.rosie.suite_id:main"
Expand Down
16 changes: 16 additions & 0 deletions sphinx/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,22 @@ Rose with the ``graph`` optional dependency::
hosting services such as GitHub. Note Git is not automatically installed
by the metomi-rose conda.

Rosie
"""""

If installing via ``pip``, you will need to install the ``rosie`` optional
dependency::

$ pip install metomi-rose[rosie]

Rosa
""""

If installing via ``pip``, you will need to install the ``rosa`` optional
dependency::

$ pip install metomi-rose[rosa]

Configuring Rose
----------------

Expand Down
2 changes: 1 addition & 1 deletion t/lib/bash/test_header
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ rose_ws_init() {
TEST_ROSE_WS_PORT="${PORT}"
if port_is_busy "${TEST_ROSE_WS_PORT}"; then
pass "${TEST_KEY}"
TEST_ROSE_WS_URL="http://${HOSTNAME}:${TEST_ROSE_WS_PORT}/${NS}-${UTIL}"
TEST_ROSE_WS_URL="http://$(hostname -f):${TEST_ROSE_WS_PORT}/${NS}-${UTIL}"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For VDI test compat.

else
fail "${TEST_KEY}"
rose_ws_kill
Expand Down
18 changes: 15 additions & 3 deletions t/rosie-disco/00-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,22 @@ if ! python3 -c 'import tornado, sqlalchemy' 2>/dev/null; then
skip_all '"tornado" or "sqlalchemy" not installed'
fi
#-------------------------------------------------------------------------------
tests 23
tests 27
#-------------------------------------------------------------------------------
# Test without config
TEST_KEY="${TEST_KEY_BASE}-no-config"
export ROSE_CONF_PATH=$PWD
run_fail "${TEST_KEY}-1" rosie disco start
cat >rose.conf <<__ROSE_CONF__
[rosie-id]
__ROSE_CONF__
run_fail "${TEST_KEY}-2" rosie disco start
file_cmp "${TEST_KEY}-1.err" "${TEST_KEY}-1.err" <<__STDERR__
Please configure one or more rosie prefix in "rose.conf[rosie-db]".
__STDERR__
file_cmp "${TEST_KEY}-the-same" "${TEST_KEY}-1.out" "${TEST_KEY}-2.out"
#-------------------------------------------------------------------------------
# create valid config
mkdir svn
svnadmin create svn/foo
SVN_URL=file://$PWD/svn/foo
Expand All @@ -39,14 +53,12 @@ local-copy-root=$PWD/roses
prefix-default=foo
prefix-location.foo=$SVN_URL
__ROSE_CONF__
export ROSE_CONF_PATH=$PWD
rosa db-create -q
#-------------------------------------------------------------------------------
rose_ws_init 'rosie' 'disco'
if [[ -z "${TEST_ROSE_WS_PORT}" ]]; then
exit 1
fi

URL_FOO="${TEST_ROSE_WS_URL}/foo/"
URL_FOO_S="${URL_FOO}search?"
URL_FOO_Q="${URL_FOO}query?"
Expand Down
Loading
Loading