Skip to content

Commit 2f8be3f

Browse files
committed
Merge branch 'develop' into release/v2.7.0
2 parents 0c352d8 + 3fa737a commit 2f8be3f

37 files changed

+860
-586
lines changed

CHANGES.rst

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
Changes
1919
=======
2020

21-
`2.7.0 <https://github.com/SwissDataScienceCenter/renku-python/compare/v2.6.1...v2.7.0>`__ (2023-08-09)
21+
`2.7.0 <https://github.com/SwissDataScienceCenter/renku-python/compare/v2.6.2...v2.7.0>`__ (2023-08-09)
2222
-------------------------------------------------------------------------------------------------------
2323

2424
Bug Fixes
@@ -48,6 +48,41 @@ Features
4848
(`#3534 <https://github.com/SwissDataScienceCenter/renku-python/issues/3534>`__)
4949
(`a9994a8 <https://github.com/SwissDataScienceCenter/renku-python/commit/a9994a8cb2541527ca9be731037cc60b03d62cea>`__)
5050

51+
`2.6.2 <https://github.com/SwissDataScienceCenter/renku-python/compare/v2.6.1...v2.6.2>`__ (2023-08-23)
52+
-------------------------------------------------------------------------------------------------------
53+
54+
Bug Fixes
55+
~~~~~~~~~
56+
57+
- **cli:** correct bad plan ID format
58+
(`#3594 <https://github.com/SwissDataScienceCenter/renku-python/issues/3594>`__)
59+
(`c418c17 <https://github.com/SwissDataScienceCenter/renku-python/commit/c418c178d03a5caac126d14cc089064ee13f2747>`__)
60+
- **cli:** fix overwriting dataset tags
61+
(`#3497 <https://github.com/SwissDataScienceCenter/renku-python/issues/3497>`__)
62+
(`ef6d214 <https://github.com/SwissDataScienceCenter/renku-python/commit/ef6d214e165ba877b5acc26427d5663366aaaa29>`__)
63+
- **cli:** parse security_opt as list not tuple so that session launches from the CLI work
64+
(`#3587 <https://github.com/SwissDataScienceCenter/renku-python/issues/3587>`__)
65+
(`d74d35f <https://github.com/SwissDataScienceCenter/renku-python/commit/d74d35ff3428118945a1df1b2f52eebcfcf31132>`__)
66+
- **core:** properly formatted dataset image IDs
67+
(`#3596 <https://github.com/SwissDataScienceCenter/renku-python/issues/3596>`__)
68+
(`f624b2b <https://github.com/SwissDataScienceCenter/renku-python/commit/f624b2bf261d97b07c88243f674f544613753e28>`__)
69+
- **service:** speed up cache.migration_check endpoint
70+
(`#3597 <https://github.com/SwissDataScienceCenter/renku-python/issues/3597>`__)
71+
(`20b5589 <https://github.com/SwissDataScienceCenter/renku-python/commit/20b5589ea2639b4ff017fc390a9b685842c9685d>`__)
72+
- **service:** serialize project versions as integer
73+
(`#3591 <https://github.com/SwissDataScienceCenter/renku-python/issues/3591>`__)
74+
(`5624573 <https://github.com/SwissDataScienceCenter/renku-python/commit/5624573160c2820770093f8752d1975a18e785e6>`__)
75+
76+
`2.6.1 <https://github.com/SwissDataScienceCenter/renku-python/compare/v2.6.1...v2.6.2>`__ (2023-07-13)
77+
-------------------------------------------------------------------------------------------------------
78+
79+
Bug Fixes
80+
~~~~~~~~~
81+
82+
- **service:** fixes issues with the scaling of the core service
83+
(`#3555 <https://github.com/SwissDataScienceCenter/renku-python/pull/3555>`__)
84+
(`4288ada <https://github.com/SwissDataScienceCenter/renku-python/commit/4288ada0b4ec658089b25d12add8a1d16955498a>`__)
85+
5186
`2.6.0 <https://github.com/SwissDataScienceCenter/renku-python/compare/v2.5.0...v2.6.0>`__ (2023-06-20)
5287
-------------------------------------------------------------------------------------------------------
5388

poetry.lock

Lines changed: 561 additions & 496 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ psutil = ">=5.4.7,<5.9.2"
8383
pydantic = "==1.10.7"
8484
pyjwt = ">=2.1.0,<2.5.0"
8585
pyld = "==2.0.3"
86-
pyshacl = ">=0.17.2,<0.19.2"
86+
pyshacl = ">=0.20.0,<0.24.0"
8787
python-dateutil = "<2.8.3,>=2.6.1"
8888
python-gitlab = ">=2.10.1,<3.8.2"
8989
pyyaml = "<6.1.0,>=5.4"
@@ -149,7 +149,7 @@ pytest-flake8 = ">=1.0.6,<1.1.2"
149149
pytest-lazy-fixture = ">=0.6.3,<0.7.0"
150150
pytest-mock = ">=3.2.0,<3.11.0"
151151
pytest-pep8 = "==1.0.6"
152-
pytest-recording = "==0.12.2"
152+
pytest-recording = "==0.13.0"
153153
pytest-timeout = "==2.1.0"
154154
pytest-xdist = ">=1.34.0,<3.4.0"
155155
responses = ">=0.22.0,<0.24.0"
@@ -342,5 +342,5 @@ exclude = ["docs"]
342342

343343

344344
[build-system]
345-
requires = ["poetry-core>=1.3.0<1.7.0", "poetry-dynamic-versioning==0.21.5", "gitpython==3.1.24"]
345+
requires = ["poetry-core>=1.3.0,<1.7.0", "poetry-dynamic-versioning==0.21.5", "gitpython==3.1.24"]
346346
build-backend = "poetry_dynamic_versioning.backend"

renku/command/checks/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from .project import check_project_id_group
2929
from .storage import check_lfs_info
3030
from .validate_shacl import check_datasets_structure, check_project_structure
31-
from .workflow import check_activity_catalog, check_plan_modification_date
31+
from .workflow import check_activity_catalog, check_plan_id, check_plan_modification_date
3232

3333
# Checks will be executed in the order as they are listed in __all__. They are mostly used in ``doctor`` command to
3434
# inspect broken things. The order of operations matters when fixing issues, so, don't sort this list.
@@ -47,5 +47,6 @@
4747
"check_project_id_group",
4848
"check_project_structure",
4949
"check_plan_modification_date",
50+
"check_plan_id",
5051
"check_activity_dates",
5152
)

renku/command/checks/workflow.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,44 @@ def fix_plan_dates(plans: List[AbstractPlan], plan_gateway):
127127
if plan.date_removed and plan.date_removed < plan.date_created:
128128
plan.date_removed = plan.date_created + timedelta(seconds=1)
129129
plan.freeze()
130+
131+
132+
@inject.autoparams("plan_gateway")
133+
def check_plan_id(fix, plan_gateway: IPlanGateway, **_) -> Tuple[bool, bool, Optional[str]]:
134+
"""Check if all plans have correct IDs.
135+
136+
Args:
137+
fix(bool): Whether to fix found issues.
138+
plan_gateway(IPlanGateway): Injected PlanGateway.
139+
_: keyword arguments.
140+
141+
Returns:
142+
Tuple[bool, Optional[str]]: Tuple of whether there are plans with invalid IDs, if an automated fix is
143+
available and a string of their IDs
144+
"""
145+
plans: List[AbstractPlan] = plan_gateway.get_all_plans()
146+
147+
to_be_processed = []
148+
for plan in plans:
149+
if isinstance(plan.id, str) and plan.id.startswith("/plans//plans"):
150+
to_be_processed.append(plan)
151+
152+
if not to_be_processed:
153+
return True, False, None
154+
if not fix:
155+
ids = [plan.id for plan in to_be_processed]
156+
message = (
157+
WARNING
158+
+ "The following workflows have incorrect IDs (use 'renku doctor --fix' to fix them):\n\t"
159+
+ "\n\t".join(ids)
160+
)
161+
return False, True, message
162+
163+
for plan in to_be_processed:
164+
plan.unfreeze()
165+
plan.id = plan.id.replace("//plans/", "/")
166+
plan.freeze()
167+
project_context.database.commit()
168+
communication.info("Workflow IDs were fixed")
169+
170+
return True, False, None

renku/command/config.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,10 @@ def _update_config(
9595
"""
9696
section, section_key = _split_section_and_key(key)
9797
if remove:
98-
value = remove_value(section, section_key, global_only=global_only)
99-
if value is None:
100-
raise errors.ParameterError(f'Key "{key}" not found.')
98+
remove_value(section, section_key, global_only=global_only)
10199
else:
102100
set_value(section, section_key, value, global_only=global_only)
103-
return value
101+
return value
104102

105103

106104
def update_config():

renku/command/session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def search_session_providers_command():
3939

4040
def session_list_command():
4141
"""List all the running interactive sessions."""
42-
return Command().command(session_list)
42+
return Command().command(session_list).with_database(write=False)
4343

4444

4545
def session_start_command():

renku/core/migration/models/v9.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,11 +1390,6 @@ def full_path(self):
13901390
path = project_context.path / self.path
13911391
return Path(os.path.abspath(path))
13921392

1393-
@property
1394-
def filesize(self):
1395-
"""Return file size."""
1396-
return None if self.filesize is None else self.filesize
1397-
13981393
def __attrs_post_init__(self):
13991394
"""Set the property "name" after initialization."""
14001395
super().__attrs_post_init__()

renku/core/session/renkulab.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,6 @@ def session_list(self, project_name: str, ssh_garbage_collection: bool = True) -
299299
params=self._get_renku_project_name_parts(),
300300
)
301301
if sessions_res.status_code == 200:
302-
system_config = SystemSSHConfig()
303-
name = self._project_name_from_full_project_name(project_name)
304302
sessions = [
305303
Session(
306304
id=session["name"],
@@ -310,7 +308,8 @@ def session_list(self, project_name: str, ssh_garbage_collection: bool = True) -
310308
commit=session.get("annotations", {}).get("renku.io/commit-sha"),
311309
branch=session.get("annotations", {}).get("renku.io/branch"),
312310
provider="renkulab",
313-
ssh_enabled=system_config.session_config_path(name, session["name"]).exists(),
311+
ssh_enabled=get_value("renku", "ssh_supported") == "true"
312+
or project_context.project.template_metadata.ssh_supported,
314313
)
315314
for session in sessions_res.json().get("servers", {}).values()
316315
]

renku/core/session/session.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ def session_start(
142142
"""
143143
from renku.domain_model.project_context import project_context
144144

145+
# NOTE: The Docker client in Python requires the parameters below to be a list and will fail with a tuple.
146+
# Click will convert parameters with the flag "many" set to True to tuples.
147+
kwargs["security_opt"] = list(kwargs.get("security_opt", []))
148+
kwargs["device_cgroup_rules"] = list(kwargs.get("device_cgroup_rules", []))
149+
145150
pinned_image = get_value("interactive", "image")
146151
if pinned_image and image_name is None:
147152
image_name = pinned_image
@@ -348,3 +353,8 @@ def ssh_setup(existing_key: Optional[Path] = None, force: bool = False):
348353
"""
349354
)
350355
f.write(content)
356+
357+
communication.warn(
358+
"This command does not add any public SSH keys to your project. "
359+
"Keys have to be added manually or by using the 'renku session start' command with the '--ssh' flag."
360+
)

0 commit comments

Comments
 (0)