Skip to content
This repository was archived by the owner on Aug 28, 2023. It is now read-only.

Commit 668f639

Browse files
authored
[76862] [101797] Unskip deployment tests with clean Ubuntu (#135)
1 parent f5c55df commit 668f639

File tree

12 files changed

+59
-139
lines changed

12 files changed

+59
-139
lines changed

client/e2e/src/deployment-manager.e2e-spec.ts

-60
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ describe('UI tests on Packing project.', () => {
3838
await browser.refresh();
3939
});
4040

41-
it('Select all target, model not include.', async () => {
42-
const packingModel = new PackingModel();
43-
packingModel.CPU = true;
44-
packingModel.GPU = true;
45-
packingModel.VPU = true;
46-
await testUtils.loadPack(packingModel);
47-
});
48-
4941
it('Select only CPU, model not include', async () => {
5042
const packingModel = new PackingModel();
5143
packingModel.CPU = true;
@@ -58,42 +50,13 @@ describe('UI tests on Packing project.', () => {
5850
await testUtils.loadPack(packingModel);
5951
});
6052

61-
it('Select only VPU, model not include', async () => {
62-
const packingModel = new PackingModel();
63-
packingModel.VPU = true;
64-
await testUtils.loadPack(packingModel);
65-
});
66-
6753
it('Select CPU and GPU, model not include', async () => {
6854
const packingModel = new PackingModel();
6955
packingModel.CPU = true;
7056
packingModel.GPU = true;
7157
await testUtils.loadPack(packingModel);
7258
});
7359

74-
it('Select CPU and VPU, model not include', async () => {
75-
const packingModel = new PackingModel();
76-
packingModel.CPU = true;
77-
packingModel.VPU = true;
78-
await testUtils.loadPack(packingModel);
79-
});
80-
81-
it('Select GPU and VPU, model not include', async () => {
82-
const packingModel = new PackingModel();
83-
packingModel.GPU = true;
84-
packingModel.VPU = true;
85-
await testUtils.loadPack(packingModel);
86-
});
87-
88-
it('Select CPU, GPU and VPU, model include', async () => {
89-
const packingModel = new PackingModel();
90-
packingModel.CPU = true;
91-
packingModel.GPU = true;
92-
packingModel.VPU = true;
93-
packingModel.includeModel = true;
94-
await testUtils.loadPack(packingModel, modelFile.name);
95-
});
96-
9760
it('Select only CPU, model include', async () => {
9861
const packingModel = new PackingModel();
9962
packingModel.CPU = true;
@@ -108,13 +71,6 @@ describe('UI tests on Packing project.', () => {
10871
await testUtils.loadPack(packingModel, modelFile.name);
10972
});
11073

111-
it('Select only VPU, model include', async () => {
112-
const packingModel = new PackingModel();
113-
packingModel.VPU = true;
114-
packingModel.includeModel = true;
115-
await testUtils.loadPack(packingModel, modelFile.name);
116-
});
117-
11874
it('Select CPU and GPU, model include', async () => {
11975
const packingModel = new PackingModel();
12076
packingModel.CPU = true;
@@ -123,22 +79,6 @@ describe('UI tests on Packing project.', () => {
12379
await testUtils.loadPack(packingModel, modelFile.name);
12480
});
12581

126-
it('Select CPU and VPU, model include', async () => {
127-
const packingModel = new PackingModel();
128-
packingModel.CPU = true;
129-
packingModel.VPU = true;
130-
packingModel.includeModel = true;
131-
await testUtils.loadPack(packingModel, modelFile.name);
132-
});
133-
134-
it('Select GPU and VPU, model include', async () => {
135-
const packingModel = new PackingModel();
136-
packingModel.GPU = true;
137-
packingModel.VPU = true;
138-
packingModel.includeModel = true;
139-
await testUtils.loadPack(packingModel, modelFile.name);
140-
});
141-
14282
it('should select CPU and GPU, model include, select Ubuntu 20, export project', async () => {
14383
const packingModel = new PackingModel();
14484
packingModel.CPU = true;

client/e2e/src/pages/packaging.po.ts

-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { TestUtils } from './test-utils';
77
export class PackingModel {
88
CPU: boolean;
99
GPU: boolean;
10-
VPU: boolean;
1110
includeModel: boolean;
1211
baseName: string;
1312
projectId: number;
@@ -16,7 +15,6 @@ export class PackingModel {
1615
constructor() {
1716
this.CPU = false;
1817
this.GPU = false;
19-
this.VPU = false;
2018
this.includeModel = false;
2119
this.projectId = -1;
2220
this.os = OSTypeNames.UBUNTU18;
@@ -59,9 +57,6 @@ export class PackingSheet {
5957
if (packing.GPU) {
6058
name += 'GPU_';
6159
}
62-
if (packing.VPU) {
63-
name += 'VPU_';
64-
}
6560
if (packing.includeModel) {
6661
name += `with_model_${modelName}`;
6762
} else {

client/e2e/src/pages/test-utils.ts

+14-18
Original file line numberDiff line numberDiff line change
@@ -447,17 +447,20 @@ export class TestUtils {
447447
console.log('waiting for project to become ready');
448448
await browser.wait(this.until.presenceOf(this.inferenceCard.projectInfoContainer), browser.params.defaultTimeout);
449449
const isReady = await browser
450-
.wait(async () => {
451-
const result = await this.inferenceCard.isProjectReady();
452-
switch (result) {
453-
case 'done':
454-
return true;
455-
case 'error':
456-
throw new Error('Project fail');
457-
default:
458-
return false;
459-
}
460-
}, Number(jasmine.DEFAULT_TIMEOUT_INTERVAL / browser.params.calibrationCoefficient))
450+
.wait(
451+
async () => {
452+
const result = await this.inferenceCard.isProjectReady();
453+
switch (result) {
454+
case 'done':
455+
return true;
456+
case 'error':
457+
throw new Error('Project fail');
458+
default:
459+
return false;
460+
}
461+
},
462+
Number(jasmine.DEFAULT_TIMEOUT_INTERVAL / browser.params.calibrationCoefficient)
463+
)
461464
.catch((error) => {
462465
console.log(error);
463466
return false;
@@ -717,13 +720,6 @@ export class TestUtils {
717720
console.log('click GPU');
718721
}
719722
break;
720-
case 'VPU':
721-
needClick = !(await this.isChecked(this.packingSheet.vpuCheckBox));
722-
if ((needClick && selectedPackingModel) || (!needClick && !selectedPackingModel)) {
723-
await this.packingSheet.vpuCheckBox.click();
724-
console.log('click VPU');
725-
}
726-
break;
727723
case 'includeModel':
728724
if (selectedPackingModel) {
729725
await this.packingSheet.includeModel.click();

client/src/app/modules/dashboard/components/deployment-manager/deployment-manager.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class DeploymentManagerComponent implements OnDestroy {
4848

4949
public deploymentForm: UntypedFormGroup;
5050
public estimatedSize: number;
51-
public devices: DeviceTargetType[] = [DeviceTargets.CPU, DeviceTargets.GPU, DeviceTargets.MYRIAD, DeviceTargets.HDDL];
51+
public devices: DeviceTargetType[] = [DeviceTargets.CPU, DeviceTargets.GPU];
5252
public osTypes: TargetOSType[] = [OSTypeNames.UBUNTU18, OSTypeNames.UBUNTU20];
5353
public packageSizes: PackageSizeInfo;
5454
public selectedTargets: DeviceTargetType[];

docker/local/build_image.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ if [[ -z ${IMAGE_TAG} ]]; then
4545
fi
4646

4747
if [[ -z ${PACKAGE_LINK} ]]; then
48-
PACKAGE_LINK="https://storage.openvinotoolkit.org/repositories/openvino/packages/2022.2/linux/l_openvino_toolkit_ubuntu20_2022.2.0.7713.af16ea1d79a_x86_64.tgz"
48+
PACKAGE_LINK="https://storage.openvinotoolkit.org/repositories/openvino/packages/2022.3/linux/l_openvino_toolkit_ubuntu20_2022.3.0.9052.9752fafe8eb_x86_64.tgz"
4949
fi
5050

5151
set -e
52+
set -x
5253

5354
echo -e "${TERMINAL_COLOR_MESSAGE} The script must be run from the root folder of the Workbench ${TERMINAL_COLOR_CLEAR}"
5455
echo -e "${TERMINAL_COLOR_MESSAGE} Also install 'NVM' from the repository 'https://github.com/nvm-sh/nvm' and install the client dependencies in the client folder with the following command: 'npm install'${TERMINAL_COLOR_CLEAR}"

tests/deployment_tests/Dockerfile

+16-8
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,32 @@ USER root
1212

1313
RUN mkdir -m 777 /tmp/packages /tmp/scripts /tmp/model
1414

15+
RUN useradd -ms /bin/bash ${USER_NAME}
16+
1517
RUN gpasswd -a ${USER_NAME} users && \
1618
gpasswd -a ${USER_NAME} video
1719

1820
COPY scripts/ ${SCRIPTS_FOLDER}
1921
COPY packages/ ${LIB_FOLDER}
2022
COPY model/ ${MODEL_FOLDER}
2123

22-
RUN rm /etc/apt/sources.list.d/github_git-lfs.list
2324
RUN apt-get update && \
24-
apt install -y --no-install-recommends apt-utils \
25+
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends apt-utils \
26+
software-properties-common \
2527
build-essential \
2628
libssl-dev \
27-
libffi-dev \
28-
python3-pip \
29-
python3-setuptools \
30-
python3-dev
31-
32-
RUN python3 -m pip install pip==19.3.1
29+
libpugixml-dev \
30+
libtbb2 \
31+
libffi-dev && \
32+
add-apt-repository -y ppa:deadsnakes && \
33+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3.8 && \
34+
rm -rf /usr/bin/python /usr/bin/python3 && \
35+
ln -s /usr/bin/python3.8 /usr/bin/python && \
36+
ln -s /usr/bin/python3.8 /usr/bin/python3 && \
37+
DEBIAN_FRONTEND=noninteractive apt-get install -y python3.8-venv python3-pip python3-setuptools python3.8-dev python3-opencv && \
38+
apt-get clean && rm -rf /var/lib/apt/lists/*
39+
40+
RUN python3 -m pip install --upgrade pip
3341

3442
RUN ${LIB_FOLDER}/scripts/setup.sh
3543

tests/deployment_tests/ie_sample/CMakeLists.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ cmake_minimum_required(VERSION 3.10)
22

33
project(ie_sample)
44

5-
set(CMAKE_CXX_STANDARD 14)
5+
set(CMAKE_CXX_STANDARD 11)
66

77
set(IE_SAMPLE_NAME ie_sample)
88

9-
find_package(InferenceEngine 2.1 REQUIRED)
9+
find_package(OpenVINO REQUIRED)
1010

11-
add_executable(${IE_SAMPLE_NAME} main.cpp ${IE_SAMPLE_SOURCES} ${IE_SAMPLES_HEADERS})
11+
add_executable(${IE_SAMPLE_NAME} main.cpp)
1212

13-
target_link_libraries(${IE_SAMPLE_NAME} PUBLIC ${InferenceEngine_LIBRARIES})
13+
target_link_libraries(${IE_SAMPLE_NAME} PUBLIC openvino::runtime)

tests/deployment_tests/ie_sample/main.cpp

+12-32
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <inference_engine.hpp>
1+
#include "openvino/openvino.hpp"
22
#include <vector>
33

44
using namespace InferenceEngine;
@@ -21,7 +21,7 @@ int main(int argc, char *argv[]) {
2121

2222
std::transform(device.begin(), device.end(), device.begin(), ::toupper);
2323

24-
Core ie;
24+
ov::Core core;
2525

2626
// ___GPU___
2727
// | | |
@@ -36,27 +36,13 @@ int main(int argc, char *argv[]) {
3636
// |___ ___|
3737

3838
// start Set number of streams
39-
if (device == "CPU") {
40-
ie.SetConfig({{CONFIG_KEY(CPU_THROUGHPUT_STREAMS), std::to_string(numInferReq)}}, device);
41-
}
42-
43-
if (device == "GPU") {
44-
int numStreams = numInferReq;
45-
if (numStreams % 2) {
46-
numStreams++;
47-
}
48-
ie.SetConfig({{CONFIG_KEY(GPU_THROUGHPUT_STREAMS), std::to_string(numStreams)}}, device);
49-
}
50-
// end Set number of streams
51-
52-
CNNNetwork network = ie.ReadNetwork(modelXml);
39+
core.set_property(device, {{"NUM_STREAMS", std::to_string(numInferReq)}});
5340

54-
// set batch
55-
network.setBatchSize(batchSize);
41+
auto model = core.read_model(modelXml);
5642

57-
ExecutableNetwork executableNetwork = ie.LoadNetwork(network, device);
43+
ov::CompiledModel compiled_model = core.compile_model(model, device);
5844

59-
std::vector<InferRequest> requests(numInferReq);
45+
std::vector<ov::InferRequest> requests(numInferReq);
6046

6147
std::vector<int> runs(numInferReq);
6248

@@ -66,25 +52,19 @@ int main(int argc, char *argv[]) {
6652
// create InferRequests
6753
for (std::size_t i = 0; i < numInferReq; i++) {
6854
// create an InferRequest
69-
requests[i] = executableNetwork.CreateInferRequest();
70-
requests[i].SetCompletionCallback([i, &requests, &runs, maxNumRuns]() {
71-
auto status = requests[i].Wait(IInferRequest::WaitMode::STATUS_ONLY);
72-
std::cout << "InferRequest #" << i;
73-
if (status != OK) {
74-
std::cout << " done ";
75-
} else {
76-
std::cout << " failed ";
77-
}
55+
requests[i] = compiled_model.create_infer_request();
56+
requests[i].set_callback([i, &requests, &runs, maxNumRuns](std::exception_ptr ex) {
57+
std::cout << "InferRequest #" << i << " ";
7858
runs[i] += 1;
7959
if (runs[i] < maxNumRuns) {
80-
std::cout << "and runs again";
60+
std::cout << "runs again";
8161
// run again the InferRequest
82-
requests[i].StartAsync();
62+
requests[i].start_async();
8363
}
8464
std::cout << std::endl;
8565
});
8666
// run the InferRequest
87-
requests[i].StartAsync();
67+
requests[i].start_async();
8868
}
8969

9070
while (true) {

tests/deployment_tests/scripts/copy_and_make_sample.sh

+4
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,15 @@ mkdir -m 777 ${DEPLOYMENT_MANAGER_PATH} \
4343

4444
cp ${OPENVINO_WORKBENCH_ROOT}/tests/deployment_tests/scripts/bundle.tar.gz ${DEPLOYMENT_MANAGER_PATH}/packages
4545
tar -xf ${OPENVINO_WORKBENCH_ROOT}/tests/deployment_tests/scripts/bundle.tar.gz -C ${DEPLOYMENT_MANAGER_PATH}/packages
46+
4647
cp ${OPENVINO_WORKBENCH_ROOT}/tests/deployment_tests/scripts/* ${DEPLOYMENT_MANAGER_PATH}/scripts
4748
cp ${OPENVINO_WORKBENCH_ROOT}/tests/deployment_tests/Dockerfile ${DEPLOYMENT_MANAGER_PATH}
4849
sed -i "s|BASE_IMAGE_UBUNTU|${UBUNTU_IMAGE}|g" ${DEPLOYMENT_MANAGER_PATH}/Dockerfile
4950
cp ${RESOURCES_PATH}/models/IR/classification/squeezenetV1.1/*.* ${DEPLOYMENT_MANAGER_PATH}/model
5051
cd ${OPENVINO_WORKBENCH_ROOT}/tests/deployment_tests/ie_sample/build
52+
53+
source ${DEPLOYMENT_MANAGER_PATH}/packages/setupvars.sh
54+
5155
cmake ..
5256
make
5357
cp ie_sample ${DEPLOYMENT_MANAGER_PATH}/scripts

tests/deployment_tests/scripts/execute_sample.sh

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ while (( "$#" )); do
1313
esac
1414
done
1515

16+
source ${LIB_FOLDER}/setupvars.sh
17+
1618
set -e
1719

1820
if [ ${DEVICE} == 'vpu' ]

tests/deployment_tests/scripts/get_bundle.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def get_artifact_id(hostname, access_token, tls, operating_system: str = 'ubuntu
7272
json_data = {
7373
"includeModel": False,
7474
"pythonBindings": True,
75-
"targets": ["CPU", "GPU", "VPU"],
75+
"targets": ["CPU", "GPU"],
7676
"installScripts": True,
7777
'targetOS': operating_system
7878
}
@@ -102,14 +102,14 @@ def get_bundle(artifact_id, hostname, access_token, tls):
102102
artifactId = None
103103
status = None
104104
access_token = get_access_token(arg.token, arg.hostname, arg.tls)
105-
for i in range(10):
105+
for i in range(5):
106106
data: dict = get_artifact_id(arg.hostname, access_token, arg.tls, arg.os)
107107
print(data)
108108
artifactId = data.get('artifactId', False)
109109
status = data.get('status', False)
110110
if artifactId and status == 'ready':
111111
break
112-
time.sleep(30)
112+
time.sleep(180)
113113
if artifactId and status == 'ready':
114114
bundle = get_bundle(artifactId, arg.hostname, access_token, arg.tls)
115115
bundle_path = '{}/bundle.tar.gz'.format(root_path)

0 commit comments

Comments
 (0)