(Optional) Creating an Independent WAAS Booster RPM Package
Some deployment environments do not support network connections. As a result, the dependencies required by WAAS Booster cannot be installed. This section describes how to create an environment-independent RPM package.
- The host where the RPM package is created must be able to access the external network.
- For the root user, directly run the following commands. For a common user, add sudo before the following commands to elevate the permission.
- Install the dependencies required for running the software.
1yum install -y python rpm-build cpio
- Download the Miniconda3 installation script.
- Install Miniconda3 with default configuration.
sh Miniconda3-py310_25.1.1-2-Linux-aarch64.sh
- Configure the path to the Miniconda3 binary in /etc/profile.
- Open the file.
vim /etc/profile
- Add the following content to the end of the file:
export PATH=$PATH:/root/miniconda3/bin/
- Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
- Make the file take effect.
source /etc/profile
- Open the file.
- Initialize the created conda environment.
1conda init - Exit the current SSH window and reconnect to the SSH window to ensure that conda takes effect.
If the base environment is displayed after you re-enter the SSH window, run the conda deactivate command to exit the base environment. If the base environment is not displayed, no operation is required.
- Use conda to create a Python environment, for example, waasbooster_env.
- Add conda-forge channels.
conda config --add channels conda-forge
- Use conda-forge to create a Python environment.
conda create -n waasbooster_env python=3.9.9 -c conda-forge
- Add conda-forge channels.
- Check the waasbooster_env environment path.
1conda env list
The command output is as follows:

- Run the following command to go to the specified virtual environment:
conda activate waasbooster_env
- Create a requirements.txt file and add the following content to the file:
numpy==1.23.4 pandas==2.2.3 prophet==1.1.7
- Run the following command to install the dependencies:
1pip3 install -r requirements.txt
- Create and go to the WAAS Booster RPM compilation path, for example, /home/waasbooster_rpm_build.
- Create a path.
1mkdir /home/waasbooster_rpm_build - Access the path.
1cd /home/waasbooster_rpm_build
- Create a path.
- Copy the conda environment file to the RPM compilation path.
1cp -r /root/miniconda3/envs/waasbooster_env/ /home/waasbooster_rpm_build/
- Obtain and decompress the WAAS software installation package waas-waasbooster.zip.
For details about how to obtain the package, see OS and Software Requirements.
1unzip waas-waasbooster.zip - Copy the main program folder waasbooster.
1cp -r waas-waasbooster/src/waasbooster/ /home/waasbooster_rpm_build/
- Modify the waasbooster.service file.
- Open the waasbooster.service file.
vim /home/waasbooster_rpm_build/waasbooster/waasbooster.service
- Press i to enter the insert mode.
Change
ExecStart=/usr/local/waasbooster/bin/python3 /usr/local/waasbooster/waas_booster.py
to
ExecStart=/usr/local/waasbooster/waasbooster_env/bin/python3 /usr/local/waasbooster/waas_booster.py
- Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
- Open the waasbooster.service file.
- Create files and save the specified content.
For the root user, directly run the following commands. For a common user, add sudo before the following commands to elevate the permission.
- Create a build.sh file and add the following content to the file:
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
#!/bin/bash # ******************************************************************************** # # Copyright Huawei Technologies Co., Ltd. 2023-2024. All rights reserved. # File Name: build.sh # Description: main script to be called for compilation and building # Usage: sh build.sh clean --> Clean the environment. # sh build.sh build_debug --> Deploy the debugging environment. (You need to install the server and configure the WAAS_HOME environment variable first.) # sh build.sh build_package --> Perform packaging. # ******************************************************************************** # CURRENT_DIR=$(dirname $(readlink -f "$0")) BUILD_DIR=${CURRENT_DIR}/build mkdir -p ${BUILD_DIR} mkdir -p ${CURRENT_DIR}/output function clean() { rm -rf ${BUILD_DIR}/rpmbuild/* rm -rf ${CURRENT_DIR}/build rm -rf ${CURRENT_DIR}/output rm -rf ${CURRENT_DIR}/debug } function build_booster_package() { clean cd ${CURRENT_DIR}/ mkdir -p ${BUILD_DIR}/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} rm -rf build/rpmbuild/BUILDROOT/* cp -rf waasbooster_env ${BUILD_DIR}/rpmbuild/SOURCES build_waas_booster } function build_waas_booster() { mkdir -p ${CURRENT_DIR}/output cp waas_booster.spec ${BUILD_DIR}/rpmbuild/SPECS/ find waasbooster -name '__pycache__' | xargs rm -rf zip -r ${BUILD_DIR}/rpmbuild/SOURCES/waasbooster.zip \ waasbooster/* \ waasbooster_env/* rpmbuild --define "_topdir ${BUILD_DIR}/rpmbuild" -v -ba ${BUILD_DIR}/rpmbuild/SPECS/waas_booster.spec --undefine=py_auto_byte_compile cp ${BUILD_DIR}/rpmbuild/RPMS/aarch64/waasbooster-1.0.0-1.aarch64.rpm ./output/waasbooster-1.0.0-1.aarch64.rpm } main() { item=$1 eval ${item} } main "$@" exit $?
- Create a waas_booster.spec file and add the following content to the file:
%define projectdir /usr/local/waasbooster Name: waasbooster Version: 1.0.0 Release: 1%{?dist} Summary: Load awareness License: FIXME BuildArch: %{_build_arch} Vendor: Huawei Provides: waasbooster = 1.0.0 %description WAAS Booster is an online container quota tuning tool. %prep unzip %{_sourcedir}/waasbooster.zip %build %install mkdir -p %{buildroot}/usr/lib/systemd/system/ mkdir -p %{buildroot}/usr/bin/ mkdir -p %{buildroot}/%{projectdir} cp %{_builddir}/waasbooster/* %{buildroot}/%{projectdir} install -m 444 waasbooster/waasbooster.service %{buildroot}/usr/lib/systemd/system/waasbooster.service cp -r %{_sourcedir}/waasbooster_env %{buildroot}/usr/local/waasbooster %files %dir %attr(644, waas, waas) %{projectdir} %defattr (0440, waas, waas) %{projectdir}/* %dir %attr(644, waas, waas) %{projectdir} %attr(644, root, root) /usr/lib/systemd/system/waasbooster.service %dir %attr(750, waas, waas) /usr/local/waasbooster/waasbooster_env %{projectdir}/waasbooster_env/* #=======The preceding script is executed during packaging.======== #=======The following script is executed during installation and uninstallation.======== %pre -p /bin/sh getent group waas &> /dev/null || \ groupadd -r waas &> /dev/null getent passwd waas &> /dev/null || \ useradd -r -g waas -d /usr/local/waasbooster -s /sbin/nologin \ -c 'Waas booster' waas &> /dev/null if [ $SUDO_USER ]; then usermod -a -G waas $SUDO_USER elif [ $USER ]; then usermod -a -G waas $USER else usermod -a -G waas `whoami` fi exit 0 %post -p /bin/sh mkdir -p /var/waasbooster chown waas:waas /var/waasbooster chmod 750 /var/waasbooster mkdir -p /var/run/waasbooster_manager systemctl enable waasbooster.service chmod +x /usr/local/waasbooster/waasbooster_env/bin/python3 exit 0 %preun -p /bin/sh exit 0 %postun -p /bin/sh rm -rf /usr/local/waasbooster rm -rf /var/waasbooster rm -rf /var/run/waasbooster_manager exit 0
- Create a build.sh file and add the following content to the file:
- Compile the RPM package.
sh build.sh build_booster_package
The compilation result is output to the output folder in the compilation path, for example, /home/waasbooster_rpm_build/output/.
- Install the independent RPM package.
- You can deploy and run the installation package without installing the WAAS Booster operating environment.
- Add the --nodeps command when installing the RPM package. Otherwise, the RPM package cannot be installed.
rpm -ivh --nodeps /home/waasbooster_rpm_build/output/waasbooster-1.0.0-1.aarch64.rpm
- (Optional) Uninstall the independent RPM package.
rpm -e --nodeps waasbooster