-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (53 loc) · 2.27 KB
/
Copy pathMakefile
File metadata and controls
65 lines (53 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
.PHONY: install install-full setup-assets test test-fast verify clean clean-generated check-uv view
PYTHON ?= 3.11
MUJOCO_GL ?= egl
# Guard: ensure uv is installed before any target that needs it
check-uv:
@command -v uv >/dev/null 2>&1 || { echo "ERROR: uv not found. Install with: curl -LsSf https://astral.sh/uv/install.sh | sh"; exit 1; }
# Create venv + install all deps (Scenic + dev + pinned LIBERO source)
install: check-uv
uv venv --python $(PYTHON)
uv sync --extra dev
uv run libero-inf-bootstrap
# Full setup (alias for install)
install-full: install
# Download and validate HF assets, refresh ~/.libero/config.yaml and assets link
setup-assets: check-uv
PYTHONPATH=src uv run python -c "from libero_infinity.runtime import ensure_runtime; ensure_runtime()"
# Run the full test suite (headless). Requires GPU/EGL for simulation tests.
test:
MUJOCO_GL=$(MUJOCO_GL) PYTHONPATH=src .venv/bin/python -m pytest tests/ -v
# Run only Tier 1 (no-GPU) tests: Scenic, perturbation policy, and planner.
# Use this target on machines without a GPU or when iterating quickly.
test-fast:
MUJOCO_GL=$(MUJOCO_GL) PYTHONPATH=src .venv/bin/python -m pytest \
tests/test_scenic.py \
tests/test_perturbation_policy.py \
tests/test_planner.py \
-v
# Run full verification script
verify:
MUJOCO_GL=$(MUJOCO_GL) uv run python scripts/verify_build.py
# Open interactive MuJoCo viewer for a task + perturbation
# Usage: make view BDDL=<task_name_or_path> SUITE=<suite> PERTURBATION=<type>
# Example:
# make view BDDL=pick_up_the_black_bowl_on_the_stove_and_place_it_on_the_plate \
# SUITE=libero_spatial PERTURBATION=position
BDDL ?=
SUITE ?=
PERTURBATION ?= position
view: check-uv
@test -n "$(BDDL)" || { echo "ERROR: BDDL is required. Usage: make view BDDL=<task_name> [SUITE=<suite>] [PERTURBATION=<type>]"; exit 1; }
uv run python scripts/viewer.py \
--bddl "$(BDDL)" \
$(if $(SUITE),--suite "$(SUITE)") \
--perturbation "$(PERTURBATION)"
# Delete the venv for a clean rebuild.
# uv.lock is intentionally preserved — it is the reproducibility lockfile and
# must never be deleted by `make clean`. Run `rm uv.lock` manually if you
# truly want to regenerate it.
clean:
rm -rf .venv
# Remove generated Scenic programs
clean-generated:
rm -rf scenic/generated