Skip to content

Commit

Permalink
Splitting rita into seperate crates in order to increase modularity a…
Browse files Browse the repository at this point in the history
…nd open source a portion

Rita was split into 4 different crates each of which call the settings crate. The settings
crate was modified to include lazy statics that allow for global mutation of a reference dynamic-
ally. This was done in order to properly split up the crates while somewhat preserving modularity.
Additionally, rita_common was modified to include some references such as ki in order to allow
individual crates to import the neccessary information.

All binaries were modified to remove the unused imports and local lazy
static variables that are now hosted in settings.

This refactor introduced a lot of bugs that were spotted by the integration and unit tests. The
full test suite passes, but there definitely may still be bugs/undesired behavior occurring.

Finally, the read me was modified to reflect a possible oversight that running integration test
will not actually compare to local files and the boilerplate rita tower
code was integrated into this patch.
  • Loading branch information
kennethAltheaSystems authored and jkilpatr committed Aug 26, 2021
1 parent 87375d1 commit 06559d6
Show file tree
Hide file tree
Showing 110 changed files with 3,317 additions and 2,229 deletions.
206 changes: 124 additions & 82 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ authors = ["Stan Drozd <[email protected]>"]
edition = "2018"

[features]
development = ["rita/development"]
dash_debug = ["rita/dash_debug"]
server = ["rita/server"]
bundle_openssl = ["rita/bundle_openssl"]
jemalloc = ["rita/jemalloc"]
development = ["rita_bin/development"]
dash_debug = ["rita_bin/dash_debug"]
server = ["rita_bin/server"]
bundle_openssl = ["rita_bin/bundle_openssl"]
jemalloc = ["rita_bin/jemalloc"]

[dependencies]
rita = { path = "./rita" }
rita_bin = { path = "./rita_bin" }

[workspace]
members = ["althea_kernel_interface", "settings", "clu", "exit_db", "antenna_forwarding_client", "antenna_forwarding_protocol", "auto_bridge", "babel_monitor_legacy"]
members = ["althea_kernel_interface", "settings", "clu", "exit_db", "antenna_forwarding_client", "antenna_forwarding_protocol", "auto_bridge", "babel_monitor_legacy","rita_common","rita_exit","rita_tower","rita_client"]

[profile.release]
opt-level = "z"
Expand Down
7 changes: 5 additions & 2 deletions althea_kernel_interface/src/hardware_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ pub fn get_hardware_info(device_name: Option<String>) -> Result<HardwareInfo, Er
};

let system_uptime = get_sys_uptime()?;
let line = get_kernel_version()?;
let (entire_system_kernel_version, system_kernel_version) = parse_kernel_version(line)?;

let system_kernel_version = get_kernel_version()?;
let (entire_system_kernel_version, system_kernel_version) =
parse_kernel_version(system_kernel_version)?;

Ok(HardwareInfo {
logical_processors: num_cpus,
Expand All @@ -47,6 +49,7 @@ pub fn get_hardware_info(device_name: Option<String>) -> Result<HardwareInfo, Er
entire_system_kernel_version,
})
}

fn get_kernel_version() -> Result<String, Error> {
let sys_kernel_ver_error = Err(Error::FailedToGetSystemKernelVersion);

Expand Down
Loading

0 comments on commit 06559d6

Please sign in to comment.