Skip to content

Commit

Permalink
Merge pull request #62 from Telecominfraproject/fix/pre_release_fixes
Browse files Browse the repository at this point in the history
Fix/pre release fixes
  • Loading branch information
Cahb authored Jul 4, 2024
2 parents 7fa2658 + 91ca720 commit bbbfe14
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ RUN --mount=type=bind,source=src,target=src \
--mount=type=cache,target=/usr/src/openlan-cgw/target \
--mount=type=cache,target=/usr/local/cargo/git/db \
--mount=type=cache,target=/usr/local/cargo/registry \
RUSTFLAGS="-g -C symbol-mangling-version=v0" cargo build --target x86_64-unknown-linux-gnu && \
cp target/x86_64-unknown-linux-gnu/debug/ucentral-cgw /usr/local/bin
cargo build --target x86_64-unknown-linux-gnu --release && \
cp target/x86_64-unknown-linux-gnu/release/ucentral-cgw /usr/local/bin

CMD ["echo", "CGW build finished successfully!"]

Expand Down
2 changes: 1 addition & 1 deletion run_cgw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ docker run \
-e CGW_DB_PASSWORD \
-e CGW_REDIS_HOST \
-e CGW_REDIS_PORT \
-e CGW_FEATURE_TOPOMAP_DISABLE \
-e CGW_FEATURE_TOPOMAP_ENABLE \
-e CGW_METRICS_PORT \
-e CGW_ALLOW_CERT_MISMATCH \
-d -t --network=host --name $2 $1 ucentral-cgw
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const CGW_DEFAULT_REDIS_HOST: &str = "localhost";
const CGW_DEFAULT_REDIS_PORT: u16 = 6379;
const CGW_DEFAULT_ALLOW_CERT_MISMATCH: &str = "no";
const CGW_DEFAULT_METRICS_PORT: u16 = 8080;
const CGW_DEFAULT_TOPOMAP_STATE: bool = true;
const CGW_DEFAULT_TOPOMAP_STATE: bool = false;

/// CGW server
pub struct AppArgs {
Expand Down Expand Up @@ -397,8 +397,8 @@ impl AppArgs {
Err(_) => CGW_DEFAULT_METRICS_PORT,
};

let feature_topomap_enabled: bool = match env::var("CGW_FEATURE_TOPOMAP_DISABLE") {
Ok(_) => false,
let feature_topomap_enabled: bool = match env::var("CGW_FEATURE_TOPOMAP_ENABLE") {
Ok(_) => true,
Err(_) => CGW_DEFAULT_TOPOMAP_STATE,
};

Expand Down Expand Up @@ -637,8 +637,8 @@ async fn main() -> Result<()> {
// Configure logger
setup_logger(args.log_level);

if !args.feature_topomap_enabled {
warn!("CGW_FEATURE_TOPOMAP_DISABLE is set, TOPO MAP feature will be disabled (realtime events / state processing)");
if args.feature_topomap_enabled {
warn!("CGW_FEATURE_TOPOMAP_ENABLE is set, TOPO MAP feature (unstable) will be enabled (realtime events / state processing) - heavy performance drop with high number of devices connected could be observed");
}

info!(
Expand Down
8 changes: 6 additions & 2 deletions utils/client_simulator/src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def parse_args():
parser.add_argument("-c", "--client-certs-path", metavar="PATH",
default="./certs/client",
help="path to client certificates directory")
parser.add_argument("-C", "--no-cert-check", type=bool, action='store_true',
parser.add_argument("-C", "--no-cert-check", action='store_true',
default=False,
help="do not check certificate")
parser.add_argument("-t", "--msg-interval", metavar="SECONDS", type=int,
Expand All @@ -78,13 +78,17 @@ def parse_args():

parsed_args = parser.parse_args()

no_cert_check = False
if parsed_args.no_cert_check is not None:
no_cert_check = True

args = Args(number_of_connections=parsed_args.number_of_connections,
masks=parsed_args.mac_mask,
ca_path=parsed_args.ca_cert,
cert_path=parsed_args.client_certs_path,
msg_interval=parsed_args.msg_interval,
msg_size=parse_msg_size(parsed_args.payload_size),
check_certs=not parsed_args.no_cert_check,
check_cert=not no_cert_check,
wait_for_sig=parsed_args.wait_for_signal)

if len(args.masks) == 0:
Expand Down
4 changes: 2 additions & 2 deletions utils/kafka_producer/src/cli_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def parse_args():
help="remove mac addrs from a group")
parser.add_argument("-T", "--topic", default="CnC",
help="kafka topic (default: \"CnC\")")
parser.add_argument("-s", "--bootstrap-server", metavar="ADDRESS", default="172.20.10.136:9092",
help="kafka address (default: \"172.20.10.136:9092\")")
parser.add_argument("-s", "--bootstrap-server", metavar="ADDRESS", default="127.0.0.1:9092",
help="kafka address (default: \"127.0.0.1:9092\")")
parser.add_argument("-m", "--send-message", metavar="JSON", type=str,
help="this message will be sent down from the GW to all devices "
"specified in the --send-to-mac")
Expand Down

0 comments on commit bbbfe14

Please sign in to comment.