Skip to content
This repository was archived by the owner on Nov 26, 2019. It is now read-only.

Commit 5b6f22d

Browse files
authored
Merge pull request #24 from gilv/pywren-new-runtime
update to PyWren-IBM-Cloud version 1.0.9
2 parents 7352d9a + 797a24e commit 5b6f22d

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

notebooks/facial-recognition.ipynb

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,6 @@
130130
"outputs": [],
131131
"source": [
132132
"%%capture\n",
133-
"!curl -fsSL \"https://git.io/fhe9X\" | sh\n",
134-
"try:\n",
135-
" import pywren_ibm_cloud as pywren\n",
136-
"except:\n",
137-
" !curl -fsSL \"https://git.io/fhe9X\" | sh\n",
138-
" import pywren_ibm_cloud as pywren\n",
139133
"try:\n",
140134
" import cv2\n",
141135
"except:\n",
@@ -150,6 +144,18 @@
150144
"import bz2"
151145
]
152146
},
147+
{
148+
"cell_type": "code",
149+
"execution_count": null,
150+
"metadata": {},
151+
"outputs": [],
152+
"source": [
153+
"#Install PyWren-IBM\n",
154+
"import sys\n",
155+
"sys.executable, sys.prefix\n",
156+
"!{sys.executable} -m pip install -U pywren-ibm-cloud==1.0.9"
157+
]
158+
},
153159
{
154160
"cell_type": "markdown",
155161
"metadata": {},
@@ -349,14 +355,17 @@
349355
"outputs": [],
350356
"source": [
351357
"config = {\n",
352-
" 'ibm_cf': {'endpoint': '<IBM Cloud Functions Endpoint>', \n",
353-
" 'namespace': '<NAMESPACE>', \n",
354-
" 'api_key': '<API KEY>'}}\n",
355-
"config['ibm_cos'] = {}\n",
356-
"config['ibm_cos']['endpoint'] = cos_endpoint\n",
357-
"config['ibm_cos']['api_key'] = cos_credentials['apikey']\n",
358-
"config['pywren'] = {}\n",
359-
"config['pywren']['storage_bucket'] = BUCKET"
358+
" 'ibm_cf': {'endpoint': '<IBM Cloud Functions Endpoint>',\n",
359+
" 'namespace': '<NAMESPACE>', \n",
360+
" 'action_memory' : 512,\n",
361+
" 'api_key': '<API KEY>'}, \n",
362+
" 'ibm_cos': {\n",
363+
" 'endpoint': cos_endpoint,\n",
364+
" 'api_key' : cos_credentials['apikey']\n",
365+
" },\n",
366+
" 'pywren' : {'storage_bucket' : BUCKET,\n",
367+
" 'runtime' : 'ibmfunctions/pywren-dlib-runtime:3.5'}\n",
368+
"}"
360369
]
361370
},
362371
{
@@ -366,16 +375,6 @@
366375
"The PyWren engine requires its server side component to be deployed in advance. This step creates a new IBM Cloud Functions function with the PyWren server side runtime. This action will be used internally by PyWren during execution phases."
367376
]
368377
},
369-
{
370-
"cell_type": "code",
371-
"execution_count": null,
372-
"metadata": {},
373-
"outputs": [],
374-
"source": [
375-
"from pywren_ibm_cloud.deployutil import clone_runtime\n",
376-
"clone_runtime('ibmfunctions/pywren-dlib-runtime:3.5', config, 'pywren-ibm-cloud')"
377-
]
378-
},
379378
{
380379
"cell_type": "markdown",
381380
"metadata": {},
@@ -631,7 +630,7 @@
631630
"outputs": [],
632631
"source": [
633632
"raw_images = BUCKET + '/images'\n",
634-
"pw = pywren.ibm_cf_executor(config=config, runtime='pywren-dlib-runtime_3.5')\n",
633+
"pw = pywren.ibm_cf_executor(config=config)\n",
635634
"try:\n",
636635
" pw.map(preprocess_image, raw_images, remote_invocation=True)\n",
637636
" results = pw.get_result()\n",

0 commit comments

Comments
 (0)