Skip to content

Canalyzer Build#53

Open
crazab0i wants to merge 43 commits intomainfrom
canalyzer
Open

Canalyzer Build#53
crazab0i wants to merge 43 commits intomainfrom
canalyzer

Conversation

@crazab0i
Copy link

Project builds in cmake with g++-13. Docker compose also works. To start docker project run start.sh in scripts.
Cmake, compose, and dockerfile were lowk vibed and I'm not expert please check.
Currently everything is configured through logger_start.yaml in cancode.

changes and notes

I only changed dbc_runtime includes to satisfy gcc

Everything managed by run_bus, which starts each logger on its on thread. Each logger has its own committer thread with a shared buffer for posts to Influxdb.

There are two globals
-running
-cout_mutex

Everything is kinda fragile due to relative file paths.

Have not tested taking a decoded CAN message and push to influx.

I am not ensure if this is correct for getting the name of a can message:

# line 96 logger.cpp
for (const auto &can_frame : local_buffer) {
            const auto *desc = parser.message(can_frame.id);
            builder.post(desc->name(), can_bus_name, can_frame.data, can_frame.time);
        }

logger_start.yaml

every logger shares the same auth defined in the auth field
every logger needs:

  • name
  • log_all
  • log_acs
  • log_specify
  • ascii_file_path
  • dbc_file_paths

run project

build only exe and debug

 cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_COMPILER=g++-13

 cmake --build build

run the whole application

     # ensure start.sh is executable
     ./start.sh

nbaskins and others added 30 commits September 9, 2025 19:00
…iles, canreplay now works with the generated log asc file.
…iles, canreplay now works with the generated log asc file.
loggers are now used as unique pointers.
Logger object has copy and assignment disabled.
Switching most errors from cerr to throw runtime.
	Vibecoded the fixes to the can logger, seems ok, needs review.
	Created empty tests and test folder.
…ade renamed logger and changed yaml parsing to handle multiple dbc filepaths
… multiple dbc files.

Co-authored-by: Riley LaMay <rylamay@users.noreply.github.com>
crazab0i added 6 commits January 18, 2026 14:33
… logic with the mainthread and committer is done. Need to fix blocking read with poll or something else.
…art.sh, compose, dockerfile fully vibed, may be wrong or not good. .dbcs where changed to be valied science dbcs from dbc/runtime. logger_start.yaml fixed to use valid ids.
@crazab0i crazab0i self-assigned this Jan 30, 2026
#include <sys/socket.h>
#include <unistd.h>

#include "../../../../lib/dbc/runtime/include/dbc_runtime.hpp" //we should fix this
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also not great at cmake but there should be a way to check the include directory for any header files you include.

void print();
void print_error();

friend void test_factory(std::vector<Logger>& loggers);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove all testing code so that it's not on main and then put any testing setups on a test branch.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing as before, just move this to a testing branch.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test branch

# Stage 2: Runtime Image
# CHANGE: Must match the builder OS (Bookworm) to avoid GLIBC errors
# -----------------------------------------------------------------------------
FROM debian:bookworm-slim
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this or the RUN command below are necessary. The gcc:13 image is built off of the debian:13 image so you should just be able to add the install libstdc++6 to the initial RUN command.


# 1. Start in detached mode (-d)
# This runs the containers in the background and returns immediately.
docker compose up -d --build --remove-orphans
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be building on every start up. We should instead build the Docker image from the command line before we try to run the logger. Saves a lot of time on startup considering the image won't change very often.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the system.d stuff working yet? If not we can keep it on a test branch before merging it into main.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No system.d yet

ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_USER=matt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change this to the username and password both being mrover lol

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we really want to we can use Docker secrets to hide the password but thats probably overkill


can_logger:
container_name: can_logger_instance
build:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this section only needed for building when bringing containers up? If so we can remove it.

args:
PROJECT_REL_PATH: src/canalyzer/can_code
stop_signal: SIGINT
privileged: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want the container running with root priveleges. There should be ways to setup the contianer and any necessary volumes to work without the container being root.

@nbaskins
Copy link
Contributor

Overall really nice work, I think that once these changes are made we can work towards testing on the pi. Once I get CAN integrated on the science board I will make some real CAN logs to replay and test on with the pi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants