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
12 changes: 10 additions & 2 deletions bases/renku_data_services/data_api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from renku_data_services.search.reprovision import SearchReprovision
from renku_data_services.search.solr_user_query import UsernameResolve
from renku_data_services.session.blueprints import BuildsBP, EnvironmentsBP, SessionLaunchersBP
from renku_data_services.storage.blueprints import StorageSchemaBP
from renku_data_services.storage.blueprints import ProjectStorageBP, StorageSchemaBP
from renku_data_services.users.blueprints import KCUsersBP, UserPreferencesBP, UserSecretsBP


Expand Down Expand Up @@ -222,6 +222,7 @@ def register_all_handlers(app: Sanic, dm: DependencyManager) -> Sanic:
oauth_client_factory=dm.oauth_http_client_factory,
project_repo=dm.project_repo,
project_session_secret_repo=dm.project_session_secret_repo,
project_storage_repo=dm.project_storage_repo,
rp_repo=dm.rp_repo,
session_repo=dm.session_repo,
user_repo=dm.kc_user_repo,
Expand Down Expand Up @@ -280,7 +281,6 @@ def register_all_handlers(app: Sanic, dm: DependencyManager) -> Sanic:
data_service_base_url=dm.config.nb_config.data_service_url,
k8s_client=dm.k8s_client,
deposit_config=dm.config.deposit_config,
project_storage_k8s=dm.project_storage_k8s,
)
notifications = NotificationsBP(
name="notifications",
Expand Down Expand Up @@ -311,6 +311,13 @@ def register_all_handlers(app: Sanic, dm: DependencyManager) -> Sanic:
internal_token_mint=dm.internal_token_mint,
internal_scope_verifier=dm.internal_scope_verifier,
)
project_storage = ProjectStorageBP(
name="project_storage",
url_prefix=url_prefix,
project_storage_k8s=dm.project_storage_k8s,
project_storage_repo=dm.project_storage_repo,
authenticator=dm.authenticator,
)
app.blueprint(
[
resource_pools.blueprint(),
Expand Down Expand Up @@ -342,6 +349,7 @@ def register_all_handlers(app: Sanic, dm: DependencyManager) -> Sanic:
capacity_reservation.blueprint(),
resource_usage.blueprint(),
internal_authentication.blueprint(),
project_storage.blueprint(),
]
)
if builds is not None:
Expand Down
3 changes: 2 additions & 1 deletion bases/renku_data_services/data_api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
)
from renku_data_services.app_config.logging import Config as LoggingConfig
from renku_data_services.authz.config import AuthzConfig
from renku_data_services.data_connectors.config import DepositConfig, ProjectStorageConfig
from renku_data_services.data_connectors.config import DepositConfig
from renku_data_services.db_config.config import DBConfig
from renku_data_services.notebooks.config import NotebooksConfig
from renku_data_services.secrets.config import PublicSecretsConfig
from renku_data_services.session.config import BuildsConfig
from renku_data_services.solr.solr_client import SolrClientConfig
from renku_data_services.storage.config import ProjectStorageConfig
from renku_data_services.users.config import UserPreferencesConfig


Expand Down
13 changes: 11 additions & 2 deletions bases/renku_data_services/data_api/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
)
from renku_data_services.data_connectors.deposits.envidat import EnvidatClient
from renku_data_services.data_connectors.deposits.zenodo import ZenodoAPIClient
from renku_data_services.data_connectors.project_storage_k8s import ProjectStorageK8s
from renku_data_services.git.gitlab import DummyGitlabAPI, EmptyGitlabAPI, GitlabAPI
from renku_data_services.k8s.client_interfaces import K8sClient
from renku_data_services.k8s.clients import (
Expand Down Expand Up @@ -79,6 +78,8 @@
from renku_data_services.session.constants import BUILD_RUN_GVK, TASK_RUN_GVK
from renku_data_services.session.db import SessionRepository
from renku_data_services.session.k8s_client import ShipwrightClient
from renku_data_services.storage.db import ProjectStorageRepository
from renku_data_services.storage.project_storage_k8s import ProjectStorageK8s
from renku_data_services.users.db import UserPreferencesRepository
from renku_data_services.users.db import UserRepo as KcUserRepo
from renku_data_services.users.dummy_kc_api import DummyKeycloakAPI
Expand Down Expand Up @@ -177,6 +178,7 @@ class DependencyManager:
internal_token_mint: RenkuSelfTokenMint
internal_scope_verifier: ScopeVerifier
project_storage_k8s: ProjectStorageK8s
project_storage_repo: ProjectStorageRepository

spec: dict[str, Any] = field(init=False, repr=False, default_factory=dict)
app_name: str = "renku_data_services"
Expand Down Expand Up @@ -367,6 +369,13 @@ def from_env(cls) -> DependencyManager:
member_repo=member_repo,
)
project_storage_k8s = ProjectStorageK8s(config.nb_config.k8s_v2_client)
project_storage_repo = ProjectStorageRepository(
session_maker=config.db.async_session_maker,
authz=authz,
project_repo=project_repo,
group_repo=group_repo,
project_storage_config=config.project_storage_config,
)
reprovisioning_repo = ReprovisioningRepository(session_maker=config.db.async_session_maker)

git_repositories_repo = GitRepositoriesRepository(
Expand Down Expand Up @@ -423,7 +432,6 @@ def from_env(cls) -> DependencyManager:
project_repo=project_repo,
group_repo=group_repo,
search_updates_repo=search_updates_repo,
project_storage_config=config.project_storage_config,
)
data_connector_secret_repo = DataConnectorSecretRepository(
session_maker=config.db.async_session_maker,
Expand Down Expand Up @@ -518,4 +526,5 @@ def from_env(cls) -> DependencyManager:
internal_token_mint=internal_token_mint,
internal_scope_verifier=internal_scope_verifier,
project_storage_k8s=project_storage_k8s,
project_storage_repo=project_storage_repo,
)
240 changes: 0 additions & 240 deletions components/renku_data_services/data_connectors/api.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,226 +70,6 @@ paths:
$ref: "#/components/responses/Error"
tags:
- data_connectors
/data_connectors/storage:
post:
summary: Create a new project storage
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ProjectStoragePost"
responses:
"201":
description: The data connector was created
content:
application/json:
schema:
$ref: "#/components/schemas/ProjectStorage"
default:
$ref: "#/components/responses/Error"
tags:
- data_connectors
/data_connectors/storage/config:
get:
summary: Get the current configuration for project storage
responses:
"200":
description: The configuration data
content:
application/json:
schema:
$ref: "#/components/schemas/ProjectStorageConfig"
default:
$ref: "#/components/responses/Error"
tags:
- data_connectors
/data_connectors/storage/allow:
get:
summary: List all projects in the storage allow list
parameters:
- in: query
description: query parameters
name: params
style: form
explode: true
schema:
$ref: "#/components/schemas/ProjectStorageAllowListQuery"
responses:
"200":
description: List of storage allow entries
content:
application/json:
schema:
$ref: "#/components/schemas/ProjectStorageAllowList"
headers:
page:
description: The index of the current page (starting at 1).
required: true
schema:
type: integer
per-page:
description: The number of items per page.
required: true
schema:
type: integer
total:
description: The total number of items.
required: true
schema:
type: integer
total-pages:
description: The total number of pages.
required: true
schema:
type: integer
default:
$ref: "#/components/responses/Error"
tags:
- data_connectors
post:
summary: Add a project to the storage allow list
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ProjectStorageAllowPost"
responses:
"201":
description: The project was added to the allow list
content:
application/json:
schema:
$ref: "#/components/schemas/ProjectStorageAllowPost"
default:
$ref: "#/components/responses/Error"
tags:
- data_connectors
/data_connectors/storage/allow/{project_id}:
parameters:
- in: path
name: project_id
required: true
schema:
$ref: "#/components/schemas/Ulid"
get:
summary: Get the storage allow entry for a project
responses:
"200":
description: The project storage allow entry
content:
application/json:
schema:
$ref: "#/components/schemas/ProjectStorageAllow"
"404":
description: The project is not in the storage allow list
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
default:
$ref: "#/components/responses/Error"
tags:
- data_connectors
patch:
summary: Change the maximum size for a project storage
parameters:
- $ref: "#/components/parameters/If-Match"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ProjectStorageAllowPatch"
responses:
"200":
description: The patched project storage allow entry
content:
application/json:
schema:
$ref: "#/components/schemas/ProjectStorageAllow"
"404":
description: The project storage allow entry doesn't exist
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
default:
$ref: "#/components/responses/Error"
tags:
- data_connectors
delete:
summary: Remove a project from the storage allow list
responses:
"204":
description: The project was removed from the allow list
default:
$ref: "#/components/responses/Error"
tags:
- data_connectors
/data_connectors/storage/{storage_id}:
parameters:
- in: path
name: storage_id
required: true
schema:
$ref: "#/components/schemas/Ulid"
get:
summary: Get a project storage for a project id.
responses:
"200":
description: The project storage information
content:
application/json:
schema:
$ref: "#/components/schemas/ProjectStorage"
"404":
description: The project storage does not exist
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
default:
$ref: "#/components/responses/Error"
tags:
- data_connectors
patch:
summary: Change the size or mount path of a project storage
parameters:
- $ref: "#/components/parameters/If-Match"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ProjectStoragePatch"
responses:
"200":
description: The patched project storage entry
content:
application/json:
schema:
$ref: "#/components/schemas/ProjectStorage"
"404":
description: The project storage does not exist
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
default:
$ref: "#/components/responses/Error"
tags:
- data_connectors
delete:
summary: Delete a specific project storage
responses:
"204":
description: The project storage was deleted or did not exist in the first place
default:
$ref: "#/components/responses/Error"
tags:
- data_connectors
/data_connectors/global:
post:
summary: Create a new data connector
Expand Down Expand Up @@ -702,26 +482,6 @@ paths:
$ref: "#/components/responses/Error"
tags:
- data_connectors
/projects/{project_id}/storage:
parameters:
- in: path
name: project_id
required: true
schema:
$ref: "#/components/schemas/Ulid"
get:
summary: Get the project storage for a given project
responses:
"200":
description: The list of project storages (currently either one or empty).
content:
application/json:
schema:
$ref: "#/components/schemas/ProjectStorageList"
default:
$ref: "#/components/responses/Error"
tags:
- projects
/projects/{project_id}/data_connector_links:
parameters:
- in: path
Expand Down
6 changes: 1 addition & 5 deletions components/renku_data_services/data_connectors/apispec.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: api.spec.yaml
# timestamp: 2026-07-30T10:50:42+00:00
# timestamp: 2026-07-30T15:37:24+00:00

from __future__ import annotations

Expand Down Expand Up @@ -563,10 +563,6 @@ class DataConnectorsGetParametersQuery(BaseAPISpec):
params: DataConnectorsGetQuery | None = None


class DataConnectorsStorageAllowGetParametersQuery(BaseAPISpec):
params: ProjectStorageAllowListQuery | None = None


class DataConnectorLinksGetParametersQuery(BaseAPISpec):
params: DataConnectorLinksGetQuery | None = None

Expand Down
Loading
Loading