|
25 | 25 | DEFAULT_MODEL_SERVER_TIMEOUT = "60"
|
26 | 26 | DEFAULT_STARTUP_TIMEOUT = "600" # 10 minutes
|
27 | 27 | DEFAULT_HTTP_PORT = "8080"
|
| 28 | +DEFAULT_VMARGS = "-XX:-UseContainerSupport" |
28 | 29 |
|
29 | 30 | SAGEMAKER_BASE_PATH = os.path.join("/opt", "ml") # type: str
|
30 | 31 |
|
@@ -70,15 +71,12 @@ def __init__(self):
|
70 | 71 | os.environ.get(parameters.MODEL_SERVER_TIMEOUT_ENV, DEFAULT_MODEL_SERVER_TIMEOUT)
|
71 | 72 | )
|
72 | 73 | self._model_server_workers = os.environ.get(parameters.MODEL_SERVER_WORKERS_ENV)
|
73 |
| - self._startup_timeout = int( |
74 |
| - os.environ.get(parameters.STARTUP_TIMEOUT_ENV, DEFAULT_STARTUP_TIMEOUT) |
75 |
| - ) |
76 |
| - self._default_accept = os.environ.get( |
77 |
| - parameters.DEFAULT_INVOCATIONS_ACCEPT_ENV, content_types.JSON |
78 |
| - ) |
| 74 | + self._startup_timeout = int(os.environ.get(parameters.STARTUP_TIMEOUT_ENV, DEFAULT_STARTUP_TIMEOUT)) |
| 75 | + self._default_accept = os.environ.get(parameters.DEFAULT_INVOCATIONS_ACCEPT_ENV, content_types.JSON) |
79 | 76 | self._inference_http_port = os.environ.get(parameters.BIND_TO_PORT_ENV, DEFAULT_HTTP_PORT)
|
80 | 77 | self._management_http_port = os.environ.get(parameters.BIND_TO_PORT_ENV, DEFAULT_HTTP_PORT)
|
81 | 78 | self._safe_port_range = os.environ.get(parameters.SAFE_PORT_RANGE_ENV)
|
| 79 | + self._vmargs = os.environ.get(parameters.VMARGS, DEFAULT_VMARGS) |
82 | 80 |
|
83 | 81 | @staticmethod
|
84 | 82 | def _parse_module_name(program_param):
|
@@ -140,3 +138,8 @@ def safe_port_range(self): # type: () -> str
|
140 | 138 | specified by SageMaker for handling pings and invocations.
|
141 | 139 | """
|
142 | 140 | return self._safe_port_range
|
| 141 | + |
| 142 | + @property |
| 143 | + def vmargs(self): # type: () -> str |
| 144 | + """str: vmargs can be provided for the JVM, to be overriden""" |
| 145 | + return self._vmargs |
0 commit comments