|
6 | 6 | from ads.jobs import Job, DataScienceJob, GitPythonRuntime |
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 | | - GitPythonRuntime() |
28 | | - .with_environment_variable(GREETINGS="Welcome to OCI Data Science") |
29 | | - # Specify the service conda environment by slug name. |
30 | | - .with_service_conda("pytorch19_p37_gpu_v1") |
31 | | - # Specify the git repository |
32 | | - # Optionally, you can specify the branch or commit |
33 | | - .with_source("https://github.com/pytorch/tutorials.git") |
34 | | - # Entrypoint is a relative path from the root of the git repo. |
35 | | - .with_entrypoint("beginner_source/examples_nn/polynomial_nn.py") |
36 | | - # Copy files in "beginner_source/examples_nn" to object storage after job finishes. |
37 | | - .with_output( |
38 | | - output_dir="beginner_source/examples_nn", |
39 | | - output_uri="oci://bucket_name@namespace/path/to/dir" |
| 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 | + GitPythonRuntime() |
| 28 | + .with_environment_variable(GREETINGS="Welcome to OCI Data Science") |
| 29 | + # Specify the service conda environment by slug name. |
| 30 | + .with_service_conda("pytorch19_p37_gpu_v1") |
| 31 | + # Specify the git repository |
| 32 | + # Optionally, you can specify the branch or commit |
| 33 | + .with_source("https://github.com/pytorch/tutorials.git") |
| 34 | + # Entrypoint is a relative path from the root of the git repo. |
| 35 | + .with_entrypoint("beginner_source/examples_nn/polynomial_nn.py") |
| 36 | + # Copy files in "beginner_source/examples_nn" to object storage after job finishes. |
| 37 | + .with_output( |
| 38 | + output_dir="beginner_source/examples_nn", |
| 39 | + output_uri="oci://bucket_name@namespace/path/to/dir" |
| 40 | + ) |
40 | 41 | ) |
41 | | - ) |
42 | 42 | ) |
43 | 43 |
|
44 | 44 | .. code-tab:: yaml |
|
0 commit comments