-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathstart_demo.ps1
51 lines (40 loc) · 1.57 KB
/
start_demo.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#################################################################################
# Copyright (c) 2022 IBM Corporation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#################################################################################
#####################################################################################
# Pre-requisites:
# Must have python 3.7 installed and 'python3.7' in your PATH
# Must have docker-compose on PATH
# Must have docker service running
#####################################################################################
function Test-GameServerHealth {
try {
Invoke-RestMethod -Uri http://localhost:9070/health;
return $true;
}
catch {
Write-Output $_
return $false;
}
}
docker-compose -f services/docker-compose.yml down
docker-compose -f services/docker-compose.yml up -d
$VenvPath = "$env:TEMP\space-rover-venv"
if (-not(Test-Path -Path $VenvPath -PathType Leaf)) {
echo "Creating venv for space rover gesture control service in $env:TEMP\space-rover-venv"
python3.7 -m venv $VenvPath
}
& "$VenvPath\Scripts\Activate.ps1"
pip install -r gestures/openCV_implementation/src/requirements.txt
while (-not(Test-GameServerHealth)) {
Start-Sleep -Seconds 5
Write-Output "Waiting for games service to come online"
}
python gestures/openCV_implementation/src/GestureRecognitionCVv2.py
deactivate