Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mount cloud storage in the storage mount dir #559

Merged
merged 5 commits into from
Dec 2, 2024
Merged
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
5 changes: 5 additions & 0 deletions .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ jobs:
url: https://renku-ci-ds-${{ github.event.number }}.dev.renku.ch
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.RENKU_DOCKER_USERNAME }}
password: ${{ secrets.RENKU_DOCKER_PASSWORD }}
- name: Find deplyoment url
uses: peter-evans/find-comment@v3
id: deploymentUrlMessage
Expand Down
13 changes: 6 additions & 7 deletions components/renku_data_services/notebooks/blueprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,15 @@ async def _handler(
# TODO: Add types for saved and unsaved resource class
resource_class_id = cast(int, resource_class.id)
else:
resource_class = await self.rp_repo.get_resource_class(user, resource_class_id)
resource_class = await self.rp_repo.get_resource_class(user, body.resource_class_id)
# TODO: Add types for saved and unsaved resource class
resource_class_id = cast(int, resource_class.id)
resource_class_id = body.resource_class_id
quota = resource_class.quota
await self.nb_config.crc_validator.validate_class_storage(user, resource_class_id, body.disk_storage)
work_dir_fallback = PurePosixPath("/home/jovyan")
work_dir = environment.working_directory or image_workdir or work_dir_fallback
storage_mount_fallback = work_dir / "work"
storage_mount = launcher.environment.mount_directory or storage_mount_fallback
# TODO: Wait for pitch on users secrets to implement this
# user_secrets: K8sUserSecrets | None = None
# if body.user_secrets:
Expand Down Expand Up @@ -344,7 +345,7 @@ async def _handler(
quiet=True,
)
if csr.target_path is not None and not PurePosixPath(csr.target_path).is_absolute():
csr.target_path = (work_dir / csr.target_path).as_posix()
csr.target_path = (storage_mount / csr.target_path).as_posix()
dcs[csr_id] = dcs[csr_id].with_override(csr)
git_providers = await self.nb_config.git_provider_helper.get_providers(user=user)
repositories: list[Repository] = []
Expand Down Expand Up @@ -405,7 +406,7 @@ async def _handler(
config=self.nb_config,
repositories=repositories,
git_providers=git_providers,
workspace_mount_path=launcher.environment.mount_directory or storage_mount_fallback,
workspace_mount_path=storage_mount,
work_dir=work_dir,
)
if git_clone is not None:
Expand Down Expand Up @@ -464,9 +465,7 @@ async def _handler(
storage=Storage(
className=self.nb_config.sessions.storage.pvs_storage_class,
size=str(body.disk_storage) + "G",
mountPath=environment.mount_directory.as_posix()
if environment.mount_directory
else storage_mount_fallback.as_posix(),
mountPath=storage_mount.as_posix(),
),
workingDir=work_dir.as_posix(),
runAsUser=environment.uid,
Expand Down
Loading