Skip to content

[DEPLOYMENT] Jenkins remote deployment #564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e7bee83
raw auto scripts
ismukhin Nov 17, 2024
9f12cdf
add auto tvm
ismukhin Dec 1, 2024
fcd4e04
fix conda paths
ismukhin Dec 2, 2024
f0d9e16
fix paths
ismukhin Dec 4, 2024
3b88a97
add requirements
ismukhin Dec 4, 2024
48e0ac7
remote start add python specific interpreter
ismukhin Dec 4, 2024
27d4789
fix frameworks env build
ismukhin Dec 4, 2024
542e909
nproc all
ismukhin Dec 4, 2024
03c71e1
fix
ismukhin Dec 4, 2024
6561722
fix
ismukhin Dec 4, 2024
d9b5e7a
fix python remote start
ismukhin Dec 5, 2024
8755b78
print
ismukhin Dec 5, 2024
d17e07d
print2
ismukhin Dec 5, 2024
d8d0c3f
python specific interpreter in benchmark
ismukhin Dec 5, 2024
3bf8369
fix
ismukhin Dec 6, 2024
be5ad11
fix
ismukhin Dec 6, 2024
a942d80
fix
ismukhin Dec 8, 2024
5b54797
fix
ismukhin Dec 8, 2024
5d9e75a
fix
ismukhin Dec 8, 2024
cd7634b
fix
ismukhin Dec 8, 2024
b7749a6
fix
ismukhin Dec 8, 2024
8350700
compile fix
ismukhin Dec 10, 2024
9a619fe
compile fix
ismukhin Dec 10, 2024
9628b72
compile fix
ismukhin Dec 10, 2024
37239b9
fix compile
ismukhin Dec 10, 2024
ad0b6e1
fix compile
ismukhin Dec 10, 2024
b1d8ffc
make dirs
ismukhin Dec 10, 2024
175c641
prints
ismukhin Dec 10, 2024
0a6705c
fix
ismukhin Dec 10, 2024
2dc7195
fix1
ismukhin Dec 10, 2024
b20c099
fix1
ismukhin Dec 10, 2024
657efa2
finally fix
ismukhin Dec 10, 2024
f4bc0e5
vm add
ismukhin Dec 12, 2024
4d0bc44
pytorch
ismukhin Dec 12, 2024
ed4bb4d
pytorch
ismukhin Dec 12, 2024
a56d536
fixes for name of main python env
ismukhin Jan 5, 2025
c015fd2
fixes
ismukhin Jan 5, 2025
c093db9
Merge branch 'master' into jenkins_remote_deployment
ismukhin Aug 8, 2025
337865d
add python interpreter as independent param
ismukhin Aug 8, 2025
5707d1f
fixes
ismukhin Aug 8, 2025
4fe1459
fixes
ismukhin Aug 8, 2025
876adfa
applied comments
ismukhin Aug 10, 2025
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
6 changes: 6 additions & 0 deletions src/benchmark/config_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ def parse_independent_parameters(self, curr_test):
batch_size = _batch_size.data if (_batch_size and _batch_size.data != 'None') else None

device = indep_parameters_tag.getElementsByTagName('Device')[0].firstChild.data.strip()
python_path = 'python3'

if indep_parameters_tag.getElementsByTagName('PythonInterpreter')[0].firstChild:
python_path = indep_parameters_tag.getElementsByTagName('PythonInterpreter')[0].firstChild.data.strip()

iteration_count = indep_parameters_tag.getElementsByTagName('IterationCount')[0].firstChild.data.strip()
test_time_limit = int(indep_parameters_tag.getElementsByTagName('TestTimeLimit')[0].firstChild.data)
timeout_overhead_element = indep_parameters_tag.getElementsByTagName('TimeoutOverhead')
Expand Down Expand Up @@ -129,6 +134,7 @@ def parse_independent_parameters(self, curr_test):
timeout_overhead=timeout_overhead,
custom_models_links=custom_models_links,
raw_output=raw_output,
python_path=python_path,
)

def parse_dependent_parameters(self, curr_test, framework):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

class FrameworkIndependentParameters(FrameworkParameters):
def __init__(self, inference_framework, batch_size, device, iterarion_count, test_time_limit,
timeout_overhead, custom_models_links=None, raw_output=True, num_gpu_devices=None):
timeout_overhead, custom_models_links=None, raw_output=True, num_gpu_devices=None,
python_path='python3'):
self.inference_framework = None
self.batch_size = None
self.device = None
Expand All @@ -12,6 +13,7 @@ def __init__(self, inference_framework, batch_size, device, iterarion_count, tes
self.test_time_limit = None
self.custom_models_links = custom_models_links
self.raw_output = raw_output
self.python_path = 'python3'
if self._parameter_is_not_none(inference_framework):
self.inference_framework = inference_framework
else:
Expand Down Expand Up @@ -43,3 +45,4 @@ def __init__(self, inference_framework, batch_size, device, iterarion_count, tes
else:
default_timeout_overhead = 300
self.timeout_overhead = default_timeout_overhead
self.python_path = python_path
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_performance_metrics(self):

def _fill_command_line(self):
path_to_pytorch_script = Path.joinpath(self.inference_script_root, 'inference_dgl_pytorch.py')
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)

name = self._test.model.name
model = self._test.model.model
Expand Down
2 changes: 1 addition & 1 deletion src/benchmark/frameworks/executorch/executorch_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_performance_metrics(self):
return self.get_performance_metrics_from_json_report()

def _fill_command_line(self):
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)
dataset = self._test.dataset.path
input_shape = self._test.dep_parameters.input_shape
layout = self._test.dep_parameters.layout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_performance_metrics(self):

def _fill_command_line(self):
path_to_intelcaffe_script = Path.joinpath(self.inference_script_root, 'inference_caffe.py')
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)

model_prototxt = self._test.model.model
model_caffemodel = self._test.model.weight
Expand Down
4 changes: 2 additions & 2 deletions src/benchmark/frameworks/mxnet/mxnet_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def get_performance_metrics(self):
def _fill_command_line(self):
path_to_sync_script = Path.joinpath(self.inference_script_root,
'inference_mxnet_sync_mode.py')
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)
time_limit = self._test.indep_parameters.test_time_limit
common_params = super()._fill_command_line()
common_params += f' --time {time_limit}'
Expand All @@ -116,7 +116,7 @@ def get_performance_metrics(self):
def _fill_command_line(self):
path_to_async_script = Path.joinpath(self.inference_script_root,
'inference_mxnet_async_mode.py')
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)
common_params = super()._fill_command_line()
command_line = f'{python} {path_to_async_script} {common_params}'

Expand Down
2 changes: 1 addition & 1 deletion src/benchmark/frameworks/ncnn/ncnn_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_performance_metrics(self):

def _fill_command_line(self):
path_to_ncnn_script = Path.joinpath(self.inference_script_root, 'inference_ncnn.py')
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)

name = self._test.model.name
model = self._test.model.model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_performance_metrics(self):

def _fill_command_line(self):
path_to_onnx_script = Path.joinpath(self.inference_script_root, 'inference_onnx_runtime.py')
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)

model = self._test.model.model
dataset = self._test.dataset.path if self._test.dataset else None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_performance_metrics(self):

def _fill_command_line(self):
path_to_opencv_script = Path.joinpath(self.inference_script_root, 'inference_opencv.py')
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)

model = self._test.model.model
weights = self._test.model.weight
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def get_performance_metrics(self):

def _fill_command_line(self):
path_to_async_script = Path.joinpath(self.inference_script_root, 'inference_openvino_async_mode.py')
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)

common_params = super()._fill_command_line()
command_line = f'{python} {path_to_async_script} {common_params}'
Expand Down Expand Up @@ -82,7 +82,7 @@ def get_performance_metrics(self):

def _fill_command_line(self):
path_to_sync_script = Path.joinpath(self.inference_script_root, 'inference_openvino_sync_mode.py')
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)
time_limit = self._test.indep_parameters.test_time_limit

common_params = super()._fill_command_line()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_performance_metrics(self):

def _fill_command_line(self):
path_to_paddlepaddle_script = Path.joinpath(self.inference_script_root, 'inference_paddlepaddle.py')
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)

model = self._test.model.model
params = self._test.model.weight
Expand Down
11 changes: 2 additions & 9 deletions src/benchmark/frameworks/processes.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import abc
import json
import os
import platform
from datetime import datetime
from pathlib import Path

Expand Down Expand Up @@ -34,14 +33,8 @@ def report_path(self):
return report_path

@staticmethod
def get_cmd_python_version():
cmd_python_version = ''
os_type = platform.system()
if os_type == 'Linux':
cmd_python_version = 'python3'
else:
cmd_python_version = 'python'

def get_cmd_python_version(test):
cmd_python_version = test.indep_parameters.python_path
return cmd_python_version

def get_model_shape(self):
Expand Down
2 changes: 1 addition & 1 deletion src/benchmark/frameworks/pytorch/pytorch_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_performance_metrics(self):

def _fill_command_line(self):
path_to_pytorch_script = Path.joinpath(self.inference_script_root, 'inference_pytorch.py')
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)

name = self._test.model.name
model = self._test.model.model
Expand Down
2 changes: 1 addition & 1 deletion src/benchmark/frameworks/spektral/spektral_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_performance_metrics(self):

def _fill_command_line(self):
path_to_spektral_script = Path.joinpath(self.inference_script_root, 'inference_spektral.py')
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)

model = self._test.model.model
dataset = self._test.dataset.path if self._test.dataset else None
Expand Down
2 changes: 1 addition & 1 deletion src/benchmark/frameworks/tensorflow/tensorflow_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_performance_metrics(self):

def _fill_command_line(self):
path_to_tensorflow_script = Path.joinpath(self.inference_script_root, 'inference_tensorflow.py')
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)

model = self._test.model.model
dataset = self._test.dataset.path if self._test.dataset else None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_performance_metrics(self):

def _fill_command_line(self):
path_to_tensorflow_script = Path.joinpath(self.inference_script_root, 'inference_tensorflowlite.py')
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)

model = self._test.model.model
dataset = self._test.dataset.path if self._test.dataset else None
Expand Down
13 changes: 6 additions & 7 deletions src/benchmark/frameworks/tvm/tvm_process.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from pathlib import Path

from ..processes import ProcessHandler


Expand Down Expand Up @@ -108,7 +107,7 @@ def _fill_command_line(self):
else:
raise Exception('Incorrect model parameters. Set model name or file names.')
common_params += '-f mxnet '
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)
time_limit = self._test.indep_parameters.test_time_limit
common_params += super()._fill_command_line()
common_params += f' --time {time_limit}'
Expand Down Expand Up @@ -144,7 +143,7 @@ def _fill_command_line(self):
common_params += (f'-m {model_pt} ')
else:
raise Exception('Incorrect model parameters. Set model name or file names.')
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)
time_limit = self._test.indep_parameters.test_time_limit
common_params += super()._fill_command_line()
common_params += f' --time {time_limit}'
Expand All @@ -163,7 +162,7 @@ def get_performance_metrics(self):
def _fill_command_line(self):
model = self._test.model.model
common_params = f'-m {model} -f onnx '
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)
time_limit = self._test.indep_parameters.test_time_limit
common_params += super()._fill_command_line()
common_params += f' --time {time_limit}'
Expand All @@ -183,7 +182,7 @@ def _fill_command_line(self):
model = self._test.model.model
weight = self._test.model.weight
common_params = f'-m {model} -w {weight} -f caffe '
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)
time_limit = self._test.indep_parameters.test_time_limit
common_params += super()._fill_command_line()
common_params += f' --time {time_limit}'
Expand Down Expand Up @@ -218,7 +217,7 @@ def _fill_command_line(self):
else:
raise ValueError('Wrong arguments.')
common_params += '-f tvm '
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)
time_limit = self._test.indep_parameters.test_time_limit
common_params += super()._fill_command_line()
common_params += f' --time {time_limit}'
Expand All @@ -237,7 +236,7 @@ def get_performance_metrics(self):
def _fill_command_line(self):
model = self._test.model.model
common_params = f'-m {model} -f tflite '
python = ProcessHandler.get_cmd_python_version()
python = ProcessHandler.get_cmd_python_version(self._test)
time_limit = self._test.indep_parameters.test_time_limit
common_params += super()._fill_command_line()
common_params += f' --time {time_limit}'
Expand Down
7 changes: 0 additions & 7 deletions src/benchmark/tests/test_processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
OpenVINOBenchmarkCppProcess)
from src.benchmark.frameworks.openvino.openvino_process import OpenVINOProcess
from src.benchmark.frameworks.openvino.openvino_python_api_process import AsyncOpenVINOProcess, SyncOpenVINOProcess
from src.benchmark.frameworks.processes import ProcessHandler
from src.benchmark.frameworks.pytorch.pytorch_process import PyTorchProcess
from src.benchmark.frameworks.pytorch_cpp.pytorch_cpp_process import PyTorchCppProcess
from src.benchmark.frameworks.tensorflow.tensorflow_process import TensorFlowProcess
Expand Down Expand Up @@ -59,12 +58,6 @@ class DotDict(dict):
WRAPPER_REGISTRY = FrameworkWrapperRegistry()


@pytest.mark.parametrize('os', [['Linux', 'python3'], ['Windows', 'python']])
def test_python_version(os, mocker):
mocker.patch('platform.system', return_value=os[0])
assert ProcessHandler.get_cmd_python_version() == os[1]


@pytest.mark.parametrize('inference_framework', [['OpenVINO DLDT', OpenVINOProcess],
['Caffe', IntelCaffeProcess],
['TensorFlow', TensorFlowProcess],
Expand Down
27 changes: 27 additions & 0 deletions src/deployment/jenkins/logger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import logging as log
import sys


DEFAULT_FORMATTER = log.Formatter('[ %(levelname)s ] %(message)s')


def configure_logger(name='', level=log.INFO, use_default_formatter=False):

logger = log.getLogger()
logger.setLevel(level)

if logger.hasHandlers():
logger.handlers.clear()

stream_handler = log.StreamHandler(stream=sys.stdout)
stream_handler.setLevel(level)
stream_handler.setFormatter(DEFAULT_FORMATTER)
logger.addHandler(stream_handler)

file_handler = log.FileHandler(name, 'w')
file_handler.setLevel(level)
file_handler.setFormatter(DEFAULT_FORMATTER)
logger.addHandler(file_handler)

logger.propagate = False
return logger
8 changes: 8 additions & 0 deletions src/deployment/jenkins/models_template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resnet50;;resnet-50-pytorch/resnet50-19c8e357.pth;torch;3 224 224;1,2,8;data
efficientnet-b0;efficientnet-b0/efficientnet-b0.onnx;;onnx;224 224 3;1,2,8;image
densenet-121-tf;densenet-121-tf/densenet-121-tf.onnx;;onnx;224 224 3;1,2,8;keras_tensor
googlenet-v4-tf;googlenet-v4-tf/inception_v4.onnx;;onnx;299 299 3;1,2,8;input
ssd_512_resnet50_v1_coco;;;mxnet;3 512 512;1,2,8;
ssd_512_vgg16_atrous_voc;;;mxnet;3 512 512;1,2,8;
ssd_300_vgg16_atrous_voc;;;mxnet;3 300 300;1,2,8;
ssd_512_mobilenet1.0_coco;;;mxnet;3 512 512;1,2,8;
11 changes: 11 additions & 0 deletions src/deployment/jenkins/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
traitlets==5.9.0
decorator
attrs
typing-extensions
psutil
scipy
pybind11
numpy
opencv-python
scipy
openvino-dev==2024.3.0
Loading
Loading