MuJoCo for Manipulation #5012
Workflow file for this run
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
| name: docker | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| paths-ignore: | |
| - '**.md' | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| permissions: | |
| contents: read | |
| packages: write | |
| pull-requests: read | |
| jobs: | |
| check-changes: | |
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false | |
| runs-on: [self-hosted, Linux] | |
| outputs: | |
| ros: ${{ steps.filter.outputs.ros }} | |
| python: ${{ steps.filter.outputs.python }} | |
| dev: ${{ steps.filter.outputs.dev }} | |
| navigation: ${{ steps.filter.outputs.navigation }} | |
| tests: ${{ steps.filter.outputs.tests }} | |
| branch-tag: ${{ steps.set-tag.outputs.branch_tag }} | |
| steps: | |
| - name: Fix permissions | |
| run: | | |
| sudo chown -R $USER:$USER ${{ github.workspace }} || true | |
| - uses: actions/checkout@v4 | |
| - id: filter | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| base: ${{ github.event.before }} | |
| filters: | | |
| # ros and python are (alternative) root images | |
| # change to root stuff like docker.yml etc triggers rebuild of those | |
| # which cascades into a full rebuild | |
| ros: | |
| - .github/workflows/_docker-build-template.yml | |
| - .github/workflows/docker.yml | |
| - docker/ros/** | |
| python: | |
| - .github/workflows/_docker-build-template.yml | |
| - .github/workflows/docker.yml | |
| - docker/python/** | |
| dev: | |
| - docker/dev/** | |
| navigation: | |
| - .github/workflows/_docker-build-template.yml | |
| - .github/workflows/docker.yml | |
| - docker/navigation/** | |
| tests: | |
| - dimos/** | |
| - pyproject.toml | |
| - uv.lock | |
| - name: Determine Branch Tag | |
| id: set-tag | |
| run: | | |
| case "${GITHUB_REF_NAME}" in | |
| main) branch_tag="latest" ;; | |
| dev) branch_tag="dev" ;; | |
| *) | |
| branch_tag=$(echo "${GITHUB_REF_NAME}" \ | |
| | tr '[:upper:]' '[:lower:]' \ | |
| | sed -E 's#[^a-z0-9_.-]+#_#g' \ | |
| | sed -E 's#^-+|-+$##g') | |
| ;; | |
| esac | |
| echo "branch tag determined: ${branch_tag}" | |
| echo branch_tag="${branch_tag}" >> "$GITHUB_OUTPUT" | |
| # just a debugger | |
| inspect-needs: | |
| needs: [check-changes, ros] | |
| runs-on: dimos-runner-ubuntu-2204 | |
| if: always() | |
| steps: | |
| - run: | | |
| echo '${{ toJSON(needs) }}' | |
| ros: | |
| needs: [check-changes] | |
| if: needs.check-changes.outputs.ros == 'true' | |
| uses: ./.github/workflows/_docker-build-template.yml | |
| with: | |
| should-run: true | |
| from-image: ubuntu:22.04 | |
| to-image: ghcr.io/dimensionalos/ros:${{ needs.check-changes.outputs.branch-tag }} | |
| dockerfile: ros | |
| ros-python: | |
| needs: [check-changes, ros] | |
| if: always() | |
| uses: ./.github/workflows/_docker-build-template.yml | |
| with: | |
| 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 | |
| python: | |
| needs: [check-changes] | |
| if: needs.check-changes.outputs.python == 'true' | |
| uses: ./.github/workflows/_docker-build-template.yml | |
| with: | |
| should-run: 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() | |
| 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 | |
| navigation: | |
| needs: [check-changes] | |
| if: needs.check-changes.outputs.navigation == 'true' | |
| runs-on: [self-hosted, Linux] | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Fix permissions | |
| run: | | |
| sudo chown -R $USER:$USER ${{ github.workspace }} || true | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Checkout ros-navigation-autonomy-stack | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: dimensionalOS/ros-navigation-autonomy-stack | |
| ref: fastlio2 | |
| path: docker/navigation/ros-navigation-autonomy-stack | |
| fetch-depth: 1 | |
| lfs: false | |
| token: ${{ secrets.NAV_REPO_READ_TOKEN }} | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: crazy-max/ghaction-github-runtime@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| with: | |
| driver: docker-container | |
| install: true | |
| use: true | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| context: . | |
| file: docker/navigation/Dockerfile | |
| tags: ghcr.io/dimensionalos/navigation:${{ needs.check-changes.outputs.branch-tag }} | |
| cache-from: type=gha,scope=navigation | |
| cache-to: type=gha,mode=max,scope=navigation | |
| build-args: | | |
| ROS_DISTRO=humble | |
| ros-dev: | |
| needs: [check-changes, ros-python] | |
| if: always() | |
| uses: ./.github/workflows/_docker-build-template.yml | |
| with: | |
| should-run: ${{ | |
| needs.check-changes.result == 'success' && | |
| (needs.check-changes.outputs.dev == 'true' || | |
| (needs.ros-python.result == 'success' && (needs.check-changes.outputs.python == 'true' || needs.check-changes.outputs.ros == '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-tests: | |
| needs: [check-changes, ros-dev] | |
| if: ${{ | |
| always() && | |
| needs.check-changes.result == 'success' && | |
| (needs.check-changes.outputs.tests == 'true' || | |
| needs.check-changes.outputs.ros == 'true' || | |
| needs.check-changes.outputs.python == 'true' || | |
| needs.check-changes.outputs.dev == 'true') | |
| }} | |
| uses: ./.github/workflows/tests.yml | |
| secrets: inherit | |
| with: | |
| cmd: "_DIMOS_COV=1 coverage run -m pytest --durations=0 -m 'not (tool or mujoco)' && coverage combine && coverage html && coverage report" | |
| upload-coverage: true | |
| dev-image: ros-dev:${{ (needs.check-changes.outputs.python == 'true' || needs.check-changes.outputs.dev == 'true' || needs.check-changes.outputs.ros == 'true') && needs.ros-dev.result == 'success' && needs.check-changes.outputs.branch-tag || 'dev' }} | |
| run-mypy: | |
| needs: [check-changes, ros-dev] | |
| if: ${{ | |
| always() && | |
| needs.check-changes.result == 'success' && | |
| (needs.check-changes.outputs.tests == 'true' || | |
| needs.check-changes.outputs.ros == 'true' || | |
| needs.check-changes.outputs.python == 'true' || | |
| needs.check-changes.outputs.dev == 'true') | |
| }} | |
| uses: ./.github/workflows/tests.yml | |
| secrets: inherit | |
| with: | |
| cmd: "MYPYPATH=/opt/ros/humble/lib/python3.10/site-packages mypy dimos" | |
| dev-image: ros-dev:${{ (needs.check-changes.outputs.python == 'true' || needs.check-changes.outputs.dev == 'true' || needs.check-changes.outputs.ros == 'true') && needs.ros-dev.result == 'success' && needs.check-changes.outputs.branch-tag || 'dev' }} | |
| ci-complete: | |
| needs: [check-changes, ros, python, ros-python, dev, ros-dev, run-tests, run-mypy] | |
| runs-on: [self-hosted, Linux] | |
| if: always() | |
| steps: | |
| - name: CI gate | |
| if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} | |
| run: | | |
| echo "❌ One or more CI jobs failed or were cancelled" | |
| exit 1 | |
| - name: CI passed | |
| run: echo "✅ All CI checks passed or were intentionally skipped" |