Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions .github/workflows/ci-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: "Run codespell"
uses: codespell-project/actions-codespell@v2
with:
exclude_file: tests/unit/server/src/SourceText.hpp
exclude_file: capio-tests/unit/server/src/SourceText.hpp
docker-check:
name: "Check Docker image"
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -57,11 +57,11 @@ jobs:

- name: "Run backend communication tests"
working-directory: ${{ github.workspace }}
run: docker compose -f tests/multinode/backend/docker-compose.yml up --abort-on-container-exit
run: docker compose -f capio-tests/multinode/backend/docker-compose.yml up --abort-on-container-exit

- name: "Run integration tests"
working-directory: ${{ github.workspace }}
run: docker compose -f tests/multinode/integration/docker-compose.yml up --abort-on-container-exit
run: docker compose -f capio-tests/multinode/integration/docker-compose.yml up --abort-on-container-exit


format-check:
Expand All @@ -70,8 +70,10 @@ jobs:
strategy:
matrix:
path:
- "src"
- "tests"
- "capio-posix"
- "capio-server"
- "capio-common"
- "capio-tests"
steps:
- uses: actions/checkout@v4
- name: "Run clang-format style check"
Expand All @@ -89,7 +91,6 @@ jobs:
- Debug
- Release
cxx:
- g++-9
- g++-10
- g++-11
- g++-12
Expand Down Expand Up @@ -155,33 +156,33 @@ jobs:
CAPIO_LOG_LEVEL: -1
run: |
export LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH}"

echo "Run CAPIO syscall Unit tests"
capio_server --no-config &
CAPIO_SERVER_PID=$!
LD_PRELOAD=libcapio_posix.so capio_syscall_unit_tests \
--gtest_break_on_failure --gtest_print_time=1
kill $CAPIO_SERVER_PID
sleep 2


echo "Run CAPIO memory file integration tests"
capio_server --no-config &
CAPIO_SERVER_PID=$!
LD_PRELOAD=libcapio_posix.so capio_memory_file_unit_tests \
--gtest_break_on_failure --gtest_print_time=1
kill $CAPIO_SERVER_PID
sleep 2



echo "Run CAPIO POSIX Unit tests"
capio_posix_unit_tests \
--gtest_break_on_failure \
--gtest_print_time=1
sleep 2


echo "Run CAPIO SERVER unit tests"
capio_server_unit_tests \
--gtest_break_on_failure \
Expand Down
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ ENDIF (CAPIO_LOG)
#####################################
# Include files and directories
#####################################
file(GLOB_RECURSE CAPIO_COMMON_HEADERS "src/common/capio/*.hpp")
include_directories(src/common)
file(GLOB_RECURSE CAPIO_COMMON_HEADERS "capio-common/capio/*.hpp")
include_directories(${PROJECT_SOURCE_DIR}/capio-common)

IF (CAPIO_LOG AND CMAKE_BUILD_TYPE STREQUAL "Debug")
include_directories("${PROJECT_BINARY_DIR}/include/syscall")
Expand All @@ -88,14 +88,14 @@ ENDIF (CAPIO_LOG AND CMAKE_BUILD_TYPE STREQUAL "Debug")
#####################################
# Targets
#####################################
add_subdirectory(src/posix)
add_subdirectory(src/server)
add_subdirectory(capio-posix)
add_subdirectory(capio-server)

#####################################
# Install capiorun
# Install capio-run
#####################################
install(
FILES ${PROJECT_SOURCE_DIR}/capiorun/capiorun
FILES ${PROJECT_SOURCE_DIR}/capio-run/capiorun
DESTINATION ${CMAKE_INSTALL_BINDIR}
PERMISSIONS
OWNER_READ
Expand All @@ -111,5 +111,5 @@ install(
IF (CAPIO_BUILD_TESTS)
message(STATUS "Building CAPIO test suite")
add_compile_definitions(CAPIO_BUILD_TESTS)
add_subdirectory(tests)
add_subdirectory(capio-tests)
ENDIF (CAPIO_BUILD_TESTS)
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ RUN apt update \

COPY CMakeLists.txt /opt/capio/
COPY scripts /opt/capio/scripts
COPY src /opt/capio/src
COPY tests /opt/capio/tests
COPY capiorun /opt/capio/capiorun
COPY capio-common /opt/capio/capio-common
COPY capio-posix /opt/capio/capio-posix
COPY capio-server /opt/capio/capio-server
COPY capio-tests /opt/capio/capio-tests
COPY capio-run /opt/capio/capio-run

RUN mkdir -p /opt/capio/build \
&& cmake \
Expand Down Expand Up @@ -98,7 +100,7 @@ COPY --from=builder \
"/usr/local/bin/capio_integration_test_map*" \
"/usr/local/bin/capio_integration_test_merge*" \
"/usr/local/bin/capio_integration_test_split*" \
"/opt/capio/capiorun/capiorun" \
"/opt/capio/capio-run/capiorun" \
/usr/local/bin/

# Pkgconfig
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ To launch your workflow with capio you can follow two routes:
#### A) Use `capiorun` for simplified operations

You can simplify the execution of workflow steps with CAPIO using the `capiorun` utility. See the
[`capiorun` documentation](capiorun/readme.md) for usage and examples. `capiorun` provides an easier way to manage
[`capiorun` documentation](capio-run/readme.md) for usage and examples. `capiorun` provides an easier way to manage
daemon startup and environment preparation, so that the user do not need to manually prepare the environment.

#### B) Manually launch CAPIO
Expand Down
File renamed without changes.
39 changes: 39 additions & 0 deletions src/common/capio/env.hpp → capio-common/capio/env.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

#include <sys/stat.h>

#ifndef __CAPIO_POSIX
#include <include/utils/configuration.hpp>
#endif

#include "logger.hpp"
#include "syscall.hpp"

Expand Down Expand Up @@ -109,4 +113,39 @@ inline std::string get_capio_workflow_name() {
return name;
}

inline long get_cache_lines() {
START_LOG(capio_syscall(SYS_gettid), "call()");
static long data_bufs_size = -1;
if (data_bufs_size == -1) {
LOG("Value not set. getting value");
char *value = std::getenv("CAPIO_CACHE_LINES");
if (value != nullptr) {
LOG("Getting value from environment variable");
data_bufs_size = strtol(value, nullptr, 10);
} else {
LOG("Getting default value");
data_bufs_size = CAPIO_CACHE_LINES_DEFAULT;
}
}
LOG("data_bufs_size=%ld", data_bufs_size);
return data_bufs_size;
}

inline long get_cache_line_size() {
START_LOG(capio_syscall(SYS_gettid), "call()");
static long data_bufs_count = -1;
if (data_bufs_count == -1) {
LOG("Value not set. getting value");
char *value = std::getenv("CAPIO_CACHE_LINE_SIZE");
if (value != nullptr) {
LOG("Getting value from environment variable");
data_bufs_count = strtol(value, nullptr, 10);
} else {
LOG("Getting default value");
data_bufs_count = CAPIO_CACHE_LINE_SIZE_DEFAULT;
}
}
LOG("data_bufs_count=%ld", data_bufs_count);
return data_bufs_count;
}
#endif // CAPIO_COMMON_ENV_HPP
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include <regex>

std::filesystem::path get_parent_dir_path(const std::filesystem::path &file_path) {
inline std::filesystem::path get_parent_dir_path(const std::filesystem::path &file_path) {
START_LOG(capio_syscall(SYS_gettid), "call(file_path=%s)", file_path.c_str());
if (file_path == file_path.root_path()) {
return file_path;
Expand Down
4 changes: 2 additions & 2 deletions src/common/capio/logger.hpp → capio-common/capio/logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ inline bool continue_on_error = false; // change behaviour of ERR_EXIT to contin

#ifndef __CAPIO_POSIX
#include <filesystem>
thread_local std::ofstream logfile; // if building for server, self-contained logfile
inline thread_local std::ofstream logfile; // if building for server, self-contained logfile
inline std::string log_master_dir_name = CAPIO_DEFAULT_LOG_FOLDER;
inline std::string logfile_prefix = CAPIO_SERVER_DEFAULT_LOG_FILE_PREFIX;
#else
Expand Down Expand Up @@ -323,7 +323,7 @@ class Logger {
#define ERR_EXIT(message, ...) \
log.log(message, ##__VA_ARGS__); \
if (!continue_on_error) { \
char tmp_buf[1024]; \
char tmp_buf[5120]; \
sprintf(tmp_buf, message, ##__VA_ARGS__); \
char node_name[HOST_NAME_MAX]{0}; \
gethostname(node_name, HOST_NAME_MAX); \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions src/common/capio/shm.hpp → capio-common/capio/shm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ class CapioShmCanary {
}
};

CapioShmCanary *shm_canary;
inline CapioShmCanary *shm_canary;

void *create_shm(const std::string &shm_name, const long int size) {
inline void *create_shm(const std::string &shm_name, const long int size) {
START_LOG(capio_syscall(SYS_gettid), "call(shm_name=%s, size=%ld)", shm_name.c_str(), size);

// if we are not creating a new object, mode is equals to 0
Expand All @@ -116,7 +116,7 @@ void *create_shm(const std::string &shm_name, const long int size) {
return p;
}

auto get_shm_size(int shm_fd, const char *shm_name) {
inline auto get_shm_size(int shm_fd, const char *shm_name) {
START_LOG(capio_syscall(SYS_gettid), "call(fd=%ld)", shm_fd);
struct stat sb = {0};
/* Open existing object */
Expand All @@ -141,7 +141,7 @@ auto get_shm_size(int shm_fd, const char *shm_name) {
return sb.st_size;
}

void *get_shm(const std::string &shm_name) {
inline void *get_shm(const std::string &shm_name) {
START_LOG(capio_syscall(SYS_gettid), "call(shm_name=%s)", shm_name.c_str());

// if we are not creating a new object, mode is equals to 0
Expand All @@ -167,7 +167,7 @@ void *get_shm(const std::string &shm_name) {
return p;
}

void *get_shm_if_exist(const std::string &shm_name) {
inline void *get_shm_if_exist(const std::string &shm_name) {
START_LOG(capio_syscall(SYS_gettid), "call(shm_name=%s)", shm_name.c_str());

// if we are not creating a new object, mode is equals to 0
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
36 changes: 0 additions & 36 deletions src/posix/utils/env.hpp → capio-posix/utils/env.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,42 +24,6 @@ inline capio_off64_t get_capio_write_cache_size() {
return cache_size;
}

inline long get_cache_lines() {
START_LOG(capio_syscall(SYS_gettid), "call()");
static long data_bufs_size = -1;
if (data_bufs_size == -1) {
LOG("Value not set. getting value");
char *value = std::getenv("CAPIO_CACHE_LINES");
if (value != nullptr) {
LOG("Getting value from environment variable");
data_bufs_size = strtol(value, nullptr, 10);
} else {
LOG("Getting default value");
data_bufs_size = CAPIO_CACHE_LINES_DEFAULT;
}
}
LOG("data_bufs_size=%ld", data_bufs_size);
return data_bufs_size;
}

inline long get_cache_line_size() {
START_LOG(capio_syscall(SYS_gettid), "call()");
static long data_bufs_count = -1;
if (data_bufs_count == -1) {
LOG("Value not set. getting value");
char *value = std::getenv("CAPIO_CACHE_LINE_SIZE");
if (value != nullptr) {
LOG("Getting value from environment variable");
data_bufs_count = strtol(value, nullptr, 10);
} else {
LOG("Getting default value");
data_bufs_count = CAPIO_CACHE_LINE_SIZE_DEFAULT;
}
}
LOG("data_bufs_count=%ld", data_bufs_count);
return data_bufs_count;
}

inline long get_posix_read_cache_line_size() {
START_LOG(capio_syscall(SYS_gettid), "call()");
static long data_bufs_count = -1;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added capio-run/requirements.txt
Empty file.
27 changes: 4 additions & 23 deletions src/server/CMakeLists.txt → capio-server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
# Target information
#####################################
set(TARGET_NAME capio_server)
set(TARGET_INCLUDE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR})
set(TARGET_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/capio_server.cpp

set(TARGET_INCLUDE_FOLDER .)
file(GLOB_RECURSE TARGET_SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
)

#####################################
Expand All @@ -29,26 +30,6 @@ FetchContent_Declare(
GIT_TAG fbd8aa924b916c6578963af315fdb5f10c3969ad
)

#####################################
# Add MTCL dependencies
#####################################
#find_package(UCX)

#if (ucx_FOUND)
# message(STATUS "Enabling UCX for MTCL backend")
# target_compile_definitions(mtcl ENABLE_UCX)
#else ()
# message(STATUS "Warning: UCX has not been found, and as such it will not be an available MTCL backend.")
#endif ()


#find_package(MPI)
#if (MPI_FOUND)
# message(STATUS "Enabling MPI for MTCL backend")
# target_compile_definitions(mtcl ENABLE_MPI)
#else ()
# message(STATUS "Warning: MPI has not been found, and as such it will not be an available MTCL backend.")
#endif ()

FetchContent_MakeAvailable(args simdjson mtcl)

Expand Down
Loading