Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
78da7b3
ci docs
leshy Jun 4, 2025
d2ea737
implemented ros polyfill for vector
leshy Jun 5, 2025
c03a810
added no ros docker builds to workflow
leshy Jun 5, 2025
e79f16c
triggering base py rebuild
leshy Jun 5, 2025
07c124a
noros dev uncoupled from ros-python
leshy Jun 5, 2025
10c1775
tests run on ros and noros
leshy Jun 5, 2025
8c69360
updating docker files and workflows for new builds
leshy Jun 5, 2025
e982627
workflow bugfix
leshy Jun 5, 2025
229be9d
debug job is not neccessary
leshy Jun 5, 2025
5d6c6cd
python image needs system deps
leshy Jun 5, 2025
52b9aee
dockerfile fix
leshy Jun 5, 2025
1b38491
added ros polyfill
leshy Jun 5, 2025
d4c2289
Merge branch 'cidocs' into noros_types
leshy Jun 5, 2025
31e711f
ros tests fix, debug job re-introduced
leshy Jun 5, 2025
b00cd38
reintroduced the debug step
leshy Jun 5, 2025
b79bfea
devcontainer should use ros-dev image
leshy Jun 5, 2025
711d6a4
ros test polyfil
leshy Jun 5, 2025
f145865
nav_msgs polyfil
leshy Jun 5, 2025
903280c
observable topic polyfill
leshy Jun 5, 2025
b5589aa
ros observable topic is tested only on the ros image
leshy Jun 5, 2025
77b21fe
removed stub polyfill test - we have other ros tests now
leshy Jun 5, 2025
b14b5e0
entrypoint fix
leshy Jun 5, 2025
f6c8fd4
observable topic fix
leshy Jun 5, 2025
000064d
triggering CI
leshy Jun 5, 2025
99e4393
odometry test fix
leshy Jun 6, 2025
c73a09e
local planner decoupled from ros
leshy Jun 6, 2025
50e9798
kicked out fixture from ros_observable_topic tests
leshy Jun 6, 2025
7b565d3
sorted ros test exclusion
leshy Jun 6, 2025
23c0432
testing better cache
leshy Jun 6, 2025
cb989f7
default args for FROM_IMAGE builds in docker files, nodejs in dev
leshy Jun 11, 2025
ced737d
dockerfile nvm fix
leshy Jun 11, 2025
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
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dimos-dev",
"image": "ghcr.io/dimensionalos/dev:dev",
"image": "ghcr.io/dimensionalos/ros-dev:dev",
"customizations": {
"vscode": {
"extensions": [
Expand Down
49 changes: 13 additions & 36 deletions .github/workflows/_docker-build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: docker-build-template
on:
workflow_call:
inputs:
branch-tag: { type: string, required: true }
target: { type: string, required: true }
from-image: { type: string, required: true }
to-image: { type: string, required: true }
dockerfile: { type: string, required: true }
freespace: { type: boolean, default: false }
should-run: { type: boolean, default: false }
context: { type: string, default: '.' }

# you can run this locally as well via
Expand All @@ -17,6 +19,10 @@ jobs:
packages: write

steps:
- name: exit early
if: ${{ !inputs.should-run }}
run: |
exit 0
- name: free up disk space
# takes a bit of time, so disabled by default
# explicitly enable this for large builds
Expand All @@ -37,34 +43,6 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Check base image tag
id: tagcheck
env:
BRANCH_TAG: ${{ inputs.branch-tag }}
DOCKERFILE_PATH: docker/${{ inputs.target }}/Dockerfile
DOCKER_CLI_EXPERIMENTAL: enabled # required for `docker buildx imagetools`
run: |
BASE_REPO=$(grep -Eo '^FROM[[:space:]]+ghcr\.io/dimensionalos/[a-zA-Z0-9._-]+' "$DOCKERFILE_PATH" | head -n1 | awk -F/ '{print $NF}')

if [[ -z "$BASE_REPO" ]]; then
echo "Could not determine base repo from $DOCKERFILE_PATH, reverting to 'dev'"
FROM_TAG="dev"
else
IMAGE="ghcr.io/dimensionalos/${BASE_REPO}:${BRANCH_TAG}"
echo "Checking if $IMAGE exists…"
if docker buildx imagetools inspect "$IMAGE" > /dev/null 2>&1; then
echo "Found $IMAGE"
FROM_TAG="$BRANCH_TAG"
else
echo "Tag '$BRANCH_TAG' not found for $BASE_REPO; falling back to 'dev'"
FROM_TAG="dev"
fi
fi

echo "from_tag=$FROM_TAG" >> "$GITHUB_OUTPUT"



# required for github cache of docker layers
- uses: crazy-max/ghaction-github-runtime@v3

Expand All @@ -79,9 +57,8 @@ jobs:
with:
push: true
context: ${{ inputs.context }}
file: docker/${{ inputs.target }}/Dockerfile
tags: ghcr.io/dimensionalos/${{ inputs.target }}:${{ inputs.branch-tag }}
cache-from: type=gha,scope=${{ inputs.target }}
cache-to: type=gha,mode=max,scope=${{ inputs.target }}
build-args: |
FROM_TAG=${{ steps.tagcheck.outputs.from_tag }}
file: docker/${{ inputs.dockerfile }}/Dockerfile
tags: ${{ inputs.to-image }}
cache-from: type=gha,scope=${{ inputs.dockerfile }}-${{ inputs.from-image }}
cache-to: type=gha,mode=max,scope=${{ inputs.dockerfile }}-${{ inputs.from-image }}
build-args: FROM_IMAGE=${{ inputs.from-image }}
128 changes: 89 additions & 39 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
id: set-tag
run: |
case "${GITHUB_REF_NAME}" in
master) branch_tag="latest" ;;
main) branch_tag="latest" ;;
dev) branch_tag="dev" ;;
*)
branch_tag=$(echo "${GITHUB_REF_NAME}" \
Expand All @@ -56,14 +56,6 @@ jobs:
echo "branch tag determined: ${branch_tag}"
echo branch_tag="${branch_tag}" >> "$GITHUB_OUTPUT"

ros:
needs: [check-changes]
if: needs.check-changes.outputs.ros == 'true'
uses: ./.github/workflows/_docker-build-template.yml
with:
branch-tag: ${{ needs.check-changes.outputs.branch-tag }}
target: base-ros

# just a debugger
inspect-needs:
needs: [check-changes, ros]
Expand All @@ -73,47 +65,105 @@ jobs:
- run: |
echo '${{ toJSON(needs) }}'

python:
ros:
needs: [check-changes]
if: needs.check-changes.outputs.ros == 'true'
uses: ./.github/workflows/_docker-build-template.yml
with:
from-image: ubuntu:22.04
to-image: ghcr.io/dimensionalos/ros:${{ needs.check-changes.outputs.branch-tag }}
dockerfile: ros

# # just a debugger
# inspect-needs:
# needs: [check-changes, ros]
# runs-on: dimos-runner-ubuntu-2204
# if: always()
# steps:
# - run: |
# echo '${{ toJSON(needs) }}'

ros-python:
needs: [check-changes, ros]
if: |
${{
always() && !cancelled() &&
needs.check-changes.result == 'success' &&
((needs.ros.result == 'success') ||
(needs.ros.result == 'skipped' &&
needs.check-changes.outputs.python == 'true'))
}}
if: always()
uses: ./.github/workflows/_docker-build-template.yml
with:
branch-tag: ${{ needs.check-changes.outputs.branch-tag }}
target: base-ros-python
should-run: ${{
needs.check-changes.outputs.python == 'true' &&
needs.check-changes.result != 'error' &&
needs.ros.result != 'error'
}}

from-image: ghcr.io/dimensionalos/ros:${{ needs.ros.result == 'success' && needs.check-changes.outputs.branch-tag || 'dev' }}
to-image: ghcr.io/dimensionalos/ros-python:${{ needs.check-changes.outputs.branch-tag }}
dockerfile: python
freespace: true

python:
needs: [check-changes]
if: needs.check-changes.outputs.python == 'true'
uses: ./.github/workflows/_docker-build-template.yml
with:
should-run: true
freespace: true
dockerfile: python
from-image: ubuntu:22.04
to-image: ghcr.io/dimensionalos/python:${{ needs.check-changes.outputs.branch-tag }}

dev:
needs: [check-changes, python]
if: |
${{
always() && !cancelled() &&
needs.check-changes.result == 'success' &&
((needs.python.result == 'success') ||
(needs.python.result == 'skipped' &&
needs.check-changes.outputs.dev == 'true'))
}}
if: always()

uses: ./.github/workflows/_docker-build-template.yml
with:
should-run: ${{
needs.check-changes.result == 'success' &&
((needs.python.result == 'success') ||
(needs.python.result == 'skipped' &&
needs.check-changes.outputs.dev == 'true')) }}
from-image: ghcr.io/dimensionalos/python:${{ needs.python.result == 'success' && needs.check-changes.outputs.branch-tag || 'dev' }}
to-image: ghcr.io/dimensionalos/dev:${{ needs.check-changes.outputs.branch-tag }}
dockerfile: dev

ros-dev:
needs: [check-changes, ros-python]
if: always()
uses: ./.github/workflows/_docker-build-template.yml
with:
branch-tag: ${{ needs.check-changes.outputs.branch-tag }}
target: dev
should-run: ${{
needs.check-changes.result == 'success' &&
((needs.ros-python.result == 'success') ||
(needs.ros-python.result == 'skipped' &&
needs.check-changes.outputs.dev == 'true'))
}}
from-image: ghcr.io/dimensionalos/ros-python:${{ needs.ros-python.result == 'success' && needs.check-changes.outputs.branch-tag || 'dev' }}
to-image: ghcr.io/dimensionalos/ros-dev:${{ needs.check-changes.outputs.branch-tag }}
dockerfile: dev

run-ros-tests:
needs: [check-changes, ros-dev]
if: always()
uses: ./.github/workflows/tests.yml
with:
should-run: ${{
needs.check-changes.result == 'success' &&
((needs.ros-dev.result == 'success') ||
(needs.ros-dev.result == 'skipped' &&
needs.check-changes.outputs.tests == 'true'))
}}
cmd: "pytest && pytest -m ros" # run tests that depend on ros as well
dev-image: ros-dev:${{ needs.ros-dev.result == 'success' && needs.check-changes.outputs.branch-tag || 'dev' }}

run-tests:
needs: [check-changes, dev]
if: |
${{
always() && !cancelled() &&
needs.check-changes.result == 'success' &&
((needs.dev.result == 'success') ||
(needs.dev.result == 'skipped' &&
needs.check-changes.outputs.tests == 'true'))
}}
if: always()
uses: ./.github/workflows/tests.yml
with:
branch-tag: ${{ needs.dev.result != 'success' && 'dev' || needs.check-changes.outputs.branch-tag }}
should-run: ${{
needs.check-changes.result == 'success' &&
((needs.dev.result == 'success') ||
(needs.dev.result == 'skipped' &&
needs.check-changes.outputs.tests == 'true'))
}}
cmd: "pytest"
dev-image: dev:${{ needs.dev.result == 'success' && needs.check-changes.outputs.branch-tag || 'dev' }}
20 changes: 16 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ name: tests
on:
workflow_call:
inputs:
branch-tag:
should-run:
required: false
type: boolean
default: true
dev-image:
required: true
type: string
default: "dev:dev"
cmd:
required: true
type: string
default: "latest"

permissions:
contents: read
Expand All @@ -17,12 +24,17 @@ jobs:
runs-on: dimos-runner-ubuntu-2204

container:
image: ghcr.io/dimensionalos/dev:${{ inputs.branch-tag }}
image: ghcr.io/dimensionalos/${{ inputs.dev-image }}

steps:
- name: exit early
if: ${{ !inputs.should-run }}
run: |
exit 0

- uses: actions/checkout@v4

- name: Run tests
run: |
git config --global --add safe.directory '*'
/entrypoint.sh bash -c "pytest"
/entrypoint.sh bash -c "${{ inputs.cmd }}"
4 changes: 2 additions & 2 deletions dimos/robot/local_planner/local_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

from dimos.types.vector import VectorLike, Vector, to_tuple
from dimos.types.path import Path
from nav_msgs.msg import OccupancyGrid
from dimos.types.costmap import Costmap

logger = setup_logger("dimos.robot.unitree.local_planner", level=logging.DEBUG)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not hard code logging level so you can get logs by running DIMOS_LOG_LEBEL=DEBUG python run.py


Expand All @@ -45,7 +45,7 @@ class BaseLocalPlanner(ABC):

def __init__(
self,
get_costmap: Callable[[], Optional[OccupancyGrid]],
get_costmap: Callable[[], Optional[Costmap]],
transform: object,
move_vel_control: Callable[[float, float, float], None],
safety_threshold: float = 0.5,
Expand Down
Loading
Loading