Skip to content

Commit 37c7ddf

Browse files
committed
Added docs for mounting file systems for job.
1 parent b835edb commit 37c7ddf

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed

docs/source/user_guide/jobs/infra_and_runtime.rst

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,61 @@ see also `ADS Logging <../logging/logging.html>`_.
152152

153153
With logging configured, you can call :py:meth:`~ads.jobs.DataScienceJobRun.watch` method to stream the logs.
154154

155+
156+
Mounting File Systems
157+
---------------------
158+
159+
Data Science Job supports mounting multiple types of file systems,
160+
see `Data Science Job Mounting File Systems <place_holder>`_. A maximum number of 5 file systems are
161+
allowed to be mounted for each Data Science Job. You can specify a list of file systems to be mounted
162+
by calling :py:meth:`~ads.jobs.DataScienceJob.with_storage_mount()`. For each file system to be mounted,
163+
you need to pass a dictionary with ``src`` and ``dest`` as keys. For example, you can pass
164+
``<mount_target_ip_address>@<export_path>`` as the value for ``src`` to mount OCI File Storage and you can also
165+
pass ``oci://<bucket_name>@<namespace>/<prefix>`` to mount OCI Object Storage. The value of
166+
``dest`` indicates the path and directory to which you want to mount the file system and must be in the
167+
format as ``<destination_path>/<destination_directory_name>``. The ``<destination_directory_name>`` is required
168+
while the ``<destination_path>`` is optional. The ``<destination_path>`` must start with character ``/`` if provided.
169+
If not, the file systems will be mounted to ``/mnt/<destination_directory_name>`` by default.
170+
171+
172+
.. tabs::
173+
174+
.. code-tab:: python
175+
:caption: Python
176+
177+
from ads.jobs import DataScienceJob
178+
179+
infrastructure = (
180+
DataScienceJob()
181+
.with_log_group_id("<log_group_ocid>")
182+
.with_log_id("<log_ocid>")
183+
.with_storage_mount(
184+
{
185+
"src" : "<mount_target_ip_address>@<export_path>",
186+
"dest" : "<destination_path>/<destination_directory_name>"
187+
}, # mount oci file storage to path "<destination_path>/<destination_directory_name>"
188+
{
189+
"src" : "oci://<bucket_name>@<namespace>/<prefix>",
190+
"dest" : "<destination_directory_name>"
191+
} # mount oci object storage to path "/mnt/<destination_directory_name>"
192+
)
193+
)
194+
195+
.. code-tab:: yaml
196+
:caption: YAML
197+
198+
kind: infrastructure
199+
type: dataScienceJob
200+
spec:
201+
logGroupId: <log_group_ocid>
202+
logId: <log_ocid>
203+
storageMount:
204+
- src: <mount_target_ip_address>@<export_path>
205+
dest: <destination_path>/<destination_directory_name>
206+
- src: oci://<bucket_name>@<namespace>/<prefix>
207+
dest: <destination_directory_name>
208+
209+
155210
Runtime
156211
=======
157212

docs/source/user_guide/jobs/tabs/infra_config.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@
2222
.with_shape_config_details(memory_in_gbs=16, ocpus=1)
2323
# Minimum/Default block storage size is 50 (GB).
2424
.with_block_storage_size(50)
25+
# A maximum number of 5 file systems are allowed to be mounted for a job.
26+
.with_storage_mount(
27+
{
28+
"src" : "<mount_target_ip_address>@<export_path>",
29+
"dest" : "<destination_path>/<destination_directory_name>"
30+
}, # mount oci file storage to path "<destination_path>/<destination_directory_name>"
31+
{
32+
"src" : "oci://<bucket_name>@<namespace>/<prefix>",
33+
"dest" : "<destination_directory_name>"
34+
} # mount oci object storage to path "/mnt/<destination_directory_name>"
35+
)
2536
)
2637

2738
.. code-tab:: yaml
@@ -40,3 +51,8 @@
4051
ocpus: 1
4152
shapeName: VM.Standard.E3.Flex
4253
subnetId: <subnet_ocid>
54+
storageMount:
55+
- src: <mount_target_ip_address>@<export_path>
56+
dest: <destination_path>/<destination_directory_name>
57+
- src: oci://<bucket_name>@<namespace>/<prefix>
58+
dest: <destination_directory_name>

docs/source/user_guide/jobs/tabs/quick_start_job.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@
2424
.with_shape_config_details(memory_in_gbs=16, ocpus=1)
2525
# Minimum/Default block storage size is 50 (GB).
2626
.with_block_storage_size(50)
27+
# A maximum number of 5 file systems are allowed to be mounted for a job.
28+
.with_storage_mount(
29+
{
30+
"src" : "<mount_target_ip_address>@<export_path>",
31+
"dest" : "<destination_path>/<destination_directory_name>"
32+
}, # mount oci file storage to path "<destination_path>/<destination_directory_name>"
33+
{
34+
"src" : "oci://<bucket_name>@<namespace>/<prefix>",
35+
"dest" : "<destination_directory_name>"
36+
} # mount oci object storage to path "/mnt/<destination_directory_name>"
37+
)
2738
)
2839
.with_runtime(
2940
PythonRuntime()
@@ -59,6 +70,11 @@
5970
ocpus: 1
6071
shapeName: VM.Standard.E3.Flex
6172
subnetId: <subnet_ocid>
73+
storageMount:
74+
- src: <mount_target_ip_address>@<export_path>
75+
dest: <destination_path>/<destination_directory_name>
76+
- src: oci://<bucket_name>@<namespace>/<prefix>
77+
dest: <destination_directory_name>
6278
runtime:
6379
kind: runtime
6480
type: python

0 commit comments

Comments
 (0)