Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

fix: change single quotes to double quotes #149

Merged
merged 8 commits into from
Jul 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -620,24 +620,24 @@ To deploy a Multi-Model endpoint with TFS container, please start the container
### Multi-Model Interfaces
We provide four different interfaces for user to interact with a Multi-Model Mode container:

+---------------------+---------------------------------+---------------------------------------------+
| Functionality | Request | Response/Actions |
+---------------------+---------------------------------+---------------------------------------------+
| List A Single Model | GET /models/{model_name} | Information about the specified model |
+---------------------+---------------------------------+---------------------------------------------+
| List All Models | GET /models | List of Information about all loaded models |
+---------------------+---------------------------------+---------------------------------------------+
| | POST /models | Load model with "model_name" from |
| | data = { | specified url |
| Load A Model | "model_name": <model-name>, | |
| | "url": <path to model data> | |
| | } | |
+---------------------+---------------------------------+---------------------------------------------+
| Make Invocations | POST /models/{model_name}/invoke| Return inference result from |
| | data = <invocation payload> | the specified model |
+---------------------+---------------------------------+---------------------------------------------+
| Unload A Model | DELETE /models/{model_name} | Unload the specified model |
+---------------------+---------------------------------+---------------------------------------------+
+---------------------+---------------------------------+---------------------------------------------+
| Functionality | Request | Response/Actions |
+---------------------+---------------------------------+---------------------------------------------+
| List A Single Model | GET /models/{model_name} | Information about the specified model |
+---------------------+---------------------------------+---------------------------------------------+
| List All Models | GET /models | List of Information about all loaded models |
+---------------------+---------------------------------+---------------------------------------------+
| | POST /models | Load model with "model_name" from |
| | data = { | specified url |
| Load A Model | "model_name": <model-name>, | |
| | "url": <path to model data> | |
| | } | |
+---------------------+---------------------------------+---------------------------------------------+
| Make Invocations | POST /models/{model_name}/invoke| Return inference result from |
| | data = <invocation payload> | the specified model |
+---------------------+---------------------------------+---------------------------------------------+
| Unload A Model | DELETE /models/{model_name} | Unload the specified model |
+---------------------+---------------------------------+---------------------------------------------+

### Maximum Number of Models
Also please note the environment variable ``SAGEMAKER_SAFE_PORT_RANGE`` will limit the number of models that can be loaded to the endpoint at the same time.
Expand Down
2 changes: 1 addition & 1 deletion docker/build_artifacts/deep_learning_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def _validate_instance_id(instance_id):
"""
Validate instance ID
"""
instance_id_regex = r'^(i-\S{17})'
instance_id_regex = r"^(i-\S{17})"
compiled_regex = re.compile(instance_id_regex)
match = compiled_regex.match(instance_id)

Expand Down
2 changes: 1 addition & 1 deletion docker/build_artifacts/dockerd-entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
import sys

if not os.path.exists("/opt/ml/input/config"):
subprocess.call(['python', '/usr/local/bin/deep_learning_container.py', '&>/dev/null', '&'])
subprocess.call(["python", "/usr/local/bin/deep_learning_container.py", "&>/dev/null", "&"])

subprocess.check_call(shlex.split(' '.join(sys.argv[1:])))
8 changes: 4 additions & 4 deletions docker/build_artifacts/sagemaker/multi_model_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
import time
from contextlib import contextmanager

MODEL_CONFIG_FILE = '/sagemaker/model-config.cfg'
DEFAULT_LOCK_FILE = '/sagemaker/lock-file.lock'
MODEL_CONFIG_FILE = "/sagemaker/model-config.cfg"
DEFAULT_LOCK_FILE = "/sagemaker/lock-file.lock"


@contextmanager
def lock(path=DEFAULT_LOCK_FILE):
f = open(path, 'w')
f = open(path, "w")
fd = f.fileno()
fcntl.lockf(fd, fcntl.LOCK_EX)

Expand All @@ -35,7 +35,7 @@ def lock(path=DEFAULT_LOCK_FILE):
@contextmanager
def timeout(seconds=60):
def _raise_timeout_error(signum, frame):
raise Exception(408, 'Timed out after {} seconds'.format(seconds))
raise Exception(408, "Timed out after {} seconds".format(seconds))

try:
signal.signal(signal.SIGALRM, _raise_timeout_error)
Expand Down
Loading