Esempio n. 1
0
def cleanup():
    ts.stop_torchserve()
    rm_dir('model_store')
    rm_dir('logs')

    # clean up residual from model-archiver IT suite.
    rm_dir('model-archiver/model_archiver/htmlcov_ut model_archiver/model-archiver/htmlcov_it')
    rm_file('ts_scripts/*_pb2*.py', True)
def run_pytest():
    print("## Started regression pytests")
    os.chdir(os.path.join(REPO_ROOT, "test", "pytest"))
    cmd = "python -m grpc_tools.protoc --proto_path=../../frontend/server/src/main/resources/proto/" \
          " --python_out=. --grpc_python_out=. ../../frontend/server/src/main/resources/proto/inference.proto" \
          " ../../frontend/server/src/main/resources/proto/management.proto"
    status = os.system(cmd)
    if status != 0:
        print("Could not generate gRPC client stubs")
        sys.exit(1)
    cmd = "python -m pytest -v ./"
    print(f"## In directory: {os.getcwd()} | Executing command: {cmd}")
    status = os.system(cmd)
    rm_file('*_pb2*.py', True)
    return status
Esempio n. 3
0
                  f"{JMETER_HOME}\\lib\\ext\\",
                  "jmeter-plugins-manager-1.3.jar")

    print("Downloading plugins cmdrunner...")
    download_save(
        "http://search.maven.org/remotecontent?filepath=kg/apc/cmdrunner/2.2/cmdrunner-2.2.jar",
        f"{JMETER_HOME}\\lib\\", "cmdrunner-2.2.jar")

    print("Downloading plugins jmeter-plugins-standard...")
    download_save(
        "https://jmeter-plugins.org/downloads/file/JMeterPlugins-Standard-1.4.0.zip"
    )
    unzip("JMeterPlugins-Standard-1.4.0.zip", os.getcwd(), "zip")
    shutil.copy("lib\ext\JMeterPlugins-Standard.jar",
                f"{JMETER_HOME}\\lib\\ext\\")
    rm_file("JMeterPlugins-Standard-1.4.0.zip")
    rm_dir("lib")

    cmd = 'java -cp "{}\\apache-jmeter-5.3\\lib\\ext\\jmeter-plugins-manager-1.3.jar" org.jmeterplugins.repository.PluginManagerCMDInstaller'.format(
        JMETER_INSTALL_PATH)
    rc, out, _ = run(cmd)
    if rc != 0:
        print("Command execution failed : ", cmd)
    else:
        print(out)

    print("Installing Plugins..")
    cmd_plugins = '"{}\\apache-jmeter-5.3\\bin\\PluginsManagerCMD.bat" install jpgc-synthesis=2.1 jpgc-filterresults=2.1 jpgc-mergeresults=2.1 jpgc-cmd=2.1 jpgc-perfmon=2.1'.format(
        JMETER_INSTALL_PATH)
    rc, out, _ = run(cmd_plugins)
    if rc != 0:
Esempio n. 4
0
import tempfile
import sys
sys.path.append('../../ts_scripts')
from ts_scripts.shell_utils import rm_dir, rm_file, download_save
import os
import shutil
import subprocess

TMP_DIR = tempfile.gettempdir()
rm_file("torchhub.zip")
rm_dir(os.path.join(TMP_DIR, "DeepLearningExamples-torchhub"))
rm_dir("PyTorch")
download_save(
    "https://github.com/nvidia/DeepLearningExamples/archive/torchhub.zip",
    TMP_DIR)
shutil.unpack_archive(os.path.join(TMP_DIR, "torchhub.zip"),
                      extract_dir=TMP_DIR)
rm_file("tacotron.zip")
shutil.copytree(
    os.path.join(TMP_DIR,
                 "DeepLearningExamples-torchhub/PyTorch/SpeechSynthesis/"),
    "PyTorch/SpeechSynthesis/")
shutil.make_archive("tacotron", "zip", base_dir="PyTorch")
download_save(
    "https://api.ngc.nvidia.com/v2/models/nvidia/tacotron2pyt_fp32/versions/1/files/"
    "nvidia_tacotron2pyt_fp32_20190306.pth")
download_save(
    "https://api.ngc.nvidia.com/v2/models/nvidia/waveglowpyt_fp32/versions/1/files/"
    "nvidia_waveglowpyt_fp32_20190306.pth")
subprocess.run(
    "torch-model-archiver --model-name waveglow_synthesizer --version 1.0 "