Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge dev changes to main #5

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
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
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Docker Image CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build -f Dockerfile -t llserver_ecui:$(date +%s) .
8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/llserver_ecui_houbolt",
"program": "${workspaceFolder}/build/llserver_ecui_houbolt",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"cwd": "${workspaceFolder}/build",
"environment": [{"name": "ECUI_CONFIG_PATH", "value": "../../config_ecui"}],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,6 @@
"numbers": "cpp",
"semaphore": "cpp",
"stop_token": "cpp"
}
},
"C_Cpp.errorSquiggles": "disabled"
}
44 changes: 2 additions & 42 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if(NO_PYTHON)
add_compile_definitions(NO_PYTHON)
list(REMOVE_ITEM sources ${CMAKE_CURRENT_SOURCE_DIR}/src/drivers/PythonController.cpp)
else()
include_directories(/usr/include/python3.8)
include_directories(/usr/include/python3.10)
endif()

add_executable(${PROJECT_NAME} ${sources})
Expand All @@ -43,48 +43,8 @@ if(LINUX)
target_link_libraries(${PROJECT_NAME} PRIVATE -lcanlib)
endif()
if(NOT NO_PYTHON)
target_link_libraries(${PROJECT_NAME} PRIVATE -lpython3.8)
target_link_libraries(${PROJECT_NAME} PRIVATE -lpython3.10)
endif()
else()
target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads)
endif()


##----WITH BOOST
# cmake_minimum_required(VERSION 3.13)
# project(llserver_ecui_houbolt)

# find_package(Threads REQUIRED)

# set(CMAKE_CXX_STANDARD 17)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")

# #if(NOT TARGET spdlog)
# # # Stand-alone build
# # find_package(spdlog REQUIRED)
# #endif()

# include_directories(include)

# file(GLOB sources ./*.cpp src/*.cpp include/*.h)

# set(Boost_USE_STATIC_LIBS OFF)
# set(Boost_USE_MULTITHREADED ON)
# set(Boost_USE_STATIC_RUNTIME OFF)
# find_package(Boost 1.45.0 COMPONENTS system)

# if(Boost_FOUND)
# add_executable(${PROJECT_NAME} ${sources})
# #spdlog_enable_warnings(${PROJECT_NAME})


# if(UNIX AND NOT APPLE)
# set(LINUX TRUE)
# endif()

# if(LINUX)
# target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads -lstdc++fs Boost::system)#spdlog::spdlog)
# else()
# target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads Boost::system)#spdlog::spdlog)
# endif()
# endif()
49 changes: 37 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,42 @@
FROM ubuntu:20.04
# specify the node base image with your desired version node:<version>
FROM ubuntu

# Replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh

# Set debconf to run non-interactively
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
WORKDIR /home

# Install base dependencies
RUN apt-get update && apt-get install -y -q --no-install-recommends \
git \
cmake \
build-essential

WORKDIR /llserver_ecui_houbolt
### KVASER Driver

CMD ["bash"]
RUN apt-get update
RUN apt-get install -y git
RUN apt-get install -y build-essential
RUN apt-get install -y linux-headers-`uname -r`
RUN apt-get install -y cmake make
RUN apt-get install -y wget
RUN apt-get install -y python3.10-dev

RUN wget --content-disposition "https://www.kvaser.com/downloads-kvaser/?utm_source=software&utm_ean=7330130980754&utm_status=latest"
RUN tar xvzf linuxcan.tar.gz
WORKDIR /home/linuxcan/canlib
RUN make
RUN make install
RUN /usr/doc/canlib/examples/listChannels

WORKDIR /home/

# Clone the conf files into the docker container
ADD ./ /home/llserver_ecui_houbolt
WORKDIR /home/llserver_ecui_houbolt

RUN git submodule init
RUN git submodule update

RUN mkdir -p build
WORKDIR /home/llserver_ecui_houbolt/build

RUN cmake -D NO_PYTHON=false -D NO_CANLIB=false -S ../ -B ./
RUN make -j

ENV ECUI_CONFIG_PATH=/home/config_ecui

ENTRYPOINT ./llserver_ecui_houbolt
Loading
Loading