Skip to content

Commit

Permalink
Merge pull request #27 from tim-devereux/main
Browse files Browse the repository at this point in the history
automate build and publish docker container
  • Loading branch information
thomas-lowe authored Dec 5, 2024
2 parents 6998ef4 + 5a5ccca commit 99698be
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 3 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docker Image CI

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

permissions:
contents: read
packages: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Build and Push Docker image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/raycloudtools
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Use Docker `latest` tag convention
[ "$VERSION" == "main" ] && VERSION=latest
docker build -f ./docker/Dockerfile -t $IMAGE_ID:$VERSION .
docker push $IMAGE_ID:$VERSION
42 changes: 39 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,46 @@ Ray clouds represent free space as well as surfaces. This allows processing that

This is an open-source research library, a place to release new techniques in ray cloud analysis and manipulation. So if you would like to contribute with a new or improved method, do suggest it in our discussions page: https://github.com/csiro-robotics/raycloudtools/discussions.

## Build on any platform with Docker:
Follow instructions in the docker folder
## Install using a Pre-built Container

## Build directly (tested on Linux-based systems):
### Docker (Linux, MacOS, Windows)
```console
# Pull the latest image from GitHub Packages
docker pull ghcr.io/csiro-robotics/raycloudtools:latest

# Run an interactive container (binds all host directories by default)
docker run -it raycloudtools:latest /bin/bash
```

### Apptainer/Singularity (Linux)
```console
# Login to GitHub Container Registry (required once)
export CR_PAT=YOUR_GITHUB_TOKEN
echo $CR_PAT | apptainer registry login ghcr.io -u YOUR_GITHUB_USERNAME --password-stdin

# Pull and convert the container
apptainer pull docker://ghcr.io/csiro-robotics/raycloudtools:latest

# Run an interactive container (binds host home directory by default)
apptainer shell raycloudtools_latest.sif
```

To create a GitHub token:
1. Go to GitHub Settings → Developer Settings → Personal Access Tokens → Tokens (classic)
2. Generate new token with `read:packages` scope
3. Copy the token and use it in the login command above

## Build from Source with Docker
```console
# Clone the repository
git clone https://github.com/csiro-robotics/raycloudtools.git
cd raycloudtools

# Build the image
docker build -f docker/Dockerfile -t raycloudtools:local .
```

## Build from Source (tested on Linux-based systems):
```console
sudo apt-get install libeigen3-dev
git clone https://github.com/ethz-asl/libnabo.git
Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ RUN apt-get update && apt-get upgrade -y && \
libeigen3-dev \
libproj-dev \
libgeotiff-dev \
libgtest-dev \
libboost-all-dev && \
rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -78,6 +79,7 @@ RUN git clone https://github.com/csiro-robotics/raycloudtools.git && \
-DWITH_LAS=ON \
-DDOUBLE_RAYS=ON \
-DWITH_TIFF=ON \
-DRAYCLOUD_BUILD_TESTS=ON \
-DCMAKE_BUILD_TYPE=Release && \
make -j$(nproc) && \
make install && \
Expand All @@ -93,6 +95,7 @@ RUN git clone https://github.com/csiro-robotics/treetools.git && \
-DPROJ_INCLUDE_DIR=/usr/include/proj \
-DPROJ_LIBRARY=/usr/lib/x86_64-linux-gnu/libproj.so \
-DWITH_TIFF=ON \
-DTREE_BUILD_TESTS=ON \
-DCMAKE_BUILD_TYPE=Release && \
make -j$(nproc) && \
make install && \
Expand Down

0 comments on commit 99698be

Please sign in to comment.