Skip to content

Commit 50d1a5f

Browse files
chore: release v2.8.2 (#3684)
* chore(service): return cli version in core svc (#3655) * fix(cli): use lower case image names for sessions in upper-case projects (#3666) * fix(service): add proper error if a dataset can't be found (#3661) * fix: prevent distutils warning (#3663) * fix(service): allow editing datasets without creator email (#3664) * fix(cli): output proper session link and only check registry if logged in (#3660) * fix(service): allow setting keywords on project creation (#3665) * chore: combined dependency update (#3672) bump dependencies, fix gitpython security advisory * feat(service): date_published in datasets.list response (#3648) * fix(service): fix clone depth not being respected (#3678) * chore: release v2.8.2
1 parent 2502aaf commit 50d1a5f

File tree

26 files changed

+843
-762
lines changed

26 files changed

+843
-762
lines changed

.github/actions/install-linux/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ inputs:
44
python-version:
55
description: "Python version to install"
66
required: false
7-
default: "3.9"
7+
default: "3.10"
88
runs:
99
using: "composite"
1010
steps:
11-
- uses: actions/checkout@v3.5.0
11+
- uses: actions/checkout@v3.6.0
1212
with:
1313
fetch-depth: 0
1414
- name: Checkout repository

.github/actions/install-macos/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ inputs:
44
python-version:
55
description: "Python version to install"
66
required: false
7-
default: "3.9"
7+
default: "3.10"
88
runs:
99
using: "composite"
1010
steps:
11-
- uses: actions/checkout@v3.5.0
11+
- uses: actions/checkout@v3.6.0
1212
with:
1313
fetch-depth: 0
1414
- name: Checkout repository

CHANGES.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,43 @@
1818
Changes
1919
=======
2020

21+
`2.8.2 <https://github.com/SwissDataScienceCenter/renku-python/compare/v2.8.1...v2.8.2>`__ (2024-01-15)
22+
-------------------------------------------------------------------------------------------------------
23+
24+
Bug Fixes
25+
~~~~~~~~~
26+
27+
- **cli:** output proper session link and only check registry if logged
28+
in
29+
(`#3660 <https://github.com/SwissDataScienceCenter/renku-python/issues/3660>`__)
30+
(`12469f9 <https://github.com/SwissDataScienceCenter/renku-python/commit/12469f913d4a80662c2b7e2fe2e3f9f594900078>`__)
31+
- **cli:** use lower case image names for sessions in upper-case
32+
projects
33+
(`#3666 <https://github.com/SwissDataScienceCenter/renku-python/issues/3666>`__)
34+
(`ec1e282 <https://github.com/SwissDataScienceCenter/renku-python/commit/ec1e2824e6604cd82e677fdfb5e70d3491b7df68>`__)
35+
- prevent distutils warning
36+
(`#3663 <https://github.com/SwissDataScienceCenter/renku-python/issues/3663>`__)
37+
(`5954aac <https://github.com/SwissDataScienceCenter/renku-python/commit/5954aacac6ab724a14458957ccc6e64137632592>`__)
38+
- **service:** add proper error if a dataset can’t be found
39+
(`#3661 <https://github.com/SwissDataScienceCenter/renku-python/issues/3661>`__)
40+
(`8afaedd <https://github.com/SwissDataScienceCenter/renku-python/commit/8afaedddba248a34a0bb175189f04cf1119034e6>`__)
41+
- **service:** allow editing datasets without creator email
42+
(`#3664 <https://github.com/SwissDataScienceCenter/renku-python/issues/3664>`__)
43+
(`d74cc72 <https://github.com/SwissDataScienceCenter/renku-python/commit/d74cc72467ce10d9330e4080aa3540697e6a2869>`__)
44+
- **service:** allow setting keywords on project creation
45+
(`#3665 <https://github.com/SwissDataScienceCenter/renku-python/issues/3665>`__)
46+
(`9377ac4 <https://github.com/SwissDataScienceCenter/renku-python/commit/9377ac4ab55f778c4ef1b505f4baeb0bc2378ebd>`__)
47+
- **service:** fix clone depth not being respected
48+
(`#3678 <https://github.com/SwissDataScienceCenter/renku-python/issues/3678>`__)
49+
(`0c523fa <https://github.com/SwissDataScienceCenter/renku-python/commit/0c523facd2647e04285430b4a5fc64c912df1b1f>`__)
50+
51+
Features
52+
~~~~~~~~
53+
54+
- **service:** date_published in datasets.list response
55+
(`#3648 <https://github.com/SwissDataScienceCenter/renku-python/issues/3648>`__)
56+
(`a7f4a22 <https://github.com/SwissDataScienceCenter/renku-python/commit/a7f4a224a1cc2108c3b091b751187bf03ebb83e4>`__)
57+
2158
`2.8.1 <https://github.com/SwissDataScienceCenter/renku-python/compare/v2.8.0...v2.8.1>`__ (2023-12-18)
2259
-------------------------------------------------------------------------------------------------------
2360

helm-chart/renku-core/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ appVersion: "1.0"
33
description: A Helm chart for Kubernetes
44
name: renku-core
55
icon: https://avatars0.githubusercontent.com/u/53332360?s=400&u=a4311d22842343604ef61a8c8a1e5793209a67e9&v=4
6-
version: 2.8.1
6+
version: 2.8.2

helm-chart/renku-core/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ global:
88
versions:
99
latest:
1010
image:
11-
tag: v2.8.1
11+
tag: v2.8.2

poetry.lock

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

pyproject.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ deal = "~4.24.3"
6464
deepdiff = "~6.7.1"
6565
deepmerge = "~1.1.0"
6666
docker = "^5.0.3"
67-
gitpython = "~3.1.40"
67+
gitpython = "~3.1.41"
6868
grandalf = "^0.8"
6969
humanize = "~4.9.0"
7070
importlib-resources = "~5.12.0"
@@ -112,7 +112,7 @@ pillow = { version = "^10.1.0", optional = true }
112112
python-dotenv = { version = "^0.20", optional = true }
113113
redis = { version = "~5.0.1", optional = true }
114114
rq = { version = "~1.15.1", optional = true }
115-
sentry-sdk = { version = "~1.38.0", extras = ["flask"], optional = true }
115+
sentry-sdk = { version = "~1.39.0", extras = ["flask"], optional = true }
116116
walrus = { version = "^0.9", optional = true }
117117
prometheus-flask-exporter = "^0.23"
118118
filetype = "^1.2.0"
@@ -163,7 +163,7 @@ plantweb = ">=1.2.1,<1.3.0"
163163
renku-sphinx-theme = "^0.4"
164164
sphinx-click = "^4.3.0"
165165
sphinx-rtd-theme = "~1.3"
166-
sphinx-tabs = "==3.4.1"
166+
sphinx-tabs = "==3.4.4"
167167
sphinxcontrib-spelling = ">=7,<9"
168168

169169
[tool.poetry.extras]
@@ -314,6 +314,7 @@ module = [
314314
"ruamel",
315315
"rq",
316316
"shellingham",
317+
"setuptools",
317318
"toil.*",
318319
"tqdm",
319320
"urllib3.*",
@@ -346,5 +347,5 @@ exclude = ["docs"]
346347

347348

348349
[build-system]
349-
requires = ["poetry-core>=1.3.0,<1.7.0", "poetry-dynamic-versioning==0.21.5", "gitpython==3.1.24"]
350+
requires = ["poetry-core>=1.3.0,<1.7.0", "poetry-dynamic-versioning==0.21.5", "gitpython==3.1.41"]
350351
build-backend = "poetry_dynamic_versioning.backend"

renku/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323

2424
from renku.version import __template_version__, __version__
2525

26+
# distutils is deprecated and fully replaced by setuptools. we don't depend on either, but some of our
27+
# dependencies do and if distutils gets imported before setuptools, we get an annoying warning.
28+
# By forcing the import here first, we prevent that warning and ensure the setuptools version is used.
29+
try:
30+
import setuptools # noqa: F401 # type: ignore
31+
except ImportError:
32+
pass
33+
2634

2735
class LoaderWrapper(importlib.abc.Loader):
2836
"""Wrap an importlib loader and add the loaded module to sys.modules with an additional name."""

renku/core/session/docker.py

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import webbrowser
2121
from datetime import datetime
2222
from pathlib import Path
23-
from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Tuple, Union, cast
23+
from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional, Tuple, Union, cast
2424
from uuid import uuid4
2525

2626
import docker
@@ -29,8 +29,11 @@
2929
from renku.core import errors
3030
from renku.core.config import get_value
3131
from renku.core.constant import ProviderPriority
32+
from renku.core.login import read_renku_token
3233
from renku.core.plugin import hookimpl
34+
from renku.core.session.utils import get_renku_url
3335
from renku.core.util import communication
36+
from renku.core.util.jwt import is_token_expired
3437
from renku.domain_model.project_context import project_context
3538
from renku.domain_model.session import ISessionProvider, Session, SessionStopStatus
3639

@@ -67,11 +70,14 @@ def docker_client(self) -> docker.client.DockerClient:
6770
return self._docker_client
6871

6972
@staticmethod
70-
def _get_jupyter_urls(ports: Dict[str, Any], auth_token: str, jupyter_port: int = 8888) -> Iterable[str]:
73+
def _get_jupyter_urls(ports: Dict[str, Any], auth_token: str, jupyter_port: int = 8888) -> Iterator[str]:
7174
port_key = f"{jupyter_port}/tcp"
7275
if port_key not in ports:
73-
return list()
74-
return map(lambda x: f"http://{x['HostIp']}:{x['HostPort']}/?token={auth_token}", ports[port_key])
76+
return list() # type: ignore
77+
default_url = get_value("interactive", "default_url")
78+
if not default_url:
79+
default_url = "/lab"
80+
return map(lambda x: f"http://{x['HostIp']}:{x['HostPort']}{default_url}?token={auth_token}", ports[port_key])
7581

7682
def _get_docker_containers(self, project_name: str) -> List[docker.models.containers.Container]:
7783
return self.docker_client().containers.list(filters={"label": f"renku_project={project_name}"})
@@ -92,9 +98,22 @@ def build_image(self, image_descriptor: Path, image_name: str, config: Optional[
9298
def find_image(self, image_name: str, config: Optional[Dict[str, Any]]) -> bool:
9399
"""Find the given container image."""
94100
with communication.busy(msg=f"Checking for image {image_name}"):
101+
renku_url = get_renku_url()
102+
103+
# only search remote image if a user is logged in
104+
find_remote = True
105+
if renku_url is None:
106+
find_remote = False
107+
else:
108+
token = read_renku_token(endpoint=renku_url)
109+
if not token or is_token_expired(token):
110+
find_remote = False
111+
95112
try:
96113
self.docker_client().images.get(image_name)
97114
except docker.errors.ImageNotFound:
115+
if not find_remote:
116+
return False
98117
try:
99118
self.docker_client().images.get_registry_data(image_name)
100119
except docker.errors.APIError:
@@ -454,13 +473,23 @@ def session_open(self, project_name: str, session_name: Optional[str], **kwargs)
454473
def session_url(self, session_name: Optional[str]) -> Optional[str]:
455474
"""Get the URL of the interactive session."""
456475
sessions = self.docker_client().containers.list()
476+
default_url = get_value("interactive", "default_url")
477+
if not default_url:
478+
default_url = "/lab"
457479

458480
for c in sessions:
459481
if (
460482
c.short_id == session_name or (not session_name and len(sessions) == 1)
461483
) and f"{DockerSessionProvider.JUPYTER_PORT}/tcp" in c.ports:
462-
host = c.ports[f"{DockerSessionProvider.JUPYTER_PORT}/tcp"][0]
463-
return f'http://{host["HostIp"]}:{host["HostPort"]}/?token={c.labels["jupyter_token"]}'
484+
url = next(
485+
DockerSessionProvider._get_jupyter_urls(
486+
c.ports, c.labels["jupyter_token"], DockerSessionProvider.JUPYTER_PORT
487+
),
488+
None,
489+
)
490+
if not url:
491+
continue
492+
return url
464493
return None
465494

466495
def force_build_image(self, force_build: bool = False, **kwargs) -> bool:

renku/core/session/session.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,11 @@ def session_start(
179179
if image_name is None:
180180
tag = project_context.repository.head.commit.hexsha[:7]
181181
repo_host = get_image_repository_host()
182-
image_name = f"{project_name}:{tag}"
182+
image_name = f"{project_name.lower()}:{tag}"
183183
if repo_host:
184184
image_name = f"{repo_host}/{image_name}"
185+
if image_name.lower() != image_name:
186+
raise errors.SessionStartError(f"Image name '{image_name}' cannot contain upper-case letters.")
185187

186188
force_build_image = provider_api.force_build_image(**kwargs)
187189

0 commit comments

Comments
 (0)