def test_hosting_start(start_model_server):
    from sagemaker_pytorch_serving_container import serving

    serving.main()

    start_model_server.assert_called_with(
        handler_service='sagemaker_pytorch_serving_container.handler_service')
Esempio n. 2
0
import shlex
import subprocess
import sys
import os.path

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

if sys.argv[1] == 'serve':
    from sagemaker_pytorch_serving_container import serving
    serving.main()
else:
    subprocess.check_call(shlex.split(' '.join(sys.argv[1:])))

# prevent docker exit
subprocess.call(['tail', '-f', '/dev/null'])
Esempio n. 3
0
def test_hosting_start(start_torchserve):
    from sagemaker_pytorch_serving_container import serving

    serving.main()
    start_torchserve.assert_called()