|
6 | 6 | from ads.jobs import Job, DataScienceJob, ContainerRuntime |
7 | 7 |
|
8 | 8 | job = ( |
9 | | - Job(name="My Job") |
10 | | - .with_infrastructure( |
11 | | - DataScienceJob() |
12 | | - .with_log_group_id("<log_group_ocid>") |
13 | | - .with_log_id("<log_ocid>") |
14 | | - # The following infrastructure configurations are optional |
15 | | - # if you are in an OCI data science notebook session. |
16 | | - # The configurations of the notebook session will be used as defaults. |
17 | | - .with_compartment_id("<compartment_ocid>") |
18 | | - .with_project_id("<project_ocid>") |
19 | | - # For default networking, no need to specify subnet ID |
20 | | - .with_subnet_id("<subnet_ocid>") |
21 | | - .with_shape_name("VM.Standard.E3.Flex") |
22 | | - # Shape config details are applicable only for the flexible shapes. |
23 | | - .with_shape_config_details(memory_in_gbs=16, ocpus=1) |
24 | | - .with_block_storage_size(50) |
25 | | - ) |
26 | | - .with_runtime( |
27 | | - ContainerRuntime() |
28 | | - .with_image("<region>.ocir.io/<your_tenancy>/<your_image>") |
29 | | - .with_environment_variable(GREETINGS="Welcome to OCI Data Science") |
30 | | - .with_entrypoint(["/bin/sh", "-c"]) |
31 | | - .with_cmd("sleep 5 && echo $GREETINGS") |
32 | | - ) |
| 9 | + Job(name="My Job") |
| 10 | + .with_infrastructure( |
| 11 | + DataScienceJob() |
| 12 | + # Configure logging for getting the job run outputs. |
| 13 | + .with_log_group_id("<log_group_ocid>") |
| 14 | + # Log resource will be auto-generated if log ID is not specified. |
| 15 | + .with_log_id("<log_ocid>") |
| 16 | + # If you are in an OCI data science notebook session, |
| 17 | + # the following configurations are not required. |
| 18 | + # Configurations from the notebook session will be used as defaults. |
| 19 | + .with_compartment_id("<compartment_ocid>") |
| 20 | + .with_project_id("<project_ocid>") |
| 21 | + .with_subnet_id("<subnet_ocid>") |
| 22 | + .with_shape_name("VM.Standard.E3.Flex") |
| 23 | + # Shape config details are applicable only for the flexible shapes. |
| 24 | + .with_shape_config_details(memory_in_gbs=16, ocpus=1) |
| 25 | + # Minimum/Default block storage size is 50 (GB). |
| 26 | + .with_block_storage_size(50) |
| 27 | + ) |
| 28 | + .with_runtime( |
| 29 | + ContainerRuntime() |
| 30 | + .with_image("<region>.ocir.io/<your_tenancy>/<your_image>") |
| 31 | + .with_environment_variable(GREETINGS="Welcome to OCI Data Science") |
| 32 | + .with_entrypoint(["/bin/sh", "-c"]) |
| 33 | + .with_cmd("sleep 5 && echo $GREETINGS") |
| 34 | + ) |
33 | 35 | ) |
34 | 36 |
|
35 | 37 | .. code-tab:: yaml |
|
45 | 47 | blockStorageSize: 50 |
46 | 48 | compartmentId: <compartment_ocid> |
47 | 49 | jobInfrastructureType: STANDALONE |
48 | | - jobType: DEFAULT |
49 | 50 | logGroupId: <log_group_ocid> |
50 | 51 | logId: <log_ocid> |
51 | 52 | projectId: <project_ocid> |
|
0 commit comments