Skip to content

Commit 72bf413

Browse files
committed
Update overview.rst, data_science_job.rst, and 11 more files...
1 parent 413a3a9 commit 72bf413

File tree

13 files changed

+501
-641
lines changed

13 files changed

+501
-641
lines changed

docs/source/user_guide/jobs/components/overview.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ For example, you may want to experiment with how different model classes perform
2323
by using the ADSTuner to perform hyperparameter tuning on each model class.
2424
You could do this in parallel by having a different job run for each class of models.
2525
For a given job run, you could pass an environment variable that identifies the model class that you want to use.
26-
Each model cab write its results to the Logging service or Object Storage.
26+
Each model can write its results to the Logging service or Object Storage.
2727
Then you can run a final sequential job that uses the best model class, and trains the final model on the entire dataset.
2828

2929
The following sections provides details on running training workloads with OCI Data Science Jobs using ADS Jobs APIs.

docs/source/user_guide/jobs/data_science_job.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,4 +155,8 @@ and ``output_uri`` based on the environment variables ``JOB_RUN_OCID``:
155155
156156
Note that ``JOB_RUN_OCID`` is an environment variable provided by the service after the job run is created.
157157
It is available for the ``output_uri`` but cannot be used in the job name.
158-
See also :ref:`Saving Outputs <_runtime_outputs>`
158+
159+
See also:
160+
161+
* :ref:`Saving Outputs <runtime_outputs>`
162+
* `Service Provided Environment Variables <https://docs.oracle.com/en-us/iaas/data-science/using/jobs-env-vars.htm>`_
Lines changed: 16 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,129 +1,26 @@
11
Run a Container
22
***************
33

4-
The ADS ``ContainerRuntime`` class allows you to run a container image using OCI data science jobs.
4+
The :py:class:`~ads.jobs.ContainerRuntime` class allows you to run a container image using OCI data science jobs.
55

6-
To use the ``ContainerRuntime``, you need to first push the image to `OCI container registry <https://docs.oracle.com/en-us/iaas/Content/Registry/Concepts/registryoverview.htm>`_. See `Creating a Repository <https://docs.oracle.com/en-us/iaas/Content/Registry/Tasks/registrycreatingarepository.htm>`_ and `Pushing Images Using the Docker CLI <https://docs.oracle.com/en-us/iaas/Content/Registry/Tasks/registrycreatingarepository.htm>`_ for more details.
6+
.. admonition:: OCI Container Registry
77

8-
Python
9-
======
8+
To use the :py:class:`~ads.jobs.ContainerRuntime`, you need to first push the image to
9+
`OCI container registry <https://docs.oracle.com/en-us/iaas/Content/Registry/Concepts/registryoverview.htm>`_.
10+
For more details, see:
11+
12+
* `Creating a Repository <https://docs.oracle.com/en-us/iaas/Content/Registry/Tasks/registrycreatingarepository.htm>`_
13+
* `Pushing Images Using the Docker CLI <https://docs.oracle.com/en-us/iaas/Content/Registry/Tasks/registrycreatingarepository.htm>`_.
1014

11-
To configure ``ContainerRuntime``, you must specify the container ``image``. Similar to other runtime, you can add environment variables. You can optionally specify the `entrypoint` and `cmd` for running the container (See `Understand how CMD and ENTRYPOINT interact <https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact>`_).
15+
Here is an example to create and run a container job:
1216

13-
.. code-block:: python3
17+
.. include:: ../jobs/tabs/container_runtime.rst
1418

15-
from ads.jobs import Job, DataScienceJob, ContainerRuntime
19+
To configure ``ContainerRuntime``, you must specify the container ``image``.
20+
Similar to other runtime, you can add environment variables.
21+
You can optionally specify the `entrypoint` and `cmd` for running the container.
1622

17-
job = (
18-
Job()
19-
.with_infrastructure(
20-
DataScienceJob()
21-
.with_log_group_id("<log_group_ocid>")
22-
.with_log_id("<log_ocid>")
23-
# The following infrastructure configurations are optional
24-
# if you are in an OCI data science notebook session.
25-
# The configurations of the notebook session will be used as defaults
26-
.with_compartment_id("<compartment_ocid>")
27-
.with_project_id("<project_ocid>")
28-
.with_subnet_id("<subnet_ocid>")
29-
.with_shape_name("VM.Standard.E3.Flex")
30-
.with_shape_config_details(memory_in_gbs=16, ocpus=1) # Applicable only for the flexible shapes
31-
.with_block_storage_size(50)
32-
)
33-
.with_runtime(
34-
ContainerRuntime()
35-
.with_image("<region>.ocir.io/<your_tenancy>/<your_image>")
36-
.with_environment_variable(GREETINGS="Welcome to OCI Data Science")
37-
.with_entrypoint(["/bin/sh", "-c"])
38-
.with_cmd("sleep 5 && echo $GREETINGS")
39-
)
40-
)
41-
42-
# Create the job with OCI
43-
job.create()
44-
# Run the job and stream the outputs
45-
job_run = job.run().watch()
46-
47-
YAML
48-
====
49-
50-
You could use the following YAML to create the same job:
51-
52-
.. code-block:: yaml
53-
54-
kind: job
55-
spec:
56-
name: container-job
57-
infrastructure:
58-
kind: infrastructure
59-
type: dataScienceJob
60-
spec:
61-
logGroupId: <log_group_ocid>
62-
logId: <log_ocid>
63-
compartmentId: <compartment_ocid>
64-
projectId: <project_ocid>
65-
subnetId: <subnet_ocid>
66-
shapeName: VM.Standard.E3.Flex
67-
shapeConfigDetails:
68-
memoryInGBs: 16
69-
ocpus: 1
70-
blockStorageSize: 50
71-
runtime:
72-
kind: runtime
73-
type: container
74-
spec:
75-
image: iad.ocir.io/<your_tenancy>/<your_image>
76-
cmd:
77-
- sleep 5 && echo $GREETINGS
78-
entrypoint:
79-
- /bin/sh
80-
- -c
81-
env:
82-
- name: GREETINGS
83-
value: Welcome to OCI Data Science
84-
85-
**ContainerRuntime Schema**
86-
87-
.. code-block:: yaml
88-
89-
kind:
90-
required: true
91-
type: string
92-
allowed:
93-
- runtime
94-
type:
95-
required: true
96-
type: string
97-
allowed:
98-
- container
99-
spec:
100-
type: dict
101-
required: true
102-
schema:
103-
image:
104-
required: true
105-
type: string
106-
entrypoint:
107-
required: false
108-
type:
109-
- string
110-
- list
111-
cmd:
112-
required: false
113-
type:
114-
- string
115-
- list
116-
env:
117-
nullable: true
118-
required: false
119-
type: list
120-
schema:
121-
type: dict
122-
schema:
123-
name:
124-
type: string
125-
value:
126-
type:
127-
- number
128-
- string
23+
See also:
12924

25+
* `Understand how CMD and ENTRYPOINT interact <https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact>`_
26+
* `Bring Your Own Container <https://docs.oracle.com/en-us/iaas/data-science/using/jobs-byoc.htm>`_

0 commit comments

Comments
 (0)