Skip to content

Commit

Permalink
Merge pull request #249 from grycap/change-doc
Browse files Browse the repository at this point in the history
Improved mount docs
  • Loading branch information
catttam authored Jul 31, 2024
2 parents 7553373 + bd31422 commit da6f21b
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 11 deletions.
6 changes: 6 additions & 0 deletions docs/fdl.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ storage_providers:
| `rewrite_target` </br> *bool* | Target the URI where the traffic is redirected. (default: false). Optional. |
| `default_command` </br> *bool* | Select between executing the container's default command and executing the script inside the container. (default: false). Optional. |

## MountSettings
| Field | Description |
|------------------------------| --------------------------------------------|
| `storage_provider` </br> *string* | Identifier of the storage provider. Optional. |
| `path` </br> *string* | Path to the folder that will be mounted. Optional. |

## Replica

| Field | Description |
Expand Down
Binary file modified docs/images/mount.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 36 additions & 10 deletions docs/mount.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,46 @@
# Mounting external storage on service volumes

This feature enables the mounting of a folder from a storage provider, such as MinIO or dCache, into the service container. As illustrated in the following diagram, the folder is placed inside the /mnt directory on the container volume, thereby making it accessible to the service. This functionality can be utilized with exposed services, such as those using a Jupyter Notebook, to make the content of the storage bucket accessible directly within the Notebook.
This feature enables the mounting of a folder from a storage provider, such as MinIO or dCache, into the service container. As illustrated in the following diagram, the folder is placed inside the /mnt directory on the container volume, thereby making it accessible to the service.

![mount-diagram](images/mount.png)

As OSCAR has the credentials of the default MinIO instance internally, if you want to use a different one or a different storage provider, you need to set these credentials on the service [FDL](/fdl). Currently, the storage providers supported on this functionality are:

- [MinIO provider](/fdl/#minioprovider)
- [WebDav provider](/fdl/#webdavprovider)
This functionality can be useful with exposed services, such as those using a Jupyter Notebook, to make the content of the storage bucket accessible directly within the Notebook. For instance, if you have a MinIO bucket called `notebook` you want to access, you would need to add the following parameters to the service definition:

Let's explore these with an FDL example:

```
``` yaml
mount:
storage_provider: minio.default
path: /body-pose-detection-async
path: /notebook
```
The example above means that OSCAR mounts the `body-pose-detection-async` bucket of the default MinIO inside the OSCAR services. So, the content of the `body-pose-detection-async` bucket will be found in `/mnt/body-pose-detection-async` folder inside the execution of OSCAR services.
The complete definition of this use case that integrates the expose of a Jupyter Notebook with the access to a mounted bucket would look like the following:
``` yaml
functions:
oscar:
- oscar-cluster:
name: jupyter
memory: 2Gi
cpu: '1.0'
image: jupyter/base-notebook
script: jupyterscript2.sh
environment:
Variables:
JUPYTER_TOKEN: "root"
JHUB_BASE_URL: "/system/services/jupyter/exposed"
JUPYTER_DIRECTORY: "/mnt"
mount:
storage_provider: minio.default
path: /notebook
expose:
min_scale: 1
max_scale: 1
api_port: 8888
cpu_threshold: 90
rewrite_target: true
```
**Note**: You can find the files of this example on [OSCAR's repository examples](https://github.com/grycap/oscar/tree/master/examples/expose_services/jupyter)
As OSCAR has the credentials of the default MinIO instance internally, if you want to use a different one or a different storage provider, you need to set these credentials on the service [FDL](/fdl). Currently, the storage providers supported on this functionality are:
- [MinIO provider](/fdl/#minioprovider)
- [WebDav provider](/fdl/#webdavprovider)
2 changes: 1 addition & 1 deletion examples/expose_services/jupyter/jupyter_expose_mount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ functions:
JUPYTER_DIRECTORY: "/mnt"
mount:
storage_provider: minio.default
path: /prueba
path: /notebook
expose:
min_scale: 1
max_scale: 1
Expand Down

0 comments on commit da6f21b

Please sign in to comment.