Contents¶
Run the Web Deployment Tool Back End¶
Web Deployment Tool (WDT) provides a graphical interface to set up and complete the deployment process for EII services. The following sections provide details for the prerequisites and configuration for the Web GUI Deployment tool back end.
Prerequisites¶
Ensure that all the prerequisites for EII are installed. For more information, refer to the EII ReadMe.
Configuration¶
The back end server runs on the port value that you enter for the env variable DEPLOYMENT_TOOL_BACKEND_PORT
in the docker-compose.yml
file. Also, based on the value for the env variable dev_mode
in the docker-compose.yml
file, the back-end server will run in the DEV mode
(http/insecure) or the PROD mode
(https/secure). By default, the PROD mode is enabled. The following snippet shows the default value for the env variable dev_mode
:
dev_mode: "false"
Configure Logging¶
Web Deployment Tool supports the following log levels:
Debug
Info
Error
In the docker-compose.yml
file, you can set the env variable LOG_LEVEL
to configure logging. Refer to the following code snippet:
LOG_LEVEL: "INFO"
Note
You must enter your user credentials in the ./creds.json
file to log in to the Web Deployment Tool’s back end. You must use the same user credentials to access the frontend of the Web Deployment tool. Refer to the following code snippet for the JSON format of the user credentials:
Make Sure EII Service Credentials are in place in .env([WORK_DIR]/IEdgeInsights/build/.env
) file, refer to the EII ReadMe for more details.
{
"username" : "password"
}
Run the Web Deployment Tool¶
Perform the steps mentioned in this section to run the Web Deployment Tool.
Run the Container without Building¶
To run the container without building it, run the following commands:
cd [WORKDIR]/IEdgeInsights/DeploymentToolBackend
./run.sh
Build and Run the Container¶
To build and run the container, run the following commands:
./run.sh --build
or
./run.sh -b
To build and run with –no-cache or to provide any other build argument, you can append the build argument after running the previous commands.
For example:
./run.sh --build --no-cache
Note
If you are building the container for the first time, the Web Deployment Tool will prompt you for the host credentials and the credentials for the SSH key generation. The host user is then added to the sudoers with the NOPASSWORD option. This is for the container to seamlessly interact with the host.
Restart the Container¶
Run any the following commands to restart the container:
./run.sh --restart
or
./run.sh -r
Bring Down the Container¶
Run any of the following commands to bring down the container:
./run.sh --down
or
./run.sh -d
Web Deployment Tool API Documentation¶
The Web Deployment Tool auto-generates the OpenAPI documentation for all the REST APIs it exposes. This documentation can be accessed at its /docs endpoint.
For example:
https://127.0.0.1:5100/docs
Uninstall Web Deployment Tool Back End¶
To completely remove the Web Deployment Tool backend, project files and other files created on the host machine by the tool, run the uninstall.sh script as follows:
./uninstall.sh
Running Unit Tests¶
Unit tests are available under [WORK_DIR]/IEdgeInsights/DeploymentToolBackend/tests directory. These can be executed using PyTest. To start with, user needs to install PyTest utility, if not already done.
Run the following command to install PyTest:
$ pip3 install --user pytest
You need to configure tests/config.ini with various values needed for the test.
For example,
[backend]
# IP address of the machine where backend is running
ip = 127.0.0.1
# Port at which backend is running. Refer to the corresponding
# docker-compose.yml to get the port value. Default value is 5100
port = 5100
# Backend login credentials.
# Please refer to the correspnding creds.json to know the credentails.
username = admin
password = admin@123
[deploy_target]
# IP address of the machine where the remote deployment will be made.
ip = 10.10.1.1
# Credentails for the remote machine
username = testuser
password = testpassword
# Directory path in the remote machine, where the deployment files will be copied.
dir = /home/testuser/deploy
# Docker image names of the services that will be copied to the remote machine.
# At least one image name need to be specified
images = ["edgeinsights/ia_configmgr_agent:4.0.0"]
To run the unit tests, execute the following commands:
$ cd [WORK_DIR]/IEdgeInsights/DeploymentToolBackend/tests
# pytest -v .
You may also run the tests individually. For example,
$ pytest -v test_basic.py
# pytest -v test_build_deploy.py
More information on PyTest is available at https://docs.pytest.org/en/6.2.x/contents.html