build(docker): turn image into a dev environment with mounted sources
All checks were successful
Verification / Is-Buildable (push) Successful in 2m59s
All checks were successful
Verification / Is-Buildable (push) Successful in 2m59s
This commit is contained in:
parent
1740f9d6fc
commit
2016b14f91
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
build*/
|
||||||
|
datasets/
|
||||||
|
*.ply
|
||||||
|
*.tar.gz
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -20,3 +20,4 @@ large_tool_results/
|
|||||||
|
|
||||||
# Point-cloud exports
|
# Point-cloud exports
|
||||||
*.ply
|
*.ply
|
||||||
|
build-docker/
|
||||||
|
|||||||
49
Dockerfile
49
Dockerfile
@ -1,38 +1,39 @@
|
|||||||
# Use Ubuntu 24.04 as base (matching development environment)
|
# Build-environment image: contains the toolchain and dependencies only.
|
||||||
|
# The source tree is bind-mounted at runtime and compiled inside the container:
|
||||||
|
#
|
||||||
|
# docker build -t cloud-point-rpc-dev .
|
||||||
|
# docker run -d --name cprpc-dev --network=host -v "$(pwd)":/app cloud-point-rpc-dev
|
||||||
|
# docker exec -it cprpc-dev meson setup build-docker
|
||||||
|
# docker exec -it cprpc-dev meson compile -C build-docker
|
||||||
|
# docker exec -it cprpc-dev ./build-docker/src/cloud_point_rpc_cli config.yml
|
||||||
|
#
|
||||||
|
# Use a dedicated build directory (build-docker) so host and container
|
||||||
|
# builds never share Meson state.
|
||||||
FROM ubuntu:24.04
|
FROM ubuntu:24.04
|
||||||
|
|
||||||
# Avoid interactive prompts during package installation
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
# Install dependencies
|
# - build-essential, meson, ninja-build, cmake, pkg-config: toolchain
|
||||||
# - build-essential: Compiler (gcc/g++)
|
# - git: Meson subprojects (asio, json, yaml-cpp, glog, jsonrpccxx, gtest)
|
||||||
# - meson/ninja-build: Build system
|
# - libopencv-dev: OpenCV 4 incl. contrib modules (ximgproc for the WLS filter)
|
||||||
# - git: For fetching subprojects
|
# - libunwind-dev: glog stack traces
|
||||||
# - pkg-config, cmake: For dependency resolution
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
# - libssl-dev: Often needed for cmake fetches/networking
|
|
||||||
RUN apt-get update && apt-get install -y \
|
|
||||||
build-essential \
|
build-essential \
|
||||||
meson \
|
meson \
|
||||||
ninja-build \
|
ninja-build \
|
||||||
git \
|
|
||||||
pkg-config \
|
|
||||||
cmake \
|
cmake \
|
||||||
|
pkg-config \
|
||||||
|
git \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
libunwind-dev \
|
libunwind-dev \
|
||||||
|
libopencv-dev \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Set working directory
|
# The mounted checkout is usually owned by a different uid than root inside
|
||||||
|
# the container; git refuses to touch it otherwise (Meson subprojects need git).
|
||||||
|
RUN git config --global --add safe.directory '*'
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy project files
|
# Keep the container alive; build and run via `docker exec`.
|
||||||
COPY . .
|
CMD ["tail", "-F", "/dev/null"]
|
||||||
|
|
||||||
# Setup build directory and compile
|
|
||||||
# We allow git to fetch subprojects (glog, gtest, asio, etc.)
|
|
||||||
RUN meson setup build && \
|
|
||||||
meson compile -C build
|
|
||||||
|
|
||||||
# Run the cli by default
|
|
||||||
# We assume the config.yaml is in the root /app or we copy it.
|
|
||||||
# The build output is in build/src/cloud_point_rpc_cli
|
|
||||||
CMD ["./build/src/cloud_point_rpc_cli", "config.yaml"]
|
|
||||||
|
|||||||
43
README.md
43
README.md
@ -20,10 +20,9 @@ Done:
|
|||||||
- [x] Binary PLY export with grid triangulation and `ply_stride` decimation
|
- [x] Binary PLY export with grid triangulation and `ply_stride` decimation
|
||||||
- [x] Optional WLS / median disparity post-filters (`wls_filter`, `CpuStereoMatcher::Params`)
|
- [x] Optional WLS / median disparity post-filters (`wls_filter`, `CpuStereoMatcher::Params`)
|
||||||
- [x] SCARED benchmark with ground-truth metrics, depth PNGs and `scripts/scared_overview.py`
|
- [x] SCARED benchmark with ground-truth metrics, depth PNGs and `scripts/scared_overview.py`
|
||||||
|
- [x] Unity-side C# implementation per [docs/unity-integration.md](docs/unity-integration.md)
|
||||||
|
|
||||||
To do:
|
To do:
|
||||||
|
|
||||||
- [ ] Unity-side C# implementation per [docs/unity-integration.md](docs/unity-integration.md)
|
|
||||||
- [ ] Remove sliver triangles at the border of the valid region (long spikes are still visible in
|
- [ ] Remove sliver triangles at the border of the valid region (long spikes are still visible in
|
||||||
shaded viewers at `ply_stride: 4` because 5 % of local depth allows 3 mm edges)
|
shaded viewers at `ply_stride: 4` because 5 % of local depth allows 3 mm edges)
|
||||||
- [ ] Visually compare raw vs WLS meshes in a shaded web viewer and decide the visualisation default
|
- [ ] Visually compare raw vs WLS meshes in a shaded web viewer and decide the visualisation default
|
||||||
@ -127,27 +126,43 @@ meson test -C build -v
|
|||||||
|
|
||||||
## Docker
|
## Docker
|
||||||
|
|
||||||
You can build and run the cli using `Docker`.
|
The `Dockerfile` builds a **development environment** image only: toolchain
|
||||||
|
(GCC, Meson, Ninja, CMake), git for the Meson subprojects and OpenCV 4 with
|
||||||
|
contrib modules. Nothing is compiled at image build time. The source tree is
|
||||||
|
bind-mounted into the running container and compiled there, so edits on the
|
||||||
|
host are picked up immediately and the build artefacts land in your checkout.
|
||||||
|
|
||||||
### 1. Build Image
|
### 1. Build the environment image
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker build -t cloud-point-rpc .
|
docker build -t cloud-point-rpc-dev .
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Run Container
|
### 2. Start the container with the source mounted
|
||||||
|
|
||||||
The cli will try to connect to a **running server** on ip and port defined in config.yml file. (defined in `config.yaml` inside the image).
|
|
||||||
For simplicity, it's better to use a host network, so you will not have any headache with accessability.
|
|
||||||
|
|
||||||
> _Server is not configured to run through container, if you need, contact me_
|
|
||||||
|
|
||||||
You also can mount your own `config.yaml` to override the default settings:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run --network=host -it -v $(pwd)/my_config.yaml:/app/config.yaml cloud-point-rpc
|
docker run -d --name cprpc-dev --network=host -v "$(pwd)":/app cloud-point-rpc-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The container idles (`tail -F /dev/null`); `--network=host` lets the CLI
|
||||||
|
reach a server running on the host and lets the server be reached from Unity.
|
||||||
|
|
||||||
|
### 3. Build and run inside the container
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker exec -it cprpc-dev meson setup build-docker
|
||||||
|
docker exec -it cprpc-dev meson compile -C build-docker
|
||||||
|
docker exec -it cprpc-dev meson test -C build-docker
|
||||||
|
docker exec -it cprpc-dev ./build-docker/src/cloud_point_rpc_cli config.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
Use a dedicated build directory such as `build-docker`: Meson stores absolute
|
||||||
|
compiler paths, so a build directory configured on the host cannot be reused
|
||||||
|
inside the container and vice versa. With rootless Docker the container's
|
||||||
|
root maps to your host user, so `build-docker/` stays owned by you; with a
|
||||||
|
rootful daemon add `--user "$(id -u):$(id -g)"` to `docker run` to avoid
|
||||||
|
root-owned build files.
|
||||||
|
|
||||||
## Validation with SCARED Dataset
|
## Validation with SCARED Dataset
|
||||||
|
|
||||||
The `scared_dataset_server` executable lets you validate the stereo point-cloud
|
The `scared_dataset_server` executable lets you validate the stereo point-cloud
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user