|
1 | 1 | { |
2 | 2 | "cells": [ |
3 | 3 | { |
4 | | - "attachments": {}, |
5 | 4 | "cell_type": "markdown", |
6 | 5 | "metadata": {}, |
7 | 6 | "source": [ |
|
216 | 215 | ")\n", |
217 | 216 | "\n", |
218 | 217 | "warnings.filterwarnings(action=\"ignore\", category=DataConversionWarning)\n", |
219 | | - "s3_client = boto3.resource(\"s3\")\n", |
220 | 218 | "attempts_counter = 3\n", |
221 | 219 | "attempts = 0\n", |
222 | 220 | "\n", |
|
250 | 248 | " parser = argparse.ArgumentParser()\n", |
251 | 249 | " parser.add_argument(\"--train-test-split-ratio\", type=float, default=0.3)\n", |
252 | 250 | " args, _ = parser.parse_known_args()\n", |
253 | | - "\n", |
| 251 | + " \n", |
254 | 252 | " # Get processor scrip arguments\n", |
255 | 253 | " args_iter = iter(sys.argv[1:])\n", |
256 | 254 | " script_args = dict(zip(args_iter, args_iter))\n", |
257 | 255 | " scheduler_ip = sys.argv[-1]\n", |
258 | 256 | "\n", |
| 257 | + " # S3 client\n", |
| 258 | + " s3_region = script_args[\"s3_region\"]\n", |
| 259 | + " s3_client = boto3.resource(\"s3\", s3_region)\n", |
| 260 | + " print(f'Using the {s3_region} region')\n", |
| 261 | + " \n", |
259 | 262 | " # Start the Dask cluster client\n", |
260 | 263 | " try:\n", |
261 | 264 | " client = Client(\"tcp://{ip}:8786\".format(ip=scheduler_ip))\n", |
|
403 | 406 | { |
404 | 407 | "cell_type": "code", |
405 | 408 | "execution_count": null, |
406 | | - "metadata": {}, |
| 409 | + "metadata": { |
| 410 | + "scrolled": false |
| 411 | + }, |
407 | 412 | "outputs": [], |
408 | 413 | "source": [ |
409 | 414 | "from sagemaker.processing import ProcessingInput, ScriptProcessor\n", |
|
429 | 434 | " bucket,\n", |
430 | 435 | " \"s3_output_key_prefix\",\n", |
431 | 436 | " input_preprocessed_prefix,\n", |
| 437 | + " \"s3_region\",\n", |
| 438 | + " region\n", |
432 | 439 | " ],\n", |
433 | | - " logs=True,\n", |
| 440 | + " logs=True\n", |
434 | 441 | ")" |
435 | 442 | ] |
436 | 443 | }, |
|
462 | 469 | ], |
463 | 470 | "metadata": { |
464 | 471 | "kernelspec": { |
465 | | - "display_name": "Python 3", |
| 472 | + "display_name": "conda_python3", |
466 | 473 | "language": "python", |
467 | | - "name": "python3" |
| 474 | + "name": "conda_python3" |
468 | 475 | }, |
469 | 476 | "language_info": { |
470 | 477 | "codemirror_mode": { |
|
476 | 483 | "name": "python", |
477 | 484 | "nbconvert_exporter": "python", |
478 | 485 | "pygments_lexer": "ipython3", |
479 | | - "version": "3.7.4" |
| 486 | + "version": "3.6.5" |
480 | 487 | } |
481 | 488 | }, |
482 | 489 | "nbformat": 4, |
|
0 commit comments