Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pixi configuration #281

Merged
merged 6 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ on:
types:
- published
schedule:
# * is a special character in YAML so you have to quote this string
# Execute a "nightly" build at 2 AM UTC
# Execute a nightly build at 2am UTC.
- cron: '0 2 * * *'


Expand Down Expand Up @@ -138,6 +137,8 @@ jobs:
steps.changes.outputs.all == 'true')
run: pytest
env:
# https://github.com/pytest-dev/pytest/issues/7443#issuecomment-656642591
PY_COLORS: "1"
JAX_PLATFORM_NAME: cpu

publish:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Update pixi lockfile
name: Pixi

permissions:
contents: write
Expand All @@ -7,12 +7,16 @@ permissions:
on:
workflow_dispatch:
schedule:
- cron: 0 5 1 * *
# Execute at 5am UTC on the first day of the month.
- cron: '0 5 1 * *'

jobs:

pixi-update:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:

- uses: actions/checkout@v4
with:
lfs: true
Expand All @@ -30,9 +34,14 @@ jobs:
set -o pipefail
pixi update --json | pixi exec pixi-diff-to-markdown --explicit-column > diff.md

- name: Test project against updated pixi
run: pixi run --environment tasks-cpu tests
env:
PY_COLORS: "1"
JAX_PLATFORM_NAME: cpu

- name: Commit and push changes
run: |
echo "BRANCH_NAME=update-pixi-$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
run: echo "BRANCH_NAME=update-pixi-$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV

- name: Create pull request
uses: peter-evans/create-pull-request@v7
Expand Down
82 changes: 60 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Games/Entertainment :: Simulation",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
Expand Down Expand Up @@ -132,8 +133,10 @@ testpaths = [
[tool.ruff]
exclude = [
".git",
".pixi",
".pytest_cache",
".ruff_cache",
".idea",
".vscode",
".devcontainer",
"__pycache__",
Expand Down Expand Up @@ -179,52 +182,87 @@ ignore = [
channels = ["conda-forge"]
platforms = ["linux-64", "osx-arm64", "osx-64"]

[tool.pixi.environments]
# We resolve only two groups: cpu and gpu.
# Then, multiple environments can be created from these groups.
default = { solve-group = "cpugroup" }
gpu = { features = ["gpu"], solve-group = "gpugroup" }
tasks-cpu = { features = ["test", "examples"], solve-group = "cpugroup" }
tasks-gpu = { features = ["test", "examples", "gpu"], solve-group = "gpugroup" }

# ---------------
# feature.default
# ---------------

# Dependencies from conda-forge.
[tool.pixi.dependencies]
#
# Matching `project.dependencies`.
#
coloredlogs = "*"
jax = "*"
jax-dataclasses = "*"
jaxopt = "*"
jaxlib = "*"
jaxlie = "*"
lxml = "*"
mediapy = "*"
mujoco = "*"
notebook = "*"
jax-dataclasses = "*"
pptree = "*"
optax = "*"
qpax = "*"
rod = "*"
sdformat14 = "*"
typing_extensions = "*"
#
# Optional dependencies.
#
lxml = "*"
mediapy = "*"
mujoco = "*"
scipy = "*"
#
# Additional dependencies.
#
pip = "*"

# Dependendencies from PyPI.
[tool.pixi.pypi-dependencies]
jaxsim = { path = "./", editable = true }

# ------------
# feature.test
# ------------

[tool.pixi.feature.test.tasks]
examples = { cmd = "jupyter notebook ./examples" }
pipcheck = "pip check"
test = { cmd = "pytest", depends_on = ["pipcheck"] }
tests = { cmd = "pytest", depends_on = ["pipcheck"] }

[tool.pixi.feature.test.dependencies]
black = "24.*"
idyntree = "*"
isort = "*"
pip = "*"
pre-commit = "*"
pytest = "*"
pytest-icdiff = "*"
robot_descriptions = "*"

# ----------------
# feature.examples
# ----------------

[tool.pixi.feature.examples.tasks]
examples = { cmd = "jupyter notebook ./examples" }

[tool.pixi.feature.examples.dependencies]
notebook = "*"
robot_descriptions = "*"

# -----------
# feature.gpu
# -----------

[tool.pixi.feature.gpu]
platforms = ["linux-64"]
system-requirements = { cuda = "12.1" }
system-requirements = { cuda = "12" }

[tool.pixi.feature.gpu.dependencies]
cuda-cupti = "*"
cuda-version = "12.*"
jaxlib = {version = "*", build = "*cuda*"}

[tool.pixi.pypi-dependencies]
jaxsim = { path = "./", editable = true }

[tool.pixi.environments]
default = { solve-group = "cpugroup" }
xela-95 marked this conversation as resolved.
Show resolved Hide resolved
gpu = { features = ["gpu"], solve-group = "gpugroup" }
test-cpu = { features = ["test"], solve-group = "cpugroup" }
test-gpu = { features = ["test", "gpu"], solve-group = "gpugroup" }
# Pinning a specific version awaiting the following to get addressed:
# https://github.com/conda-forge/jaxlib-feedstock/issues/285
jaxlib = { version = "<0.4.31", build = "*cuda*" }