diff --git a/docs/fdl.md b/docs/fdl.md index a75ff834..3e19ecaf 100644 --- a/docs/fdl.md +++ b/docs/fdl.md @@ -131,6 +131,12 @@ storage_providers: | `rewrite_target`
*bool* | Target the URI where the traffic is redirected. (default: false). Optional. | | `default_command`
*bool* | Select between executing the container's default command and executing the script inside the container. (default: false). Optional. | +## MountSettings +| Field | Description | +|------------------------------| --------------------------------------------| +| `storage_provider`
*string* | Identifier of the storage provider. Optional. | +| `path`
*string* | Path to the folder that will be mounted. Optional. | + ## Replica | Field | Description | diff --git a/docs/images/mount.png b/docs/images/mount.png index bc635c36..f327b0ab 100644 Binary files a/docs/images/mount.png and b/docs/images/mount.png differ diff --git a/docs/mount.md b/docs/mount.md index 4838ae34..03676d00 100644 --- a/docs/mount.md +++ b/docs/mount.md @@ -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) \ No newline at end of file diff --git a/examples/expose_services/jupyter/jupyter_expose_mount.yaml b/examples/expose_services/jupyter/jupyter_expose_mount.yaml index 60ae7fc8..074c393e 100644 --- a/examples/expose_services/jupyter/jupyter_expose_mount.yaml +++ b/examples/expose_services/jupyter/jupyter_expose_mount.yaml @@ -13,7 +13,7 @@ functions: JUPYTER_DIRECTORY: "/mnt" mount: storage_provider: minio.default - path: /prueba + path: /notebook expose: min_scale: 1 max_scale: 1