Skip to content

Commit edbd53a

Browse files
Madhur prashantMadhur prashant
authored andcommitted
resolved network config
1 parent 2506a67 commit edbd53a

File tree

2 files changed

+33
-10
lines changed

2 files changed

+33
-10
lines changed

0_model_training_pipeline.ipynb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,16 @@
312312
"# A managed processor comes with a preconfigured container, so only specifying version is required.\n",
313313
"est_cls = sagemaker.sklearn.estimator.SKLearn\n",
314314
"\n",
315+
"nw_cfg = config['aws']['network_config']\n",
316+
"\n",
317+
"network_config = sagemaker.network.NetworkConfig(\n",
318+
" enable_network_isolation=nw_cfg.get('enable_network_isolation'),\n",
319+
" security_group_ids=nw_cfg.get('security_group_ids'), \n",
320+
" subnets=nw_cfg.get('subnets'),\n",
321+
" encrypt_inter_container_traffic=nw_cfg.get('encrypt_inter_container_traffic'),\n",
322+
")\n",
323+
"\n",
324+
"\n",
315325
"sklearn_processor = FrameworkProcessor(\n",
316326
" estimator_cls=est_cls,\n",
317327
" framework_version=config['training_step']['sklearn_framework_version'],\n",
@@ -320,7 +330,8 @@
320330
" instance_count=config['data_processing_step']['instance_count'],\n",
321331
" tags=config['data_processing_step']['tags'], \n",
322332
" sagemaker_session=pipeline_session,\n",
323-
" base_job_name=config['pipeline']['base_job_name'], )\n",
333+
" base_job_name=config['pipeline']['base_job_name'],\n",
334+
" network_config=network_config)\n",
324335
"\n",
325336
"outputs_preprocessor = [\n",
326337
" ProcessingOutput(\n",

config.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,30 @@
22
aws:
33
region: us-east-1
44
# execution role, replace the role name below with the one you are using
5-
sagemaker_execution_role_name: your-sagemaker-execution-role
5+
sagemaker_execution_role_name: <your-sagemaker-execution-role>
66
# the execution role ARN is determined automatically by the code
7-
sagemaker_execution_role_arn: arn:aws:iam::{account_id}:role/{role}
7+
sagemaker_execution_role_arn: arn:aws:iam::{account_id}:role/service-role/{role}
88
s3_bucket: sagemaker-{region}-{account_id} # region and account id are automatically replaced
9-
s3_prefix: mlops-pipeline-model
9+
s3_prefix: mlops-pipeline-model
10+
# view more information on the network configuration here:
11+
# https://sagemaker.readthedocs.io/en/stable/api/utility/network.html
12+
network_config:
13+
enable_network_isolation:
14+
# these are list of security groups and subnets
15+
# if you have these values configured, mention them
16+
# below
17+
security_group_ids:
18+
subnets:
19+
# Boolean that determines whether to encrypt inter-container traffic.
20+
# Default value is None.
21+
encrypt_inter_container_traffic:
1022

1123
presto:
12-
host: <0.0.0.0>
13-
parameter: "0000"
14-
presto_credentials: <presto_credentials>
15-
catalog: <catalog>
16-
schema: <schema>
24+
host: <your-presto-server-ip>
25+
parameter: "<your-presto-port-number"
26+
presto_credentials: <your-presto-server-credentials>
27+
catalog: <catalog-for-presto-server>
28+
schema: <schema-for-presto-server>
1729

1830
## User needs to configure the following
1931
pipeline:
@@ -93,7 +105,7 @@ tuning_step:
93105

94106
evaluation_step:
95107
step_name: Evaluate-Model
96-
accuracy_condition_threshold: 0.40
108+
accuracy_condition_threshold: 0.60
97109
instance_type: ml.m5.xlarge
98110
instance_count: 1
99111
evaluation_filename: evaluation.json

0 commit comments

Comments
 (0)