Debian GNU/Linux: Difference between revisions
No edit summary |
No edit summary |
||
| (15 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
Following are the steps to install the toolchain on a Debian 11 system: | Following are the steps to install the toolchain on a Debian 11 system: | ||
== Main control application == | |||
Install the necessary packages for building and compiling Rust programs: | Install the necessary packages for building and compiling Rust programs: | ||
<code> | <code> | ||
| Line 42: | Line 43: | ||
Verify if control application, client application and test server can be build using <code>cargo build</code>. | Verify if control application, client application and test server can be build using <code>cargo build</code>. | ||
After installation of the [[SQL database]], you can proceed with the tests using <code>cargo test -- --test-threads=8</code>. | Create the message queues required for operation or testing by running <code>create_mqueues.sh</code> with root privileges. | ||
Create the folder for the file-based output matching to the .toml file configuration: <code>mkdir /var/local/aquarium-ctrl</code>. | |||
Create the lock file for the control application matching the .toml file configuration: <code>touch /var/local/aquarium-ctrl.pid</code> | |||
After installation of the [[SQL database| databases]], you can proceed with the tests using <code>cargo test -- --test-threads=8</code>. | |||
As of December 2024, running testing with more than eight threads may result in flaky test cases (failing randomly). | |||
During the first run, the application will fail to retrieve a hash from the database. | |||
The hash is used to compare against the hash of the executable. In case of mismatch, the control application issues a warning. | |||
For official releases, the databases will be provided with the hash of the release. | |||
For development purposes, you may need to enter a first hash into the database using | |||
<code>INSERT INTO VERSION VALUES(0, 1, 1, has_value_informed_from_terminal_output)</code> | |||
Make sure that major, minor and build number correspond to values from <code>Cargo.toml</code>. | |||
Run <code>cargo doc</code> to check if documentation can be build. | |||
== Client application == | |||
Run <code>cargo build</code> in the installation directory of the client. | |||
== Test server == | |||
Run <code>cargo build</code> in the installation directory of the client. | |||
Run <code>cargo test</code> in the installation directory of the client. | |||
== Start simulation run == | |||
First start the test server using <code>cargo run</code>, then start the main application: | |||
The configuration file <code>aquarium_control_demo_server.toml</code> is already prepared accordingly and needs to be provided as command line parameter when starting the main application: | |||
<code> | |||
cargo run config/aquarium_control_demo_server.toml | |||
</code> | |||
Alternatively, adapt the configuration file of the default configuration file <code>aquarium.toml</code>. Set all parameters named <code>use_simulator</code> to <code>true</code>. | |||
Latest revision as of 16:02, 30 December 2024
Following are the steps to install the toolchain on a Debian 11 system:
Main control application
Install the necessary packages for building and compiling Rust programs:
sudo apt install build-essential curl -y
Install additional packages:
sudo apt install libssl-dev pkg-config
sudo apt install libudev-dev
Download and install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Update current shell:
source ~/.cargo/env
Verify Rust installation:
rustc --version
As of December 2024, Rust version is 1.83.0.
Install git:
apt-get install git
Clone the git repositories into /usr/local/src:
- Main control application:
git clone https://in-dubio@bitbucket.org/in-dubio/aquarium_control.git - Client application:
git clone https://in-dubio@bitbucket.org/in-dubio/aquarium_client.git - Test server:
git clone https://in-dubio@bitbucket.org/in-dubio/aquarium_test_server.git - Databases
Verify if control application, client application and test server can be build using cargo build.
Create the message queues required for operation or testing by running create_mqueues.sh with root privileges.
Create the folder for the file-based output matching to the .toml file configuration: mkdir /var/local/aquarium-ctrl.
Create the lock file for the control application matching the .toml file configuration: touch /var/local/aquarium-ctrl.pid
After installation of the databases, you can proceed with the tests using cargo test -- --test-threads=8.
As of December 2024, running testing with more than eight threads may result in flaky test cases (failing randomly).
During the first run, the application will fail to retrieve a hash from the database. The hash is used to compare against the hash of the executable. In case of mismatch, the control application issues a warning. For official releases, the databases will be provided with the hash of the release. For development purposes, you may need to enter a first hash into the database using
INSERT INTO VERSION VALUES(0, 1, 1, has_value_informed_from_terminal_output)
Make sure that major, minor and build number correspond to values from Cargo.toml.
Run cargo doc to check if documentation can be build.
Client application
Run cargo build in the installation directory of the client.
Test server
Run cargo build in the installation directory of the client.
Run cargo test in the installation directory of the client.
Start simulation run
First start the test server using cargo run, then start the main application:
The configuration file aquarium_control_demo_server.toml is already prepared accordingly and needs to be provided as command line parameter when starting the main application:
cargo run config/aquarium_control_demo_server.toml
Alternatively, adapt the configuration file of the default configuration file aquarium.toml. Set all parameters named use_simulator to true.