@@ -128,6 +128,10 @@ This example runs a job with CLI arguments:
128
128
129
129
.. code-block :: python3
130
130
131
+ from ads.jobs import Job
132
+ from ads.jobs import DataScienceJob
133
+ from ads.jobs import ScriptRuntime
134
+
131
135
job = Job()
132
136
job.with_infrastructure(
133
137
DataScienceJob()
@@ -161,9 +165,9 @@ You could create the preceding example job with the following YAML file:
161
165
162
166
.. code-block :: yaml
163
167
164
- kind: job
165
- spec:
166
- infrastructure:
168
+ kind : job
169
+ spec :
170
+ infrastructure :
167
171
kind : infrastructure
168
172
type : dataScienceJob
169
173
spec :
@@ -177,14 +181,14 @@ You could create the preceding example job with the following YAML file:
177
181
memoryInGBs : 16
178
182
ocpus : 1
179
183
blockStorageSize : 50
180
- runtime:
181
- kind: runtime
184
+ runtime :
185
+ kind : runtime
182
186
type : python
183
- spec:
184
- args:
185
- - <first_argument>
186
- - <second_argument>
187
- scriptPathURI: job_script_argument .py
187
+ spec :
188
+ args :
189
+ - <first_argument>
190
+ - <second_argument>
191
+ scriptPathURI : job_script_env .py
188
192
189
193
190
194
Environment Variables
@@ -201,12 +205,16 @@ Suppose you want to run the following python script named ``job_script_env.py``:
201
205
202
206
import os
203
207
import sys
204
- print("Hello " + os.environ["KEY1"] + " and " + os.environ["KEY2"])""")
208
+ print("Hello " + os.environ["KEY1"] + " and " + os.environ["KEY2"])
205
209
206
210
This example runs a job with environment variables:
207
211
208
212
.. code-block :: python3
209
213
214
+ from ads.jobs import Job
215
+ from ads.jobs import DataScienceJob
216
+ from ads.jobs import ScriptRuntime
217
+
210
218
job = Job()
211
219
job.with_infrastructure(
212
220
DataScienceJob()
@@ -246,12 +254,12 @@ You could create the preceding example job with the following YAML file:
246
254
247
255
.. code-block :: yaml
248
256
249
- kind: job
250
- spec:
251
- infrastructure:
252
- kind: infrastructure
257
+ kind : job
258
+ spec :
259
+ infrastructure :
260
+ kind : infrastructure
253
261
type : dataScienceJob
254
- spec:
262
+ spec :
255
263
logGroupId : <log_group_ocid>
256
264
logId : <log_ocid>
257
265
compartmentId : <compartment_ocid>
@@ -262,16 +270,16 @@ You could create the preceding example job with the following YAML file:
262
270
memoryInGBs : 16
263
271
ocpus : 1
264
272
blockStorageSize : 50
265
- runtime:
266
- kind: runtime
273
+ runtime :
274
+ kind : runtime
267
275
type : python
268
- spec:
269
- env:
270
- - name: KEY1
271
- value: <first_value>
272
- - name: KEY2
273
- value: <second_value>
274
- scriptPathURI: job_script_env.py
276
+ spec :
277
+ env :
278
+ - name : KEY1
279
+ value : <first_value>
280
+ - name : KEY2
281
+ value : <second_value>
282
+ scriptPathURI : job_script_env.py
275
283
276
284
277
285
0 commit comments