Skip to content

Commit 2067f7b

Browse files
mckev-amazonJunLyu
authored andcommitted
Add a workaround for SageMaker Notebook Instance
Notebook Instances occasionally will not have the correct docker network bridge configured. Restarting the docker daemon will correct the configuration. To detect whether we are on a SageMaker notebook, check if the SageMaker home directory exists.
1 parent b90e503 commit 2067f7b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

advanced_functionality/scikit_bring_your_own/scikit_bring_your_own.ipynb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,13 @@
267267
"\n",
268268
"# Build the docker image locally with the image name and then push it to ECR\n",
269269
"# with the full name.\n",
270+
"\n",
271+
"# On a SageMaker Notebook Instance, the docker daemon may need to be restarted in order\n",
272+
"# to detect your network configuration correctly. (This is a known issue.)\n",
273+
"if [ -d \"/home/ec2-user/SageMaker\" ]; then\n",
274+
" sudo service docker restart\n",
275+
"fi\n",
276+
"\n",
270277
"docker build -t ${algorithm_name} .\n",
271278
"docker tag ${algorithm_name} ${fullname}\n",
272279
"\n",

0 commit comments

Comments
 (0)