Skip to content

Release v0.0.9

Release v0.0.9 #3619

Workflow file for this run

name: docker
on:
push:
branches:
- main
- dev
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
permissions:
contents: read
packages: write
pull-requests: read
jobs:
check-changes:
runs-on: [self-hosted, Linux]
outputs:
ros: ${{ steps.filter.outputs.ros }}
python: ${{ steps.filter.outputs.python }}
dev: ${{ steps.filter.outputs.dev }}
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/**
- pyproject.toml
dev:
- docker/dev/**
tests:
- dimos/**
- 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
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-ros-tests:
needs: [check-changes, ros-dev]
if: always()
uses: ./.github/workflows/tests.yml
secrets: inherit
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.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-tests:
needs: [check-changes, dev]
if: always()
uses: ./.github/workflows/tests.yml
secrets: inherit
with:
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.check-changes.outputs.python == 'true' || needs.check-changes.outputs.dev == 'true') && needs.dev.result == 'success' && needs.check-changes.outputs.branch-tag || 'dev' }}
# we run in parallel with normal tests for speed
run-heavy-tests:
needs: [check-changes, dev]
if: always()
uses: ./.github/workflows/tests.yml
secrets: inherit
with:
should-run: ${{
needs.check-changes.result == 'success' &&
((needs.dev.result == 'success') ||
(needs.dev.result == 'skipped' &&
needs.check-changes.outputs.tests == 'true'))
}}
cmd: "pytest -m heavy"
dev-image: dev:${{ (needs.check-changes.outputs.python == 'true' || needs.check-changes.outputs.dev == 'true') && needs.dev.result == 'success' && needs.check-changes.outputs.branch-tag || 'dev' }}
run-lcm-tests:
needs: [check-changes, dev]
if: always()
uses: ./.github/workflows/tests.yml
secrets: inherit
with:
should-run: ${{
needs.check-changes.result == 'success' &&
((needs.dev.result == 'success') ||
(needs.dev.result == 'skipped' &&
needs.check-changes.outputs.tests == 'true'))
}}
cmd: "pytest -m lcm"
dev-image: dev:${{ (needs.check-changes.outputs.python == 'true' || needs.check-changes.outputs.dev == 'true') && needs.dev.result == 'success' && needs.check-changes.outputs.branch-tag || 'dev' }}
run-integration-tests:
needs: [check-changes, dev]
if: always()
uses: ./.github/workflows/tests.yml
secrets: inherit
with:
should-run: ${{
needs.check-changes.result == 'success' &&
((needs.dev.result == 'success') ||
(needs.dev.result == 'skipped' &&
needs.check-changes.outputs.tests == 'true'))
}}
cmd: "pytest -m integration"
dev-image: dev:${{ (needs.check-changes.outputs.python == 'true' || needs.check-changes.outputs.dev == 'true') && needs.dev.result == 'success' && needs.check-changes.outputs.branch-tag || 'dev' }}
run-mypy:
needs: [check-changes, ros-dev]
if: always()
uses: ./.github/workflows/tests.yml
secrets: inherit
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: "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' }}
# Run module tests directly to avoid pytest forking issues
# run-module-tests:
# needs: [check-changes, dev]
# if: ${{
# always() &&
# needs.check-changes.result == 'success' &&
# ((needs.dev.result == 'success') ||
# (needs.dev.result == 'skipped' &&
# needs.check-changes.outputs.tests == 'true'))
# }}
# runs-on: [self-hosted, x64, 16gb]
# container:
# image: ghcr.io/dimensionalos/dev:${{ needs.check-changes.outputs.dev == 'true' && needs.dev.result == 'success' && needs.check-changes.outputs.branch-tag || 'dev' }}
# steps:
# - name: Fix permissions
# run: |
# sudo chown -R $USER:$USER ${{ github.workspace }} || true
#
# - uses: actions/checkout@v4
# with:
# lfs: true
#
# - name: Configure Git LFS
# run: |
# git config --global --add safe.directory '*'
# git lfs install
# git lfs fetch
# git lfs checkout
#
# - name: Run module tests
# env:
# CI: "true"
# run: |
# /entrypoint.sh bash -c "pytest -m module"