Table of Contents |
---|
Introduction
IEC Akraino Edge Stack supports AR/VR applications. It could support AR/VR Algorithms that with GPU Modeling (i.e. modeling describes the process of forming the shape of an object) Compositing (e.g. Environmental Mapping, Tone Mapping) Rendering and Illumination Models Visualization of Large Volume 3D Models (e.g. Global Network Operations Center monitoring) Registration (e.g. Stitching data from distributed sources) Segmentation (e.g. Segmentation and detection for security monitoring). This IEC Type 4 AR/VR platform utilizes Tars for remote direct memory access control. In this document, we use Virtual Classroom as demo for IEC Type4. Virtual Classroom is an online learning environment that allows teachers and students to communicate and interact with each other in real time. We use WebGL, Three.js and JavaScript to develop Virtual Classroom application.
License
Apache License - V2
...
Upstream Deployment Guide
Installation for Tars Master
- Install CentOS 7.8
- Install IEC, refer to IEC Type1&2 Installation Guide for R2
- Install Tars, refer to https://tarscloud.github.io/TarsDocs_en/installation/source.html
1. Dependency install
yum install -y glibc-devel gcc gcc-c++ bison flex make cmake psmisc ncurses-devel zlib-devel openssl openssl-devel
...
If you have problems to install mysql with the above step, add the new mysql repository to local server with this yum command and then re-run the previous commands.
sudo yum localinstall https://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum install mariadb-server -y
## Configure mysql
systemctl start mariadb.service
systemctl enable mariadb.service
systemctl status mariadb.service
mysql -u root -p
grep "password" /var/log/mariadb/mariadb.log
ALTER USER 'root'@'localhost' IDENTIFIED BY '${your passwd}';
flush privileges;
2. Install develop environment for Tars
yum install -y npm
npm i -g pm2
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
source ~/.bashrc
nvm install v8.11.3
npm install -g pm2 --registry=https://registry.npm.taobao.org
mkdir Tars && cd Tars
git clone https://github.com/TarsCloud/TarsFramework.git --recursive
cd TarsFramework/build
chmod u+x build.sh
./build.sh prepare
./build.sh all
###Recompile if needed.###
./build.sh cleanall
./build.sh all
...
cd /usr/local
mkdir tars
mkdir app
chown ${normal user}:${normal user} ./tars/
chown ${normal user}:${normal user} ./app/
cd
cd Tars/TarsFramework/build/
./build.sh install or make install
The default install path is /usr/local/tars/cpp。
If you want to install on different path:
**modify tarscpp/CMakeLists.txt**
**modify TARS_PATH in tarscpp/servant/makefile/makefile.tars**
**modify DEMO_PATH in tarscpp/servant/script/create_tars_server.sh**
...
3.0 Firewall setup
firewall-cmd --zone=public --permanent --add-service=http
firewall-cmd --add-port 3000/tcp
firewall-cmd --add-port 3001/tcp
firewall-cmd --add-port 3306/tcp
3.1. Add user
mysql -u root -p
grant all on *.* to 'tarsAdmin'@'%' identified by 'Tars@2019' with grant option;
grant all on *.* to 'tarsAdmin'@'172.22.195.10' identified by 'Tars@2019' with grant option;
grant all on *.* to 'tarsAdmin'@'Node-1' identified by 'Tars@2019' with grant option;
flush privileges;
3.2 setup mysql privileges
mysql -u root -p
>use mysql
>select Host from user where User='root';
if shown as “localhost”,we can update as follwing command:
>update user set host = '%' where user ='root';
>FLUSH PRIVILEGES;
'%'update to the host IP,and then use mysql -u root -p --host '%ip' change back'%'
cd /Tars
git clone https://github.com/TarsCloud/TarsWeb.git
mv TarsWeb web
cp -rf web /usr/local/tars/cpp/deploy/
cd /usr/local/tars/cpp/deploy
chmod a+x linux-install.sh
./linux-install.sh MYSQL_HOST MYSQL_ROOT_PASSWORD INET REBUILD(false[default]/true) SLAVE(false[default]/true)
./linux-install.sh 192.168.1.10 our_PW eno1 false false admin 3306
Installation for Tars Agent(Jenkins Slave)
...
K8STARS is a convenient solution to run TARS services in Kubernetes, and it has the following characteristics:
- Maintain the native development capability of TARS;
- Automatic registration and configuration deletion of name service for TARS;
- Support smooth migration of original TARS services to K8S and other container platforms;
- Non intrusive design, no coupling relationship with operating environment.
How K8STARS works?
Three interfaces are added in the tarsregistry, which are used for automatic registration, heartbeat reporting and node offline. For details, please refer to interface definition。
A 'tarscli' command-line tool is provided to allocate ports, generate configuration, report heartbeat and node offline.
Deployment
- Deployment tars basic service
- Deployment service example
- Deploy sample simpleserver:
cd examples/simple && kubectl apply -f simpleserver.yaml
Example description:
- The image is created by the
examples/simple/dockerfile
file, and the basic image is created bycmd/tarscli/dockerfile
- start.sh:
tarscli genconf
in is used to generate the tars service startup configuration - server_ meta.yaml The file is used to configure the metadata of the service. For field information, please refer to
app/genconf/config.go
structureServerConf
. Endpoint defaults totcp -h ${local_ip} -p ${random_port}
, supports automatic filling of IP and random ports. -ased on Golang HelloWorld program TestApp.HelloGo See examples/README.md
3. Verify the deployment Login db_tars
, then execute select * from t_server_conf\G
The node information of simpleserver has been registered automatically.
Tars deployment directory structure
tarscli
based on environment variable TARS_PATH
(default/tars) to manage services. The directory functions are as follows:
${TARS_PATH}/bin
:Startup scripts and binaries${TARS_PATH}/conf
:Configuration file${TARS_PATH}/log
: Log file${TARS_PATH}/data
:Runtime, Cache file
About tarscli
tarscli
provides a set of command tools to facilitate container deployment of TARS services. Parameters can be specified through environment variables. For details, see tarscli help
.
Here are the sub commands supported by tarscli
genconf
is used to generate the startup configuration file of the TARS service. The supported environment variables are:TARS_APPLICATION
the application name specified. By default, the_ server_ meta.yaml
Read fromTARS_SERVER
is the service name specified by the_ server_ meta.yaml
Read fromTARS_BUILD_SERVER
the service name at compile time. It will be used when the compiled service name is different from the running service nameTARS_LOCATOR
can specify the address of registry. The default istars.tarsregistry.QueryObj@tcp -h tars-registry.tars-system.svc.cluster.local -p 17890
(address of service)TARS_SET_ID
can specify service setTARS_MERGE_Conf
can specify the configuration template file and merge the configuration into the service startup configuration file
supervisor
executes thegenconf
command by default, and then starts and monitors the service. The supported environment variables are:TARS_START_PATH
The startup script of the service$TARS_PATH/bin/start.sh
TARS_STOP_PATH
The stop script, by default, kill all service processes under path$TARS_PATH
TARS_REPORT_INTERVAL
reports the interval heartbeat to registryTARS_DISABLE_FLOW
whether to enable traffic when registering with registry. If it is not empty, it means it is off. It is enabled by defaultTARS_CHECK_INTERVAL
check the service status interval. If the status changes, it will be synchronized to the registry in real timeTARS_BEFORE_CHECK_SCRIPT
the shell command that runs before each checkTARS_CHECK_SCRIPT_TIMEOUT
the timeout to run the shell command before each checkTARS_PRESTOP_WAITTIME
turn off traffic - the waiting time before stopping the service. It is used for lossless changes. The default value is 80 seconds
hzcheck
is used to synchronize the service status and the pod status of k8s. You need to set thereadiness Probe
of pod totarscli hzcheck
commandprestop
is used to delete the configuration corresponding to the registry before the service exitsTARS_PRESTOP_WAITTIME
turn off traffic - the waiting time before stopping the service. It is used for lossless changes. The default value is 80 seconds
notify
is used to send management commands. The common commands are: tars.setloglevel/tars.pprof, etc
Basic services
TARS related basic services provide rich service governance functions. Please refer to baseserver for deployment.
Install Virtual Classroom BackEnd
...
Virtual Classroom demo includes two parts: (1) server side and (2) client side. The technologies used to develop these applications includes WebGL, Three.js and JavaScript.
The code could be find at:
git clone https://github.com/OpenVidu/openvidu-vr.git
...
sed -i 's/demos.openvidu.io/${Local_IP_Address}/g' app.js
To execute:
docker run --rm --name openvidu_server -d -p 4443:4443 -e openvidu.secret=MY_SECRET -e openvidu.publicurl=https://${Local_IP_Address}:4443/ openvidu/openvidu-server-kms
...