Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1578 commits
Select commit Hold shift + click to select a range
655a420
Test python/dev dockerfiles build simplification
spomichter Dec 8, 2025
0747ed4
Deprecated requirements.txt from check-changes, added pyproject
spomichter Dec 8, 2025
a95c32f
test run spatial memory module without pytest
spomichter Dec 8, 2025
c2e650b
Merge remote-tracking branch 'origin/fix/python-dev-docker-builds' in…
spomichter Dec 8, 2025
9716f95
testing skip builds
spomichter Dec 8, 2025
ff96a9f
Added working exit conditions to builds
spomichter Dec 8, 2025
ad371a3
Testing skip builds
spomichter Dec 8, 2025
34c12f6
ROS container build fix to always build if change
spomichter Dec 8, 2025
d01ae47
Added runner cleanup workflow
spomichter Dec 8, 2025
f08a47d
Fix run spatial module with python directly
spomichter Dec 8, 2025
c74b6a1
Added cleanup-runner to docker.yml in interim
spomichter Dec 8, 2025
2760f5e
Merge remote-tracking branch 'origin/fix/python-dev-docker-builds' in…
spomichter Dec 8, 2025
a1bf967
Test lightweight spatialmemory 1hz
spomichter Dec 8, 2025
043e360
Fix devcontainer sysctl buffer configuration handling in LCMService
spomichter Dec 8, 2025
3bc5319
fix lcmspy test dev container
spomichter Dec 8, 2025
5310d6d
Merge pull request #487 from dimensionalOS/lcm-modules-devcontainers
spomichter Dec 8, 2025
f2ae49f
Merge branch 'spatial-memory-lcm-dask' of github.com:dimensionalOS/di…
spomichter Dec 8, 2025
a626291
Test permission fix to build template docker workflow
spomichter Dec 8, 2025
a6a6abc
Add CI check to lcm autoconf
spomichter Dec 8, 2025
81d943c
Fix lcmservice test in CI
spomichter Dec 8, 2025
5d563c7
Fix ros-dev conditional build
spomichter Dec 8, 2025
2f54925
Fix cleanup needs
spomichter Dec 8, 2025
5320446
timestamped collection for transforms buffer and other things
leshy Dec 8, 2025
26af9c0
transformbuffers
leshy Dec 8, 2025
edb8aed
Merge pull request #477 - Porting types/ LCM msgs/ new LCM types, Tra…
spomichter Dec 8, 2025
4919fa9
transform search
leshy Dec 8, 2025
f5f0601
transform adition
leshy Dec 8, 2025
6f7b5f4
tf publish & reconstruction works
leshy Dec 8, 2025
3789834
Fix lcmservice autoconf in CI
spomichter Dec 8, 2025
499375f
Temp skip hanging test on t3.large ec2
spomichter Dec 8, 2025
0d53653
Modules test added to 16gb runner
spomichter Dec 8, 2025
269cc84
transform from_pose
leshy Dec 8, 2025
7c62572
unitree transforms
leshy Dec 8, 2025
8a3b4a5
transform test fix
leshy Dec 8, 2025
80b79b5
Un skip spatial memory module test
spomichter Dec 8, 2025
0c581e2
remove pil image usage
alexlin2 Dec 8, 2025
cb31f48
revert spatial memory module to gpu only pytest
spomichter Dec 8, 2025
f66a84f
Added gpu, lcm, module pytest markers
spomichter Dec 8, 2025
c3b2758
Spatial memory test fixes, some issue with termination/cuda memory le…
spomichter Dec 8, 2025
d7c3ae6
Working unitree go2 module pytest for cpu CI 16gb
spomichter Dec 8, 2025
22f414e
Test unitree module in 8gb CI runner
spomichter Dec 8, 2025
7b22e60
Skipping object detection/person tracking tests due to ONNX/CUDA memo…
spomichter Dec 8, 2025
88a9425
Merge pull request #488 - PersonTrack and ObjectTrack refactored as M…
spomichter Dec 8, 2025
7efe2ec
Merge pull request #491 - Full Transforms Architecture in Python
spomichter Dec 8, 2025
70970aa
Reverted test python change
spomichter Dec 8, 2025
cf593c1
Merge branch 'dev' into fix/python-dev-docker-builds
spomichter Dec 8, 2025
813f921
Test permission fix to build template docker workflow
spomichter Dec 8, 2025
6a8e993
Added permission fix to self hosted runner workflow
spomichter Dec 8, 2025
11cd491
Merge branch 'fix/python-dev-docker-builds' of github.com:dimensional…
spomichter Dec 8, 2025
ccdce52
Merge pull request #489 - Introduces Self-Hosted Runners and Docker C…
spomichter Dec 8, 2025
9f69d25
Merge branch 'dev' into spatial-memory-lcm-dask
spomichter Dec 8, 2025
f985680
Merge pull request #490 from dimensionalOS/remove_pil_from_qwen
alexlin2 Dec 8, 2025
6be7bf0
Added missing __init__.py's
spomichter Dec 8, 2025
7a881a5
Merge pull request #493 from dimensionalOS/patch-transforms-import-error
spomichter Dec 8, 2025
d7bd821
Added missing __init__.py's
spomichter Dec 8, 2025
2ca943a
Added tofix pytest tag back to addopts
spomichter Dec 8, 2025
d253130
Merge pull request #494 from dimensionalOS/patch-pytest-tofix
spomichter Dec 8, 2025
618c59a
Added tofix pytest tag back to addopts
spomichter Dec 8, 2025
c460684
Added module docs
spomichter Dec 9, 2025
8d1afd0
Merge pull request #495 - Added modules documentation
spomichter Dec 9, 2025
11f0923
Merge pull request #481 - SpatialMemory, Tracking Streams, converted …
spomichter Dec 9, 2025
ba5cf11
initial implementation of pointcloud filtering and segmentation
alexlin2 Nov 25, 2025
d5a079f
small bug fix
alexlin2 Nov 25, 2025
e04f11c
added basic RANSAC plane remove algorithm
alexlin2 Nov 26, 2025
1e8f556
refactored and cleanup pointcloud filtering
alexlin2 Nov 29, 2025
58a78ef
CI code cleanup
alexlin2 Nov 29, 2025
06b2d9a
cleanup pointcloud filtering
alexlin2 Nov 29, 2025
3b00747
added grasp generation to pipeline
alexlin2 Nov 29, 2025
9bb4daf
I'm so f**ing tired after this
alexlin2 Nov 29, 2025
6dcf0e0
added SAM2 support for segmentation, added manipulation perception pr…
alexlin2 Dec 1, 2025
b1a8e99
CI code cleanup
alexlin2 Dec 1, 2025
1906efa
supports contact graspnet
alexlin2 Dec 3, 2025
c1790a0
added parsing of contact graspnet results into dict
alexlin2 Dec 3, 2025
eae71e0
added anygrasp and contact graspnet support
alexlin2 Dec 3, 2025
65c6563
zed frames saving
alexlin2 Dec 3, 2025
2d144fd
zed driver changes, saving 3d pointcloud
alexlin2 Dec 3, 2025
9aee6fd
fixes
alexlin2 Dec 5, 2025
639594e
first commit
alexlin2 Dec 6, 2025
6fdbf0c
PBVS fully working in the correct coordinate frame
alexlin2 Dec 6, 2025
499bd76
added piper arm wrapper
rapmusta Dec 6, 2025
c7f49b0
CI code cleanup
mustafab0 Dec 6, 2025
c87743d
added can init support and soft stopping to avoid crashes when quiting
mustafab0 Dec 6, 2025
5ef9b99
CI code cleanup
mustafab0 Dec 6, 2025
8b05322
addded velocity controller and urdf file
mustafab0 Dec 6, 2025
0fc08bf
added velocity controller with end pose ctrl
mustafab0 Dec 6, 2025
1cfa5d5
added dt to the loop
mustafab0 Dec 6, 2025
416bf81
initial implementation of pointcloud filtering and segmentation
alexlin2 Nov 25, 2025
a9831d7
small bug fix
alexlin2 Nov 25, 2025
09f8351
added basic RANSAC plane remove algorithm
alexlin2 Nov 26, 2025
b25cd2b
refactored and cleanup pointcloud filtering
alexlin2 Nov 29, 2025
6167553
CI code cleanup
alexlin2 Nov 29, 2025
1b35309
cleanup pointcloud filtering
alexlin2 Nov 29, 2025
02c4f0c
added an all-in-one manipulation pipeline that goes from stereo -> la…
alexlin2 Nov 29, 2025
f70eb46
added grasp generation to pipeline
alexlin2 Nov 29, 2025
a43a7dd
I'm so f**ing tired after this
alexlin2 Nov 29, 2025
88c9d47
added SAM2 support for segmentation, added manipulation perception pr…
alexlin2 Dec 1, 2025
32ee427
CI code cleanup
alexlin2 Dec 1, 2025
13cc1b0
added misc points clustering
alexlin2 Dec 2, 2025
a0af403
CI code cleanup
alexlin2 Dec 2, 2025
09168c2
added open3d's voxelgrid to manip_output
alexlin2 Dec 2, 2025
e92579e
CI code cleanup
alexlin2 Dec 2, 2025
7822c60
supports contact graspnet
alexlin2 Dec 3, 2025
80b3f51
added parsing of contact graspnet results into dict
alexlin2 Dec 3, 2025
c68bf66
refactored some code, fixed a few bugs
alexlin2 Dec 3, 2025
4c44365
added anygrasp and contact graspnet support
alexlin2 Dec 3, 2025
cfa546c
removed all contactgraspnet stuff
alexlin2 Dec 3, 2025
ea63c6b
zed frames saving
alexlin2 Dec 3, 2025
efc077e
fixes
alexlin2 Dec 5, 2025
a1292f1
first commit
alexlin2 Dec 6, 2025
97fa36b
CI code cleanup
mustafab0 Dec 6, 2025
e475826
CI code cleanup
mustafab0 Dec 6, 2025
6e30f19
CI code cleanup
mustafab0 Dec 6, 2025
87e7090
fixed frame transform
alexlin2 Dec 6, 2025
8bf886f
feature: PBVS fully working using ZED as origin
alexlin2 Dec 6, 2025
5ba4113
refactored transform function into transform utils
alexlin2 Dec 7, 2025
a05c3cd
Use Scipy for Quaternion to Euler
alexlin2 Dec 7, 2025
3b95e46
switched to using LCM Pose and scipy for pose transforms
alexlin2 Dec 7, 2025
81903bf
CI code cleanup
alexlin2 Dec 7, 2025
6806aed
added timeout to controller
mustafab0 Dec 7, 2025
6c78052
CI code cleanup
mustafab0 Dec 7, 2025
c921875
visual servoing fully working
alexlin2 Dec 7, 2025
87cdc02
CI code cleanup
alexlin2 Dec 7, 2025
f627bef
grasp working
alexlin2 Dec 7, 2025
69468a9
CI code cleanup
alexlin2 Dec 7, 2025
b5481a0
works really well, keeping a checkpoint
alexlin2 Dec 7, 2025
ab74bb3
changed all visual servoing to use LCM types
alexlin2 Dec 7, 2025
bcfe1db
CI code cleanup
alexlin2 Dec 7, 2025
5731fc7
cleanup
alexlin2 Dec 7, 2025
84f64b1
remove build directory
alexlin2 Dec 7, 2025
414b3d5
use piper from ours
alexlin2 Dec 7, 2025
dffce94
removed submodule
alexlin2 Dec 7, 2025
96dae02
switch to using lcm types for transform utils
alexlin2 Dec 7, 2025
c1c2546
Perfected state machine, cleaned everything up
alexlin2 Dec 8, 2025
7432820
further cleanup
alexlin2 Dec 8, 2025
b991bc8
fixed bugs, refactoring
alexlin2 Dec 8, 2025
9c3b950
more cleanup
alexlin2 Dec 8, 2025
7c53b22
turned ZED into a module and simplified the visualization logic
alexlin2 Dec 8, 2025
95ec32d
pick and place as module fully working
alexlin2 Dec 8, 2025
597268e
fully implemented place in pick and place, cleaned up significantly
alexlin2 Dec 8, 2025
71b2386
major refactor, added dynamic grasp angle
alexlin2 Dec 8, 2025
0386391
hacky bug fix
alexlin2 Dec 8, 2025
d3a9016
Feat: fully working piper arm manipulation robot
alexlin2 Dec 8, 2025
a1161d3
bug fix, increased failure tolerance time
alexlin2 Dec 8, 2025
c2bbde1
fixed most of Stash's comments
alexlin2 Dec 8, 2025
48f7d74
Added gpu pytest tag to addopts
spomichter Dec 9, 2025
24fb76a
added chinese readme
alexlin2 Dec 9, 2025
6f2272f
removed submodule
alexlin2 Dec 9, 2025
4f7bdcf
added piper-sdk to manipulation requirements
alexlin2 Dec 9, 2025
8418b05
core restructure
leshy Dec 9, 2025
359bb87
new stream sub methods
leshy Dec 9, 2025
0618b6d
Running modules CI only on 16gb runner
spomichter Dec 9, 2025
e7d9ccf
dimos lcm update to main
leshy Dec 9, 2025
ec93ae7
forgot some files
leshy Dec 9, 2025
27b4f9c
dask tests tagged with module
leshy Dec 9, 2025
5eecbb2
Merge pull request #499 - Run modules tests only on 16gb runner
spomichter Dec 9, 2025
5c28a27
Merge branch 'dev' into corecleanup
leshy Dec 9, 2025
5beaaeb
Trigger CI only on PR or push to main/dev
spomichter Dec 9, 2025
53e7923
undo addition to gitignore, also finally fixed bgr video
alexlin2 Dec 9, 2025
c0c2e87
put back init.py, relaxed frontier exploration filter conditions
alexlin2 Dec 9, 2025
3a8f73e
tf added to core
leshy Dec 9, 2025
52004ac
Merge pull request #500 from dimensionalOS/change-CI-trigger
spomichter Dec 9, 2025
ce3aa9c
Added more aggressive cleanup workflows
spomichter Dec 9, 2025
fd71dfa
fixed TF module
leshy Dec 9, 2025
a16fc64
tests fix
leshy Dec 9, 2025
a7c2e2f
tests fix 2
leshy Dec 9, 2025
a2e3fb6
importing tf from dimos.core for documentation
leshy Dec 9, 2025
0d1a4ac
transform_from and transform_to
leshy Dec 9, 2025
e5f0c2b
added diagon for fun
leshy Dec 9, 2025
89890a2
added charger broadcasting, quaternion from_euler
leshy Dec 9, 2025
75d6955
bidirectional tf graph search
leshy Dec 9, 2025
77837b3
reverse search test
leshy Dec 9, 2025
6e17c0b
Merge pull request #501 from dimensionalOS/test-cleanup-workflow-pt2
spomichter Dec 9, 2025
ff07174
Merge branch 'dev' into corecleanup
leshy Dec 9, 2025
5e67308
rpc kwargs implemented
leshy Dec 9, 2025
0b0d4af
Merge branch 'corecleanup' into protocol_typechecks
leshy Dec 9, 2025
11b1c0e
type cleanup, mypy passing for protocol/
leshy Dec 9, 2025
94db856
Testing run-tests container pull fix and removed modules tests
spomichter Dec 9, 2025
1c68daf
nav tests
leshy Dec 9, 2025
0b0ae94
Merge pull request #476 from dimensionalOS/alexl_ibvs
alexlin2 Dec 9, 2025
cb2f9d6
Merge pull request #505 from dimensionalOS/fix-run-tests-removed-modu…
spomichter Dec 9, 2025
5a649f3
Fix permissions in pre-build-cleanup
spomichter Dec 9, 2025
e465f7e
Merge pull request #508 from dimensionalOS/fix-pre-cleanup-permissions
spomichter Dec 9, 2025
b6310e9
Merge branch 'dev' into protocol_typechecks
leshy Dec 9, 2025
48df989
Merge branch 'dev' into dimoslcm-update
leshy Dec 9, 2025
4930d38
Merge branch 'dev' into rpc_kwargs
leshy Dec 9, 2025
76990b9
Moved pre-build cleanup to build template
spomichter Dec 9, 2025
77bce1b
added aggressive cleanup if >85%
spomichter Dec 9, 2025
2692287
Removed cleanup-runner now redundant
spomichter Dec 9, 2025
150877c
turning off pubsub test for now
leshy Dec 9, 2025
cbd1a64
attempting to disable explicit lfs handling
leshy Dec 9, 2025
27f2e1f
safe directory for lfs
leshy Dec 9, 2025
d831f73
fix permissions
leshy Dec 9, 2025
8bfce26
revert tests.yml
leshy Dec 9, 2025
648038b
tagged test_subscription as a module
leshy Dec 9, 2025
0e9ad6f
checkout fix permissions
leshy Dec 9, 2025
47920d8
no lfs pull, corect fix permissions
leshy Dec 9, 2025
d086601
safe directory
leshy Dec 9, 2025
544a58d
tests.yaml cleanup
leshy Dec 9, 2025
eaa8e45
Merge pull request #509 - Removed cleanup runner
spomichter Dec 9, 2025
634d94f
Merge pull request #498 from dimensionalOS/dimoslcm-update
spomichter Dec 9, 2025
2b24169
Merge pull request #503 - Fixed RPC keyword arguments
spomichter Dec 9, 2025
3df1407
costmap initial sketch
leshy Dec 9, 2025
3dfbece
Merge branch 'dev' into protocol_typechecks
leshy Dec 9, 2025
948b17e
occupancygrid sketch
leshy Dec 9, 2025
8e33d5f
Merge pull request #504 - Transform system, stream convenience observ…
spomichter Dec 9, 2025
b40a4bb
initial occupancygrid foxglove build
leshy Dec 9, 2025
78cae86
dimos lcm bump
leshy Dec 9, 2025
782c43d
Merge branch 'dimoslcm-bump' into localplanner_experiment
leshy Dec 9, 2025
a1e797e
Merge pull request #510 from dimensionalOS/dimoslcm-bump
spomichter Dec 9, 2025
332188c
Testing UV builds in docker
spomichter Dec 9, 2025
87b3c8a
Test removed docker mount cache for pip install
spomichter Dec 9, 2025
277fefd
Added root local bin to PATH
spomichter Dec 9, 2025
8823355
Merge pull request #513 - UV implemented in docker devcontainer
spomichter Dec 9, 2025
a9a9e3d
added alex inflate
leshy Dec 9, 2025
cdea6a2
cleaning up unneeded files
leshy Dec 9, 2025
40a7ac8
global planner uses new occupancyGrid type
leshy Dec 9, 2025
469317b
global planner uses new occupancygrid
leshy Dec 9, 2025
008d29f
tests, type annotations
leshy Dec 9, 2025
3012993
costmap mapper fix
leshy Dec 9, 2025
da4e234
foxglove dash
leshy Dec 9, 2025
246db70
map test fix
leshy Dec 9, 2025
f990e93
vibe check
leshy Dec 9, 2025
7a6b6c2
Merge pull request #511 - OccupancyGrid, Path types
spomichter Dec 10, 2025
810feac
boxglove
leshy Dec 10, 2025
1b52e92
Merge pull request #524 - Added observable operators to LCM output st…
spomichter Dec 10, 2025
979d8df
sam bug fix
alexlin2 Dec 9, 2025
4298f11
commiting this before it gets too disgusting
alexlin2 Dec 9, 2025
30868d4
abomination
alexlin2 Dec 9, 2025
3c67c98
abomination 2
alexlin2 Dec 10, 2025
6ca0407
fixed the dumbest bug ever, double gradient
alexlin2 Dec 10, 2025
9e5931a
fixed local planner and transform bug
alexlin2 Dec 10, 2025
7e1c768
cleaned up navigator, make set_goal blocking
alexlin2 Dec 10, 2025
88d4b30
removed deprecated code to pass tests
alexlin2 Dec 10, 2025
f0f6b4e
more updates to pass tests
alexlin2 Dec 11, 2025
b2926b3
update spatial memory to use new types
alexlin2 Dec 10, 2025
0686034
fixed goal checking
alexlin2 Dec 11, 2025
0670b51
Replaced costmap type with OccupancyGrid, fixed ros tests
spomichter Dec 11, 2025
4944d8a
Test revert spatial memory test - CI hanging
spomichter Dec 11, 2025
71bd665
tests for transform utils
alexlin2 Dec 11, 2025
c7d0a0f
cleanup and added integration test
alexlin2 Dec 11, 2025
1fe5916
bring back spatial memory test and fix bug in connection module
alexlin2 Dec 11, 2025
56307d5
added safe goal selector and fixed bugs
alexlin2 Dec 11, 2025
2bb9957
Fixed spatial memory CPU constraint with multiple ImageEmbedding init…
spomichter Dec 11, 2025
e5e5ab8
added transform util changes to pass tests
alexlin2 Dec 11, 2025
ecffa9b
more changes to pass tests
alexlin2 Dec 11, 2025
bc453a1
more changes to pass tests
alexlin2 Dec 11, 2025
2342842
Only use one SpatialMemory instance in entire test
spomichter Dec 11, 2025
ae54b00
pass module tests
alexlin2 Dec 11, 2025
52e421e
Merge pull request #514 - DimOS Nav2 Multiprocess implementation
spomichter Dec 11, 2025
31e197f
lcmspy fix
leshy Dec 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 32 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "dimos-dev",
"image": "ghcr.io/dimensionalos/dev:dev",
"customizations": {
"vscode": {
"extensions": [
"charliermarsh.ruff",
"ms-python.vscode-pylance"
]
}
},
"containerEnv": {
"PYTHONPATH": "${localEnv:PYTHONPATH}:/workspaces/dimos"
},
"postCreateCommand": "git config --global --add safe.directory /workspaces/dimos && cd /workspaces/dimos && pre-commit install",
"settings": {
"notebook.formatOnSave.enabled": true,
"notebook.codeActionsOnSave": {
"notebook.source.fixAll": "explicit",
"notebook.source.organizeImports": "explicit"
},
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true
},
"runArgs": [
"--cap-add=NET_ADMIN"
]
}
4 changes: 4 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if ! has nix_direnv_version || ! nix_direnv_version 3.0.6; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.6/direnvrc" "sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM="
fi
use flake .
17 changes: 15 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
* text=auto
# Handle line endings automatically for files Git considers text,
# converting them to LF on checkout.
* text=auto eol=lf
# Ensure Python files always use LF for line endings.
*.py text eol=lf

# Treat designated file types as binary and do not alter their contents or line endings.
*.png binary
*.jpg binary
*.ico binary
*.pdf binary
# Explicit LFS tracking for test files
/data/.lfs/*.tar.gz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text binary
*.mp4 filter=lfs diff=lfs merge=lfs -text binary
*.mov filter=lfs diff=lfs merge=lfs -text binary
*.gif filter=lfs diff=lfs merge=lfs -text binary
59 changes: 59 additions & 0 deletions .github/actions/docker-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: docker-build
description: "Composite action to build and push a Docker target to GHCR"
inputs:
target:
description: "Dockerfile target stage to build"
required: true
tag:
description: "Image tag to push"
required: true
freespace:
description: "Remove large pre‑installed SDKs before building to free space"
required: false
default: "false"
context:
description: "Docker build context"
required: false
default: "."

runs:
using: "composite"
steps:
- name: Free up disk space
if: ${{ inputs.freespace == 'true' }}
shell: bash
run: |
echo -e "pre cleanup space:\n $(df -h)"
sudo rm -rf /opt/ghc
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/share/boost
sudo rm -rf /usr/local/lib/android
echo -e "post cleanup space:\n $(df -h)"

- uses: actions/checkout@v4

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- uses: crazy-max/ghaction-github-runtime@v3

- uses: docker/setup-buildx-action@v3
with:
driver: docker-container
install: true
use: true

- name: Build & Push ${{ inputs.target }}
uses: docker/build-push-action@v6
with:
push: true
context: ${{ inputs.context }}
file: docker/${{ inputs.target }}/Dockerfile
tags: ghcr.io/dimensionalos/${{ inputs.target }}:${{ inputs.tag }}
cache-from: type=gha,scope=${{ inputs.target }}
cache-to: type=gha,mode=max,scope=${{ inputs.target }}
build-args: |
FROM_TAG=${{ inputs.tag }}
149 changes: 149 additions & 0 deletions .github/workflows/_docker-build-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
name: docker-build-template
on:
workflow_call:
inputs:
from-image: { type: string, required: true }
to-image: { type: string, required: true }
dockerfile: { type: string, required: true }
freespace: { type: boolean, default: true }
should-run: { type: boolean, default: false }
context: { type: string, default: '.' }

# you can run this locally as well via
# ./bin/dockerbuild [image-name]
jobs:
build:
runs-on: [self-hosted, Linux]
permissions:
contents: read
packages: write

steps:
- name: Fix permissions
if: ${{ inputs.should-run }}
run: |
sudo chown -R $USER:$USER ${{ github.workspace }} || true

- uses: actions/checkout@v4
if: ${{ inputs.should-run }}
with:
fetch-depth: 0

- name: free up disk space
# explicitly enable this for large builds
if: ${{ inputs.should-run && inputs.freespace }}
run: |
echo -e "pre cleanup space:\n $(df -h)"
sudo rm -rf /opt/ghc
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/share/boost
sudo rm -rf /usr/local/lib/android

echo "=== Cleaning images from deleted branches ==="

# Get list of all remote branches
git ls-remote --heads origin | awk '{print $2}' | sed 's|refs/heads/||' > /tmp/active_branches.txt

# Check each docker image tag against branch list
docker images --format "{{.Repository}}:{{.Tag}}|{{.ID}}" | \
grep "ghcr.io/dimensionalos" | \
grep -v ":<none>" | \
while IFS='|' read image_ref id; do
tag=$(echo "$image_ref" | cut -d: -f2)

# Skip if tag matches an active branch
if grep -qx "$tag" /tmp/active_branches.txt; then
echo "Branch exists: $tag - keeping $image_ref"
else
echo "Branch deleted: $tag - removing $image_ref"
docker rmi "$id" 2>/dev/null || true
fi
done

rm -f /tmp/active_branches.txt

USAGE=$(df / | awk 'NR==2 {print $5}' | sed 's/%//')
echo "Pre-docker-cleanup disk usage: ${USAGE}%"

if [ $USAGE -gt 60 ]; then
echo "=== Running quick cleanup (usage > 60%) ==="

# Keep newest image per tag
docker images --format "{{.Repository}}|{{.Tag}}|{{.ID}}" | \
grep "ghcr.io/dimensionalos" | \
grep -v "<none>" | \
while IFS='|' read repo tag id; do
created_ts=$(docker inspect -f '{{.Created}}' "$id" 2>/dev/null)
created_unix=$(date -d "$created_ts" +%s 2>/dev/null || echo "0")
echo "${repo}|${tag}|${id}|${created_unix}"
done | sort -t'|' -k1,1 -k2,2 -k4,4nr | \
awk -F'|' '
{
repo=$1; tag=$2; id=$3
repo_tag = repo ":" tag

# Skip protected tags
if (tag ~ /^(main|dev|latest)$/) next

# Keep newest per tag, remove older duplicates
if (!(repo_tag in seen_combos)) {
seen_combos[repo_tag] = 1
} else {
system("docker rmi " id " 2>/dev/null || true")
}
}'

docker image prune -f
docker volume prune -f
fi

# Aggressive cleanup if still above 85%
USAGE=$(df / | awk 'NR==2 {print $5}' | sed 's/%//')
if [ $USAGE -gt 85 ]; then
echo "=== AGGRESSIVE cleanup (usage > 85%) - removing all except main/dev ==="

# Remove ALL images except main and dev tags
docker images --format "{{.Repository}}:{{.Tag}} {{.ID}}" | \
grep -E "ghcr.io/dimensionalos" | \
grep -vE ":(main|dev)$" | \
awk '{print $2}' | xargs -r docker rmi -f || true

docker container prune -f
docker volume prune -a -f
docker network prune -f
docker image prune -f
fi

echo -e "post cleanup space:\n $(df -h)"

- uses: docker/login-action@v3
if: ${{ inputs.should-run }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# required for github cache of docker layers
- uses: crazy-max/ghaction-github-runtime@v3
if: ${{ inputs.should-run }}

# required for github cache of docker layers
- uses: docker/setup-buildx-action@v3
if: ${{ inputs.should-run }}
with:
driver: docker-container
install: true
use: true

- uses: docker/build-push-action@v6
if: ${{ inputs.should-run }}
with:
push: true
context: ${{ inputs.context }}
file: docker/${{ inputs.dockerfile }}/Dockerfile
tags: ${{ inputs.to-image }}
cache-from: type=gha,scope=${{ inputs.dockerfile }}
cache-to: type=gha,mode=max,scope=${{ inputs.dockerfile }}
#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 }}
33 changes: 33 additions & 0 deletions .github/workflows/code-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: code-cleanup
on: push

permissions:
contents: write
packages: write
pull-requests: read

jobs:
pre-commit:
runs-on: self-hosted
steps:
- name: Fix permissions
run: |
sudo chown -R $USER:$USER ${{ github.workspace }} || true

- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Run pre-commit
id: pre-commit-first
uses: pre-commit/action@v3.0.1
continue-on-error: true

- name: Re-run pre-commit if failed initially
id: pre-commit-retry
if: steps.pre-commit-first.outcome == 'failure'
uses: pre-commit/action@v3.0.1
continue-on-error: false

- name: Commit code changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "CI code cleanup"
Loading
Loading