Conversation
…socketcan. Added Grafana healthcheck.
…tten to host machine
…iles, canreplay now works with the generated log asc file.
…socketcan. Added Grafana healthcheck.
…tten to host machine
…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>
…INT fails gracefully
… logic with the mainthread and committer is done. Need to fix blocking read with poll or something else.
…e_processor includes to make gcc work.
…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.
| #include <sys/socket.h> | ||
| #include <unistd.h> | ||
|
|
||
| #include "../../../../lib/dbc/runtime/include/dbc_runtime.hpp" //we should fix this |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
I would remove all testing code so that it's not on main and then put any testing setups on a test branch.
There was a problem hiding this comment.
same thing as before, just move this to a testing branch.
| # Stage 2: Runtime Image | ||
| # CHANGE: Must match the builder OS (Bookworm) to avoid GLIBC errors | ||
| # ----------------------------------------------------------------------------- | ||
| FROM debian:bookworm-slim |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Is the system.d stuff working yet? If not we can keep it on a test branch before merging it into main.
| ports: | ||
| - "3000:3000" | ||
| environment: | ||
| - GF_SECURITY_ADMIN_USER=matt |
There was a problem hiding this comment.
Let's change this to the username and password both being mrover lol
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
|
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. |
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:
logger_start.yaml
every logger shares the same auth defined in the auth field
every logger needs:
run project
build only exe and debug
run the whole application