Skip to content
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
20 changes: 20 additions & 0 deletions .github/workflows/test_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: AIToolbox-docker-image

on:
push:
branches:
- master
- test
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Build the Docker image
# tag the image with the current timestamp to avoid any caching issues
run: docker build . --file docker/Dockerfile -t ai-toolbox:$(date +%s)
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
##############################
## Compiler/Linker Settings ##
##############################

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)


if (NOT WIN32)
add_definitions(
-Wall
Expand Down
58 changes: 58 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## Dockerfile for AI-Toolbox
# To build the docker image, run: docker build . -t ai-toolbox-full:0

# Docker image
FROM ubuntu:focal-20231211

RUN apt-get update

RUN apt-get install -y g++-10
RUN apt-get install -y cmake
RUN apt-get install -y liblpsolve55-dev
RUN apt-get install -y lp-solve
RUN apt-get install -y libeigen3-dev
RUN apt-get install -y libboost-all-dev
RUN apt-get install -y git
RUN apt-get install -y rsync
RUN apt-get install -y python3-pip

# clone AI-Toolbox GitHub repository
RUN cd /usr/src && git clone --branch docker-image https://github.com/omniscientoctopus/AI-Toolbox.git

# working directory (for successive commands)
WORKDIR /usr/src/AI-Toolbox

# Create build directory
RUN mkdir build

# Export CXX compiler path
RUN export CXX=/usr/bin/g++-10

# Configure AI-Toolbox
RUN cd build && \
cmake -DCMAKE_CXX_COMPILER=/usr/bin/g++-10 \
-DMAKE_ALL=1 \
-DMAKE_PYTHON=1 \
-DAI_PYTHON_VERSION=3\
-DAI_LOGGING_ENABLED=1 /usr/src/AI-Toolbox

# Build AI-Toolbox
RUN cd build && make

# Run examples

# Run C++ example
RUN cd build/examples && ./cliff QL

# Run Python example
RUN cd build && cp AIToolbox.so examples/
RUN cd build/examples && python3 ./tiger_antelope.py

# Check which MDP/POMDP modules are available
RUN cd build/examples && python3 -c "import AIToolbox; help(AIToolbox.MDP)"

RUN cd build/examples && python3 -c "import AIToolbox; help(AIToolbox.POMDP)"

# Test
# continue even if tests fail
#RUN cd build && ctest -V -j2 --output-on-failure --repeat until-pass:5
Loading