forked from robot-learning-freiburg/MDPCalib
-
Notifications
You must be signed in to change notification settings - Fork 0
Add GitHub Actions workflow to build and push Docker image; update docker-compose for standalone ROS 2 use with ros2bag and KITTI playback #3
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
Draft
Copilot
wants to merge
12
commits into
main
Choose a base branch
from
copilot/add-github-workflow-build-push
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
eea5af0
Initial plan
Copilot 9ef97d4
Add Docker build/push workflow, update docker-compose with .env suppo…
Copilot 6e00795
Add VNC service, build context, fix AMENT_TRACE_SETUP_FILES, docker c…
Copilot 708e356
Add ros2bag player container, expose VNC port 5801, switch default RO…
Copilot 4ec4170
Remove bag-player from CI, separate rosbag/calibration volumes, loop …
Copilot 5f48689
Unambiguous path naming (CALIBRATION_DATA_PATH), auto-download CMRNex…
Copilot 63ef951
feat: add KITTI playback mode to bag-player container
Copilot 9866f2e
fix: install pip to bag player
cooperj e3a064e
fix: validate zip integrity in play_kitti.sh _download helper
Copilot 1521a30
feat: hold mdpcalib until bag-player is ready (healthcheck)
Copilot a1c9169
fix: pin numpy<2 in bag-player Dockerfile
Copilot 210dde7
fix: sentinel-based skip for KITTI bag conversion; add KITTI_FORCE_RE…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| # MDPCalib Docker Compose Environment Configuration | ||
| # Copy this file to .env and adjust the values to match your setup. | ||
| # | ||
| # Usage: | ||
| # cp .env.example .env | ||
| # # edit .env as needed | ||
| # docker compose up | ||
|
|
||
| # --- Calibration data --- | ||
| # Absolute path to your local calibration data directory. | ||
| # This directory will be mounted to /data inside the mdpcalib container. | ||
| # It will contain: | ||
| # - cmrnext/ CMRNext model weights (*.tar files) — downloaded automatically if absent | ||
| # - calibration/ output directory (created automatically) | ||
| # - runtime_logs/ log files | ||
| # | ||
| # NOTE: Keep this directory completely separate from your rosbag storage (ROSBAG_PATH). | ||
| CALIBRATION_DATA_PATH=/CHANGE/ME/absolute/path/to/calibration/data | ||
|
|
||
| # Directory inside the container where CMRNext model weights are stored. | ||
| # Override only if you want to store weights elsewhere (e.g. a shared read-only volume). | ||
| # Defaults to /data/cmrnext — all three weights must reside in the same directory. | ||
| # CMRNEXT_WEIGHTS_DIR=/data/cmrnext | ||
|
|
||
| # --- Bag player --- | ||
|
|
||
| # Playback mode: 'ros2bag' (default) or 'kitti' | ||
| # ros2bag — play an existing ros2bag folder from ROSBAG_PATH / BAG_PATH | ||
| # kitti — download KITTI raw_synced data automatically, convert to ros2bag, | ||
| # and play it (data is cached in the 'kitti_data' named Docker volume) | ||
| # PLAYBACK_MODE=ros2bag | ||
|
|
||
| # Host directory containing your rosbag2 folders (used when PLAYBACK_MODE=ros2bag). | ||
| # Defaults to $HOME/rosbags; override to point to a different location. | ||
| # The entire directory is mounted to /rosbags inside the bag-player container. | ||
| # ROSBAG_PATH=${HOME}/rosbags | ||
|
|
||
| # Subfolder or specific bag inside /rosbags to play (PLAYBACK_MODE=ros2bag only). | ||
| # Defaults to /rosbags (plays the top-level folder). | ||
| # Set this if your bags are in a subdirectory, e.g. /rosbags/my_recording. | ||
| # BAG_PATH=/rosbags | ||
|
|
||
| # Set to "false" to play once and exit (default is to loop indefinitely). | ||
| # BAG_LOOP=true | ||
|
|
||
| # Playback rate multiplier (e.g. 0.5 for half speed). | ||
| # BAG_RATE=1.0 | ||
|
|
||
| # --- KITTI mode variables (only used when PLAYBACK_MODE=kitti) --- | ||
| # KITTI raw_synced recording to download and play. | ||
| # Default: sequence 00 (residential, 2011_10_03, drive 0027) — ~9 GB download. | ||
| # Cached permanently in the 'kitti_data' named Docker volume. | ||
| # KITTI_DATE=2011_10_03 | ||
| # KITTI_DRIVE=0027 | ||
| # Which colour camera to use for calibration: 'left' (default) or 'right' | ||
| # KITTI_CAMERA=left | ||
| # Odometry sequence whose motion-compensated velodyne scans replace the raw ones. | ||
| # KITTI_SEQUENCE=00 | ||
| # Set to "true" to delete the cached ros2bag and force re-conversion. | ||
| # Useful after changing KITTI_DATE/KITTI_DRIVE/KITTI_CAMERA. Leave unset for normal use. | ||
| # KITTI_FORCE_REBUILD=false | ||
| # | ||
| # For KITTI mode, also set FAST-LO to the Velodyne HDL-64E configuration: | ||
| # FAST_LO_CONFIG_FILE=/root/catkin_ws/src/mdpcalib/FAST_LO/config/velodyne.yaml | ||
|
|
||
| # --- ROS 2 sensor topics --- | ||
| # Adjust to match the topic names recorded in your rosbag. | ||
|
|
||
| ROS2_CAMERA_IMAGE_TOPIC=/camera/image_raw | ||
| ROS2_CAMERA_INFO_TOPIC=/camera/camera_info | ||
| ROS2_LIDAR_POINTS_TOPIC=/points_raw | ||
| ROS2_IMU_TOPIC=/imu/data | ||
|
|
||
| # Coordinate frame IDs written into the exported calibration YAML. | ||
| LIDAR_FRAME_ID=lidar | ||
| CAMERA_FRAME_ID=camera | ||
|
|
||
| # ROS 2 domain ID (must match across bag-player and mdpcalib containers). | ||
| # ROS_DOMAIN_ID=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| name: Build and Push Docker Image | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| tags: | ||
| - "v*" | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| REGISTRY: ghcr.io | ||
| # github.repository is 'LCAS/MDPCalib'; ghcr.io automatically lowercases | ||
| # the path, so the published image is ghcr.io/lcas/mdpcalib. | ||
| IMAGE_NAME: ${{ github.repository }} | ||
|
|
||
| jobs: | ||
| build-and-push: | ||
| name: Build and push Docker image | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Log in to the Container registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Extract metadata (tags, labels) for Docker | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
| tags: | | ||
| type=ref,event=branch | ||
| type=semver,pattern={{version}} | ||
| type=semver,pattern={{major}}.{{minor}} | ||
| type=raw,value=latest,enable={{is_default_branch}} | ||
|
|
||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| ARG BASE_IMAGE=lcas.lincoln.ac.uk/ros:humble-latest | ||
| ARG ROS_DISTRO=humble | ||
|
|
||
| FROM ${BASE_IMAGE} | ||
|
|
||
| ARG ROS_DISTRO | ||
| ENV ROS_DISTRO=${ROS_DISTRO} | ||
|
|
||
| WORKDIR /workspace | ||
|
|
||
| # Copy the package manifest so rosdep can install all declared dependencies. | ||
| COPY package.xml /workspace/src/mdpcalib_bag_player/package.xml | ||
|
|
||
| RUN rosdep update --rosdistro "${ROS_DISTRO}" \ | ||
| && apt-get update \ | ||
| && rosdep install --from-paths /workspace/src --ignore-src -r -y \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Python packages required for KITTI → ros2bag conversion (no rosdep keys available) | ||
| RUN rm -rf /var/lib/apt/lists/* \ | ||
| && apt-get update --fix-missing \ | ||
| && apt-get -y install --no-install-recommends --fix-missing \ | ||
| python3 \ | ||
| python3-pip \ | ||
| python3-colcon-common-extensions \ | ||
| python3-colcon-mixin \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Pin numpy<2: pykitti (and several ros2 packages) are compiled against | ||
| # NumPy 1.x ABI and raise "cannot be run in NumPy 2.x" at runtime otherwise. | ||
| RUN pip3 install --no-cache-dir "numpy<2" pykitti progressbar2 | ||
|
|
||
| COPY play_bag.sh play_kitti.sh kitti_to_ros2bag.py /workspace/ | ||
| RUN chmod +x /workspace/play_bag.sh /workspace/play_kitti.sh | ||
|
|
||
| CMD ["/workspace/play_bag.sh"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the correct way that we want to do this instead of hosting on
lcas.lincoln.ac.ukThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow pushes to
ghcr.iobecause it uses the built-inGITHUB_TOKEN— no extra secrets needed. Pushing tolcas.lincoln.ac.ukis possible but requires a registry credential stored as a repository secret. If you'd like to add that registry, let me know and I'll add a second push step once the secret name is confirmed.