Commands for Starting and Stopping StreamServer

  1. Set the environment variables of Vision SDK and CANN.
    1. Run the CANN configuration script for the environment variables to take effect. Use the actual installation path.
      . $HOME/Ascend/cann/set_env.sh
    2. Set Vision SDK environment variables.
      source ${MX_SDK_HOME}/set_env.sh
  2. Execute the startup command. During the startup, main.py in the ${MX_SDK_HOME}/samples/mxVision/streamserver/streamserverSourceCode directory is called.
    bash run.sh  <ca.crt_path>  <server.crt_path>  <server.key_path>  <crl_path>
    • Each time before the HTTPS service is started, the startup script uses the certificate import script to import the CA certificate and encrypt the certificate password. For details about how to create a certificate, see Self-signed Certificate Creation Methods. For details about how to import and encrypt a certificate, see Example of Generating and Importing Certificates and Keys.
    • Key-related operations are required for enabling the HTTPS service, so ensure that the current user has the permission to read related configuration files, key files, and certificate files.
    • The script execution file is stored in $MX_SDK_HOME/samples/mxVision/streamserver.
    • <ca.crt_path> indicates the path of the CA certificate, <server.crt_path> indicates the path of the server certificate, <server.key_path> indicates the path of the server certificate key, and <crl_path> indicates the path of the CRL. Pass them in sequence. Note that <crl_path> is optional.
  3. Stop StreamServer.

    The SIGINT signal is registered for the StreamServer process. Therefore, you can stop the StreamServer process in either of the following ways:

    • Press Ctrl+C in the CLI.
    • Run the kill -SIGINT ${PID} command, where ${PID} indicates the StreamServer process ID. If a process is suspended, restore the process and then run the kill -SIGINT ${PID} command to stop the process.
    • The StreamServer inference service is only a component instead of a complete system. It needs to be integrated into your system. You need to control the startup, stop, and restart (only upon exceptions) of the inference service. The StreamServer inference service does not have a restart mechanism, so its restart function is controlled by your system.
    • To obtain the StreamServer process ID, run netstat -tlnp and find ${PID} of the Python 3 program whose port number is the same as that specified by port in the StreamServer configuration file.