Skip to content

Commit 2632891

Browse files
committed
Add example for specifying job infrastructure type to use managed egress.
1 parent c1161e2 commit 2632891

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

docs/source/user_guide/jobs/infra_and_runtime.rst

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,42 @@ a service gateway, both are configured automatically. Custom networking requires
9999
You can control the network access through the subnet and security lists.
100100

101101
If you specified a subnet ID, your job will be configured to have custom networking.
102-
Otherwise, default networking will be used. Note that when you are in a Data Science Notebook Session,
102+
Otherwise, default networking will be used.
103+
104+
Note that when you are in a Data Science Notebook Session,
103105
the same networking configuration is be used by default.
104106
You can specify the networking manually by calling :py:meth:`~ads.jobs.DataScienceJob.with_job_infrastructure_type()`.
107+
For example, if you are using custom networking in the notebook session
108+
but you would like to use default networking for the job:
109+
110+
.. tabs::
111+
112+
.. code-tab:: python
113+
:caption: Python
114+
115+
from ads.jobs import DataScienceJob
116+
117+
infrastructure = (
118+
DataScienceJob()
119+
.with_log_group_id("<log_group_ocid>")
120+
.with_log_id("<log_ocid>")
121+
# Use default networking,
122+
# regardless of the networking used by the notebook session
123+
.with_job_infrastructure_type("ME_STANDALONE")
124+
# compartment ID, project ID, compute shape and block storage will be
125+
# the same as the ones set in the notebook session
126+
)
127+
128+
.. code-tab:: yaml
129+
:caption: YAML
130+
131+
kind: infrastructure
132+
type: dataScienceJob
133+
spec:
134+
jobInfrastructureType: ME_STANDALONE
135+
logGroupId: <log_group_ocid>
136+
logId: <log_ocid>
137+
105138

106139
Logging
107140
-------

0 commit comments

Comments
 (0)