Skip to content

Commit

Permalink
fix: sagemaker args check
Browse files Browse the repository at this point in the history
  • Loading branch information
deepankarm committed Sep 18, 2023
1 parent eee67f7 commit da09260
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions jina/orchestrate/deployments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,12 +479,20 @@ def __init__(
self.args = args
self._gateway_load_balancer = False
if self.args.provider == ProviderType.SAGEMAKER:
if self.args.port != 8080:
if self._gateway_kwargs.get('port', 0) == 8080:
raise ValueError(
f'Port 8080 is reserved for Sagemaker deployment. Please use another port'
)
if self.args.port != [8080]:
warnings.warn(
f'Port is changed to 8080 for Sagemaker deployment. Port {self.args.port} is ignored'
)
self.args.protocol = [ProtocolType.HTTP]
self.args.port = [8080]
self.args.port = [8080]
if self.args.protocol != [ProtocolType.HTTP]:
warnings.warn(
f'Protocol is changed to HTTP for Sagemaker deployment. Protocol {self.args.protocol} is ignored'
)
self.args.protocol = [ProtocolType.HTTP]
if self._include_gateway and ProtocolType.HTTP in self.args.protocol:
self._gateway_load_balancer = True
log_config = kwargs.get('log_config')
Expand Down

0 comments on commit da09260

Please sign in to comment.