37
37
},
38
38
{
39
39
"cell_type" : " code" ,
40
- "execution_count" : 3 ,
40
+ "execution_count" : 4 ,
41
41
"metadata" : {
42
42
"tags" : []
43
43
},
44
44
"outputs" : [],
45
45
"source" : [
46
46
" %%nuclio cmd -c\n " ,
47
47
" python -m pip install scikit-multiflow==0.4.1\n " ,
48
- " python -m pip install v3io_frames"
48
+ " python -m pip install v3io_frames\n " ,
49
+ " python -m pip install nuclio-jupyter"
49
50
]
50
51
},
51
52
{
56
57
},
57
58
"outputs" : [
58
59
{
59
- "output_type" : " stream" ,
60
60
"name" : " stdout" ,
61
- "text" : " %nuclio: setting spec.build.baseImage to 'mlrun/ml-models'\n "
61
+ "output_type" : " stream" ,
62
+ "text" : [
63
+ " %nuclio: setting spec.build.baseImage to 'mlrun/ml-models'\n "
64
+ ]
62
65
}
63
66
],
64
67
"source" : [
183
186
" 'pagehinkley_threshold': pagehinkley_threshold,\n " ,
184
187
" 'ddm_warning_level': ddm_warning_level,\n " ,
185
188
" 'ddm_out_control': ddm_out_control_level}) \n " ,
186
- " fn.add_trigger('labeled_stream', V3IOStreamTrigger(url=input_stream))\n " ,
189
+ " fn.add_trigger('labeled_stream', V3IOStreamTrigger(url=input_stream, name='labeled_stream' ))\n " ,
187
190
" fn.apply(mount_v3io())\n " ,
188
191
" fn.deploy(project=context.project)"
189
192
]
201
204
"cell_type" : " markdown" ,
202
205
"metadata" : {},
203
206
"source" : [
204
- " ## Local test"
207
+ " ## Local test\n " ,
208
+ " A usecase based run example"
205
209
]
206
210
},
207
211
{
219
223
"metadata" : {},
220
224
"outputs" : [],
221
225
"source" : [
226
+ " container = 'bigdata'\n " ,
227
+ " base_table = os.path.join('/', container, 'network-operations')\n " ,
228
+ " stream_consumer_group = 'cd'\n " ,
229
+ " artifacts_path = os.path.join(os.getcwd(), 'artifacts')\n " ,
230
+ " \n " ,
222
231
" task = NewTask(name='concept_drift_deployer',\n " ,
223
232
" project='network-operations',\n " ,
224
233
" handler=concept_drift_deployer,\n " ,
225
234
" params={'models': ['ddm', 'eddm', 'pagehinkley'],\n " ,
226
235
" 'label_col': 'is_error',\n " ,
227
236
" 'prediction_col': 'yscore',\n " ,
228
- " 'hub_url': '/User/functions/{name}/function.yaml',\n " ,
229
- " 'output_tsdb': '/bigdata/network-operations/drift_tsdb',\n " ,
230
- " 'input_stream': 'http://v3io-webapi:8081/bigdata/network-operations/inference_stream@cd2',\n " ,
231
- " 'output_stream': '/bigdata/network-operations/drift_stream'},\n " ,
237
+ " 'output_tsdb': os.path.join(base_table, 'drift_tsdb'),\n " ,
238
+ " 'input_stream': f'http://{os.environ[\" V3IO_API\" ]}{os.path.join(base_table, 'inference_stream')}@{stream_consumer_group}',\n " ,
239
+ " 'output_stream': os.path.join(base_table, 'drift_stream')},\n " ,
232
240
" inputs={'base_dataset': 'store://network-operations/test_test_set_preds'},\n " ,
233
- " artifact_path='/User/demo-network-operations/artifacts/' )"
241
+ " artifact_path=artifacts_path )"
234
242
]
235
243
},
236
244
{
251
259
},
252
260
{
253
261
"cell_type" : " code" ,
254
- "execution_count" : 23 ,
262
+ "execution_count" : 1 ,
255
263
"metadata" : {},
256
264
"outputs" : [],
257
265
"source" : [
262
270
},
263
271
{
264
272
"cell_type" : " code" ,
265
- "execution_count" : 24 ,
273
+ "execution_count" : 3 ,
266
274
"metadata" : {},
267
275
"outputs" : [
268
276
{
269
277
"name" : " stdout" ,
270
278
"output_type" : " stream" ,
271
279
"text" : [
272
- " > 2020-07-27 07:49:39,770 [info] function spec saved to path: function.yaml\n "
280
+ " > 2020-12-23 12:39:26,663 [info] function spec saved to path: function.yaml\n "
273
281
]
274
282
},
275
283
{
276
284
"data" : {
277
285
"text/plain" : [
278
- " <mlrun.runtimes.kubejob.KubejobRuntime at 0x7f94677f1828 >"
286
+ " <mlrun.runtimes.kubejob.KubejobRuntime at 0x7fb816dc7450 >"
279
287
]
280
288
},
281
- "execution_count" : 24 ,
289
+ "execution_count" : 3 ,
282
290
"metadata" : {},
283
291
"output_type" : " execute_result"
284
292
}
353
361
],
354
362
"metadata" : {
355
363
"kernelspec" : {
356
- "display_name" : " Python 3.7.6 64-bit ('mlrun': conda) " ,
364
+ "display_name" : " Python [conda env:root] * " ,
357
365
"language" : " python" ,
358
- "name" : " python37664bitmlruncondaffd934acfa434683ba806e65bc7d5bad "
366
+ "name" : " conda-root-py "
359
367
},
360
368
"language_info" : {
361
369
"codemirror_mode" : {
367
375
"name" : " python" ,
368
376
"nbconvert_exporter" : " python" ,
369
377
"pygments_lexer" : " ipython3" ,
370
- "version" : " 3.7.6-final "
378
+ "version" : " 3.7.6"
371
379
}
372
380
},
373
381
"nbformat" : 4 ,
374
382
"nbformat_minor" : 4
375
- }
383
+ }
0 commit comments