Skip to content

Commit

Permalink
Update main
Browse files Browse the repository at this point in the history
  • Loading branch information
codebot committed Jul 18, 2024
2 parents 055a643 + 2412679 commit c4996c8
Show file tree
Hide file tree
Showing 121 changed files with 2,094 additions and 548 deletions.
25 changes: 23 additions & 2 deletions .gitlab/ci/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ e2e request and config validation:

.e2e-run:
resource_group: e2e-${GROUP}
timeout: 2h
timeout: 3 hours
image:
name: ${RETINA_REGISTRY_PREFIX}/launcher:${RETINA_VERSION}
entrypoint: ["/bin/sh", "-c"]
Expand Down Expand Up @@ -178,11 +178,32 @@ e2e request and config validation:
find . -iname "test_metrics.csv" -exec \
influx write --host $INFLUXDB_URL --token $INFLUXDB_TOKEN --org $INFLUXDB_ORG \
--bucket ci --file {} \;
# Artifact size
- echo -e "\e[0Ksection_start:`date +%s`:e2e_folder_section[collapsed=true]\r\e[0KLog folder's tree"
- |
print_tree() {
local dir="$1"
local prefix="$2"
# List directories first
find "$dir" -mindepth 1 -maxdepth 1 -type d | while read -r subdir; do
local size=$(du -sh "$subdir" | awk '{print $1}')
echo "${prefix}├── $(basename "$subdir") [$size]"
print_tree "$subdir" "$prefix│ "
done
# List files afterwards
find "$dir" -mindepth 1 -maxdepth 1 -type f | while read -r file; do
local size=$(du -sh "$file" | awk '{print $1}')
echo "${prefix}├── $(basename "$file") [$size]"
done
}
print_tree "tests/e2e/log/" ""
- echo -e "\e[0Ksection_end:`date +%s`:e2e_folder_section\r\e[0K"
- |
echo "*******************************************************************************************************************************"
echo "Test report ---> https://softwareradiosystems.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/tests/e2e/log//report.html"
echo "*******************************************************************************************************************************"
- du -hs tests/e2e/log/
needs:
- *retina-needs

Expand Down
2 changes: 1 addition & 1 deletion .gitlab/ci/e2e/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SRSGNB_REGISTRY_URI=registry.gitlab.com/softwareradiosystems/srsgnb
RETINA_REGISTRY_PREFIX=registry.gitlab.com/softwareradiosystems/ci/retina
RETINA_VERSION=0.51.7
RETINA_VERSION=0.51.8
UBUNTU_VERSION=24.04
AMARISOFT_VERSION=2023-09-08
SRSUE_VERSION=23.11
Expand Down
4 changes: 2 additions & 2 deletions .gitlab/ci/e2e/retina_request_viavi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
requests: 4Gi
limits: 4Gi
ephemeral-storage:
requests: "20G"
limits: "20G"
requests: "50G"
limits: "50G"
taints: ["purpose=ci-amd64-avx512-onprem"]
resources:
- type: emulator
Expand Down
3 changes: 2 additions & 1 deletion apps/cu/cu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@

#include "apps/services/application_message_banners.h"
#include "apps/services/application_tracer.h"
#include "apps/services/buffer_pool/buffer_pool_manager.h"
#include "apps/services/stdin_command_dispatcher.h"
#include "apps/units/cu_cp/cu_cp_unit_config_yaml_writer.h"
#include "apps/units/cu_up/cu_up_unit_config_yaml_writer.h"
Expand Down Expand Up @@ -253,7 +254,7 @@ int main(int argc, char** argv)
// TODO

// Setup size of byte buffer pool.
init_byte_buffer_segment_pool(cu_cfg.buffer_pool_config.nof_segments, cu_cfg.buffer_pool_config.segment_size);
app_services::buffer_pool_manager buffer_pool_service(cu_cfg.buffer_pool_config);

// Log CPU architecture.
// TODO
Expand Down
1 change: 1 addition & 0 deletions apps/cu/cu_appconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#pragma once

#include "apps/gnb/gnb_appconfig.h"
#include "apps/services/buffer_pool/buffer_pool_appconfig.h"
#include "apps/services/logger/logger_appconfig.h"
#include <string>

Expand Down
16 changes: 4 additions & 12 deletions apps/cu/cu_appconfig_cli11_schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/

#include "cu_appconfig_cli11_schema.h"
#include "apps/services/buffer_pool/buffer_pool_appconfig_cli11_schema.h"
#include "apps/services/logger/logger_appconfig_cli11_schema.h"
#include "cu_appconfig.h"
#include "srsran/support/cli11_utils.h"
Expand All @@ -43,19 +44,14 @@ static void configure_cli11_nru_args(CLI::App& app, srs_cu::cu_nru_appconfig& nr
add_option(app, "--udp_max_rx_msgs", nru_cfg.udp_rx_max_msgs, "Maximum amount of messages RX in a single syscall");
}

static void configure_cli11_buffer_pool_args(CLI::App& app, buffer_pool_appconfig& config)
{
app.add_option("--nof_segments", config.nof_segments, "Number of segments allocated by the buffer pool")
->capture_default_str();
app.add_option("--segment_size", config.segment_size, "Size of each buffer pool segment in bytes")
->capture_default_str();
}

void srsran::configure_cli11_with_cu_appconfig_schema(CLI::App& app, cu_appconfig& cu_cfg)
{
// Logging section.
configure_cli11_with_logger_appconfig_schema(app, cu_cfg.log_cfg);

// Buffer pool section.
configure_cli11_with_buffer_pool_appconfig_schema(app, cu_cfg.buffer_pool_config);

// F1AP section.
CLI::App* cu_cp_subcmd = add_subcommand(app, "cu_cp", "CU-UP parameters")->configurable();
CLI::App* f1ap_subcmd = add_subcommand(*cu_cp_subcmd, "f1ap", "F1AP parameters")->configurable();
Expand All @@ -65,8 +61,4 @@ void srsran::configure_cli11_with_cu_appconfig_schema(CLI::App& app, cu_appconfi
CLI::App* cu_up_subcmd = add_subcommand(app, "cu_up", "CU-UP parameters")->configurable();
CLI::App* nru_subcmd = add_subcommand(*cu_up_subcmd, "nru", "NR-U parameters")->configurable();
configure_cli11_nru_args(*nru_subcmd, cu_cfg.nru_cfg);

// Buffer pool section.
CLI::App* buffer_pool_subcmd = app.add_subcommand("buffer_pool", "Buffer pool configuration")->configurable();
configure_cli11_buffer_pool_args(*buffer_pool_subcmd, cu_cfg.buffer_pool_config);
}
3 changes: 2 additions & 1 deletion apps/du/du.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@

#include "apps/services/application_message_banners.h"
#include "apps/services/application_tracer.h"
#include "apps/services/buffer_pool/buffer_pool_manager.h"
#include "apps/services/core_isolation_manager.h"
#include "apps/services/metrics_plotter_json.h"
#include "apps/services/metrics_plotter_stdout.h"
Expand Down Expand Up @@ -240,7 +241,7 @@ int main(int argc, char** argv)
#endif

// Setup size of byte buffer pool.
init_byte_buffer_segment_pool(du_cfg.buffer_pool_config.nof_segments, du_cfg.buffer_pool_config.segment_size);
app_services::buffer_pool_manager buffer_pool_service(du_cfg.buffer_pool_config);

// Log CPU architecture.
cpu_architecture_info::get().print_cpu_info(du_logger);
Expand Down
2 changes: 1 addition & 1 deletion apps/du/du_appconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
#pragma once

#include "../gnb/gnb_appconfig.h" // TODO: Remove
#include "apps/services/buffer_pool/buffer_pool_appconfig.h"
#include "apps/services/logger/logger_appconfig.h"
#include "apps/services/os_sched_affinity_manager.h"
#include "srsran/adt/byte_buffer.h"
#include "srsran/support/executors/unique_thread.h"
#include <optional>

Expand Down
17 changes: 5 additions & 12 deletions apps/du/du_appconfig_cli11_schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
*/

#include "du_appconfig_cli11_schema.h"
#include "apps/services/buffer_pool/buffer_pool_appconfig_cli11_schema.h"
#include "apps/services/logger/logger_appconfig_cli11_schema.h"
#include "du_appconfig.h"
#include "srsran/adt/interval.h"
#include "srsran/support/cli11_utils.h"

using namespace srsran;
Expand Down Expand Up @@ -79,14 +81,6 @@ static void configure_cli11_e2_args(CLI::App& app, e2_appconfig& e2_params)
add_option(app, "--e2sm_rc_enabled", e2_params.e2sm_rc_enabled, "Enable RC service module")->capture_default_str();
}

static void configure_cli11_buffer_pool_args(CLI::App& app, buffer_pool_appconfig& config)
{
app.add_option("--nof_segments", config.nof_segments, "Number of segments allocated by the buffer pool")
->capture_default_str();
app.add_option("--segment_size", config.segment_size, "Size of each buffer pool segment in bytes")
->capture_default_str();
}

static error_type<std::string> is_valid_cpu_index(unsigned cpu_idx)
{
std::string error_message = fmt::format("Invalid CPU core selected '{}'. Valid CPU ids: {}",
Expand Down Expand Up @@ -268,6 +262,9 @@ void srsran::configure_cli11_with_du_appconfig_schema(CLI::App& app, du_appconfi
// Loggers section.
configure_cli11_with_logger_appconfig_schema(app, du_cfg.log_cfg);

// Buffer pool section.
configure_cli11_with_buffer_pool_appconfig_schema(app, du_cfg.buffer_pool_config);

// F1-C section.
CLI::App* f1ap_subcmd = app.add_subcommand("f1ap", "F1AP interface configuration")->configurable();
configure_cli11_f1ap_args(*f1ap_subcmd, du_cfg.f1ap_cfg);
Expand All @@ -284,10 +281,6 @@ void srsran::configure_cli11_with_du_appconfig_schema(CLI::App& app, du_appconfi
CLI::App* e2_subcmd = add_subcommand(app, "e2", "E2 parameters")->configurable();
configure_cli11_e2_args(*e2_subcmd, du_cfg.e2_cfg);

// Buffer pool section.
CLI::App* buffer_pool_subcmd = app.add_subcommand("buffer_pool", "Buffer pool configuration")->configurable();
configure_cli11_buffer_pool_args(*buffer_pool_subcmd, du_cfg.buffer_pool_config);

// Expert section.
CLI::App* expert_subcmd = app.add_subcommand("expert_execution", "Expert execution configuration")->configurable();
configure_cli11_expert_execution_args(*expert_subcmd, du_cfg.expert_execution_cfg);
Expand Down
5 changes: 3 additions & 2 deletions apps/gnb/gnb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
#include <atomic>

#include "apps/services/application_message_banners.h"
#include "apps/services/buffer_pool/buffer_pool_manager.h"
#include "apps/services/core_isolation_manager.h"
#include "apps/services/metrics_plotter_json.h"
#include "apps/services/metrics_plotter_stdout.h"
Expand Down Expand Up @@ -295,8 +296,8 @@ int main(int argc, char** argv)
}
#endif

// Setup size of byte buffer pool.
init_byte_buffer_segment_pool(gnb_cfg.buffer_pool_config.nof_segments, gnb_cfg.buffer_pool_config.segment_size);
// Buffer pool service.
app_services::buffer_pool_manager buffer_pool_service(gnb_cfg.buffer_pool_config);

// Log CPU architecture.
cpu_architecture_info::get().print_cpu_info(gnb_logger);
Expand Down
8 changes: 1 addition & 7 deletions apps/gnb/gnb_appconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@

#pragma once

#include "apps/services/buffer_pool/buffer_pool_appconfig.h"
#include "apps/services/logger/logger_appconfig.h"
#include "apps/services/os_sched_affinity_manager.h"
#include "srsran/adt/byte_buffer.h"
#include "srsran/ran/direct_current_offset.h"
#include "srsran/ran/gnb_id.h"
#include "srsran/support/executors/unique_thread.h"
#include <string>
Expand Down Expand Up @@ -66,11 +65,6 @@ struct metrics_appconfig {
unsigned stdout_metrics_period = 1000; // Statistics report period in milliseconds
};

struct buffer_pool_appconfig {
std::size_t nof_segments = 1048576;
std::size_t segment_size = byte_buffer_segment_pool_default_segment_size();
};

/// CPU affinities configuration for the gNB app.
struct cpu_affinities_appconfig {
/// CPUs isolation.
Expand Down
17 changes: 5 additions & 12 deletions apps/gnb/gnb_appconfig_cli11_schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
*/

#include "gnb_appconfig_cli11_schema.h"
#include "apps/services/buffer_pool/buffer_pool_appconfig_cli11_schema.h"
#include "apps/services/logger/logger_appconfig_cli11_schema.h"
#include "gnb_appconfig.h"
#include "srsran/adt/interval.h"
#include "srsran/support/cli11_utils.h"
#include "srsran/support/error_handling.h"
#include "CLI/CLI11.hpp"
Expand Down Expand Up @@ -84,14 +86,6 @@ static void configure_cli11_e2_args(CLI::App& app, e2_appconfig& e2_params)
add_option(app, "--e2sm_rc_enabled", e2_params.e2sm_rc_enabled, "Enable RC service module")->capture_default_str();
}

static void configure_cli11_buffer_pool_args(CLI::App& app, buffer_pool_appconfig& config)
{
app.add_option("--nof_segments", config.nof_segments, "Number of segments allocated by the buffer pool")
->capture_default_str();
app.add_option("--segment_size", config.segment_size, "Size of each buffer pool segment in bytes")
->capture_default_str();
}

static void configure_cli11_hal_args(CLI::App& app, std::optional<hal_appconfig>& config)
{
config.emplace();
Expand Down Expand Up @@ -274,6 +268,9 @@ void srsran::configure_cli11_with_gnb_appconfig_schema(CLI::App& app, gnb_appcon
// Loggers section.
configure_cli11_with_logger_appconfig_schema(app, gnb_cfg.log_cfg);

// Buffer pool section.
configure_cli11_with_buffer_pool_appconfig_schema(app, gnb_cfg.buffer_pool_config);

// Metrics section.
CLI::App* metrics_subcmd = app.add_subcommand("metrics", "Metrics configuration")->configurable();
configure_cli11_metrics_args(*metrics_subcmd, gnb_cfg.metrics_cfg);
Expand All @@ -282,10 +279,6 @@ void srsran::configure_cli11_with_gnb_appconfig_schema(CLI::App& app, gnb_appcon
CLI::App* e2_subcmd = add_subcommand(app, "e2", "E2 parameters")->configurable();
configure_cli11_e2_args(*e2_subcmd, gnb_cfg.e2_cfg);

// Buffer pool section.
CLI::App* buffer_pool_subcmd = app.add_subcommand("buffer_pool", "Buffer pool configuration")->configurable();
configure_cli11_buffer_pool_args(*buffer_pool_subcmd, gnb_cfg.buffer_pool_config);

// Expert section.
CLI::App* expert_subcmd = app.add_subcommand("expert_execution", "Expert execution configuration")->configurable();
configure_cli11_expert_execution_args(*expert_subcmd, gnb_cfg.expert_execution_cfg);
Expand Down
3 changes: 2 additions & 1 deletion apps/services/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# and at http://www.gnu.org/licenses/.
#

add_subdirectory(buffer_pool)
add_subdirectory(logger)

set(SOURCES
Expand All @@ -32,4 +33,4 @@ set(SOURCES

add_library(srsran_app_services STATIC ${SOURCES})
target_include_directories(srsran_app_services PRIVATE ${CMAKE_SOURCE_DIR})
target_link_libraries(srsran_app_services srsran_logger_app_service)
target_link_libraries(srsran_app_services srsran_logger_app_service srsran_buffer_pool_app_service)
25 changes: 25 additions & 0 deletions apps/services/buffer_pool/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Copyright 2021-2024 Software Radio Systems Limited
#
# This file is part of srsRAN
#
# srsRAN is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# srsRAN is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# A copy of the GNU Affero General Public License can be found in
# the LICENSE file in the top-level directory of this distribution
# and at http://www.gnu.org/licenses/.
#

set(SOURCES
buffer_pool_appconfig_cli11_schema.cpp)

add_library(srsran_buffer_pool_app_service STATIC ${SOURCES})
target_include_directories(srsran_buffer_pool_app_service PRIVATE ${CMAKE_SOURCE_DIR})
35 changes: 35 additions & 0 deletions apps/services/buffer_pool/buffer_pool_appconfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
*
* Copyright 2021-2024 Software Radio Systems Limited
*
* This file is part of srsRAN.
*
* srsRAN is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* srsRAN is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* A copy of the GNU Affero General Public License can be found in
* the LICENSE file in the top-level directory of this distribution
* and at http://www.gnu.org/licenses/.
*
*/

#pragma once

#include "srsran/adt/byte_buffer.h"

namespace srsran {

/// Buffer pool application configuration.
struct buffer_pool_appconfig {
std::size_t nof_segments = 1048576;
std::size_t segment_size = byte_buffer_segment_pool_default_segment_size();
};

} // namespace srsran
Loading

0 comments on commit c4996c8

Please sign in to comment.