Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1682 commits
Select commit Hold shift + click to select a range
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
049f799
initial sketch of module-agent interface
leshy Dec 10, 2025
208fcea
message passing established
leshy Dec 11, 2025
174f5ae
tool config propagation
leshy Dec 11, 2025
2be5419
types extracted, tool config
leshy Dec 11, 2025
3dabf7f
__init__ files
leshy Dec 11, 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
1281a48
agent interface work
leshy Dec 11, 2025
0857dd8
test fix
leshy Dec 11, 2025
1bbf256
working system
leshy Dec 11, 2025
5c822c6
agent callback, tool test
leshy Dec 11, 2025
28b8c96
tool decorator implies RPC decorator
leshy Dec 11, 2025
9ea18f6
small cleanup
leshy Dec 11, 2025
3ca9b21
tool -> skill rename
leshy Dec 11, 2025
62a5fbd
type fixes
leshy Dec 11, 2025
4bd1564
module test
leshy Dec 11, 2025
ed71b3a
modules provide tf by default
leshy Dec 11, 2025
9ea4129
agentspy cli, other cli tools installing corectly via pyproject
leshy Dec 11, 2025
dac24c0
small fixes
leshy 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
7a39749
cleanup
leshy Dec 11, 2025
32f83d3
small changes
leshy 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
b9ceaaa
ros validating transforms with ros examples
leshy 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
e3c30b2
Exposed optional memory_limit param in dimos core
spomichter Dec 11, 2025
16bafbe
WIP agent tensorzero refactor
spomichter Dec 10, 2025
5ef3449
Added new agent and agent modules tests
spomichter Dec 10, 2025
7a48968
New agent tensorzero implementation and agent modules
spomichter Dec 10, 2025
efe24b7
Added agent encode to Image type
spomichter Dec 10, 2025
5276454
Added agent message types
spomichter Dec 10, 2025
fcb7125
disabled test_gateway
leshy Dec 11, 2025
8c4bc83
Fixed convo history, agent types, fixed tests
spomichter Dec 11, 2025
8c08459
Merge pull request #541 from dimensionalOS/agent-refactor-conversatio…
spomichter Dec 11, 2025
e3a03dc
rpc timeout
leshy Dec 11, 2025
886fd60
Merge branch 'dev' into skillsketch
leshy Dec 11, 2025
6472092
Reverted tofix pytest marker
spomichter Dec 11, 2025
7589fee
Added LLM api keys to CI for new agent tests
spomichter Dec 11, 2025
c1526a3
Deleted unused AgentModule
spomichter Dec 11, 2025
2207742
Deleted soon to be deprecated agent query_in streaming test
spomichter Dec 11, 2025
276e3b8
Add alibaba api key in place of dashscope
spomichter Dec 11, 2025
2b1c14b
Skip unused test
spomichter Dec 11, 2025
fd49d53
Fixed conversation history
spomichter Dec 11, 2025
bb07b46
Not using cerebras tests in CI
spomichter Dec 11, 2025
3e4d419
Fix tests to use dev image from branch if EITHER python or dev rebuil…
spomichter Dec 11, 2025
95978af
Move env vars inside test container block
spomichter Dec 11, 2025
91f8955
Added secrets to tests
spomichter Dec 11, 2025
6fce31d
Patch dev image issue to run-ros-tests in CI
spomichter Dec 11, 2025
0929609
Disabled cerebras for CI
spomichter Dec 11, 2025
9ec60ac
Ros-dev needs to be rebuilt if dev image builds OR if EITHER ros/pyth…
spomichter Dec 11, 2025
10284d7
Reverted to basic gateway test, soon to be deprecated
spomichter Dec 11, 2025
fef7f6a
Exposed optional memory_limit param in dimos core (#540)
spomichter Dec 11, 2025
c45dd00
Merge pull request #535 - Major Agent rebuild, Working AgentModule, C…
spomichter Dec 11, 2025
4ae6665
Merge pull request #538 from dimensionalOS/ros_transform_test
spomichter Dec 11, 2025
fbbd61e
Merge pull request #542 from dimensionalOS/rpc_timeout
spomichter Dec 11, 2025
1f74efa
add mujoco simulation for unitree go1
paul-nechifor Dec 11, 2025
dd73679
move code to appropriate places
paul-nechifor Dec 11, 2025
2926cb0
CI code cleanup
paul-nechifor Dec 11, 2025
dea51a0
remove old dependencies
paul-nechifor Dec 11, 2025
db4407f
treat unknown as safe if configured
paul-nechifor Dec 12, 2025
bd17bbd
configure inflate radius
paul-nechifor Dec 12, 2025
e236f67
clean up on exit
paul-nechifor Dec 12, 2025
f45208a
CI code cleanup
paul-nechifor Dec 12, 2025
65944e2
move simulation dependencies to optional sim
paul-nechifor Dec 12, 2025
da68552
only import mujoco if it is being used
paul-nechifor Dec 12, 2025
494a59a
CI code cleanup
paul-nechifor Dec 12, 2025
a602343
Merge pull request #539 from dimensionalOS/simulation
paul-nechifor Dec 12, 2025
968cf30
Revert "MuJoCo Simulation"
spomichter Dec 12, 2025
577554a
Merge pull request #548 from dimensionalOS/revert-539-simulation
spomichter Dec 12, 2025
0615cdc
rpc stress test
leshy Dec 12, 2025
ce35bc7
fix: event loop leak
paul-nechifor Dec 12, 2025
b8224e5
CI code cleanup
paul-nechifor Dec 12, 2025
90a4b39
commiting this before it gets too disgusting
alexlin2 Dec 9, 2025
a137085
updated object tracker to use latest stuff
alexlin2 Dec 10, 2025
b5c46e0
fix header issue
alexlin2 Dec 10, 2025
63774de
fixed local planner and transform bug
alexlin2 Dec 10, 2025
8bc0708
refactored manipulation module to use dimos types
alexlin2 Dec 10, 2025
2a96470
added camera module for monocular depth estimation
alexlin2 Dec 10, 2025
c2fab8b
cleaned up navigator, make set_goal blocking
alexlin2 Dec 10, 2025
a5df3e7
NavigateWithText now fully working
alexlin2 Dec 10, 2025
8c3d9b7
update spatial memory to use new types
alexlin2 Dec 10, 2025
4b808c8
more updates to pass tests
alexlin2 Dec 11, 2025
b2f547c
small bug
alexlin2 Dec 11, 2025
ba23a96
fixed object tracking targeting
alexlin2 Dec 11, 2025
47a4a1c
cleanup and added integration test
alexlin2 Dec 11, 2025
5338910
added safe goal selector and fixed bugs
alexlin2 Dec 11, 2025
46bfc0c
rebased off of dev
alexlin2 Dec 11, 2025
efa3018
CI code cleanup
alexlin2 Dec 11, 2025
eb7ebb0
tuning
alexlin2 Dec 11, 2025
bf92bff
finally fixed the ridiculously silent bug
alexlin2 Dec 11, 2025
0b19835
need to pass test
alexlin2 Dec 11, 2025
b75768f
fixed some bugs
alexlin2 Dec 11, 2025
efbd845
added orientation to path
alexlin2 Dec 11, 2025
a3ef471
added recovery behaviors
alexlin2 Dec 11, 2025
1009204
ADDED RPC TIMEOUT, super important
alexlin2 Dec 11, 2025
7dd419e
removed observe and observe stream skill as they are deprecated
alexlin2 Dec 11, 2025
12f6285
pass tests
alexlin2 Dec 11, 2025
7d64f87
fixed a lot of bugs, changed costmap gradient to be handle by the con…
alexlin2 Dec 12, 2025
dce7fd0
pass tests
alexlin2 Dec 12, 2025
4f2cb56
massive improvements and bug fixes
alexlin2 Dec 12, 2025
177a224
added minimal robot interface class
alexlin2 Dec 12, 2025
35022e7
small transform util bug
alexlin2 Dec 12, 2025
ea52d3a
remove passing in reference to modules
alexlin2 Dec 12, 2025
2306540
Merge pull request #534 - Perception and Navigation Architecture Over…
alexlin2 Dec 12, 2025
1634578
work on correct event wait
leshy Dec 12, 2025
c53e967
Merge pull request #536 - Initial Skills Coordinator to manage skill …
spomichter Dec 12, 2025
88b772c
correct faster RPC replies & timeout errors
leshy Dec 12, 2025
2319d26
Merge branch 'dev' into rpcstress
leshy Dec 12, 2025
a3cb1dc
merge bugfix
leshy Dec 12, 2025
0147555
typo
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