Skip to content

Commit 2be9926

Browse files
committed
Remove docker-compose as a required dependency. Throw an error if it is not installed.
1 parent 6e4bf8a commit 2be9926

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def read_version():
4040
"scipy>=0.19.0",
4141
"urllib3>=1.21, <1.25",
4242
"protobuf3-to-dict>=0.1.5",
43-
"docker-compose>=1.23.0",
4443
"requests>=2.20.0, <2.21",
4544
"fabric>=2.0",
4645
]
@@ -87,6 +86,7 @@ def read_version():
8786
"black==19.3b0 ; python_version >= '3.6'",
8887
"stopit==1.1.2",
8988
"apache-airflow==1.10.5",
89+
"docker-compose>=1.23.0"
9090
]
9191
},
9292
entry_points={"console_scripts": ["sagemaker=sagemaker.cli.main:main"]},

src/sagemaker/local/image.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ def __init__(self, instance_type, instance_count, image, sagemaker_session=None)
7777
"""
7878
from sagemaker.local.local_session import LocalSession
7979

80+
# check if docker-compose is installed
81+
if shutil.which('docker-compose') is None:
82+
raise ImportError(
83+
"'docker-compose' is not installed. Local mode feature will be broken. " +
84+
"For more information on how to install 'docker-compose', please, see " +
85+
"https://docs.docker.com/compose/install/"
86+
)
87+
8088
self.sagemaker_session = sagemaker_session or LocalSession()
8189
self.instance_type = instance_type
8290
self.instance_count = instance_count

0 commit comments

Comments
 (0)