Skip to content
Open
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
61 changes: 61 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
push:
branches:
- main
tags:
- "*"
pull_request:

env:
JULIA_PKG_SERVER: internal.juliahub.com
# The MPC stack is not all registered: MPCComponents, the LinearMPC fork and the acados JLLs
# are cloned from Git, which needs the CLI client rather than libgit2 for the credentials the
# registry step installs.
JULIA_PKG_USE_CLI_GIT: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}

# This repository is public, and the org's `Default` runner group has
# `allows_public_repositories: false`, so a bare `runs-on: self-hosted` job never resolves and
# queues forever. Public repositories are served by the `public` runner group, whose scale sets
# advertise no bare `self-hosted` label and have to be named: the tiers are
# `self-hosted-{2vcpu-4gb,4vcpu-8gb,8vcpu-16gb,8vcpu-32gb}-public`. This suite compiles the
# multibody models and builds acados, so it takes the heavy-compute tier.
runs-on: self-hosted-8vcpu-16gb-public

strategy:
fail-fast: false
matrix:
version:
- "1.12"
os:
- self-hosted-8vcpu-16gb-public
arch:
- x64

steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

- uses: julia-actions/setup-julia@5c9647d97b78a5debe5164e9eec09d653d29bd71 # v2.6.1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}

- name: "Set up private JuliaHub registries"
uses: "JuliaComputing/set-up-private-juliahub-registries@2f465506027adbe8086afc41dd3514e9020d1577" # v2.0.0
with:
encoded-juliahub-token: "${{ secrets.JULIAHUB_TOKEN_ENCODED }}"
ssh-key: "${{ secrets.JULIASIM_REGISTRY_SSH_KEY }}"
enable-JuliaHubRegistry: "true"

- uses: julia-actions/julia-buildpkg@e3eb439fad4f9aba7da2667e7510e4a46ebc46e1 # v1

- uses: julia-actions/julia-runtest@b67f25cc97aa716a662fc9586ea6d5d7bf6c2da3 # v1
14 changes: 7 additions & 7 deletions Manifest.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 19 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ DyadInterface = "99806f68-afab-45ca-9d8c-ceff6bc61f54"
ElectricalComponents = "3fc4c519-469d-4ff5-98c9-d4d06b1514a2"
HydraulicComponents = "b6ec4bdb-baef-4449-8ab3-f7a9cc7f1342"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LinearMPC = "82e1c212-e1a2-49d2-b26a-a31d6968e3bd"
MPCComponents = "aba2bcdf-b216-4bf2-af71-aceb9999ebd9"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
Expand All @@ -30,13 +31,26 @@ SynchJulia = "a1b2c3d4-5e6f-7a8b-9c0d-e1f2a3b4c5d6"
SynchToolkit = "f500ffa8-9682-42ac-8d34-0ca7926c2e94"
ThermalComponents = "084a29d9-4f48-4925-95b4-b7d4c79725f4"
TranslationalComponents = "42acc370-819b-4877-bdd6-eb3294461f5d"
acados_jll = "49ddb18e-ca18-5f65-a4dd-7588daaac186"
tera_renderer_jll = "73a839a6-9370-58f6-a727-029f0c62a9a5"

# MPCComponents is not registered, and the MPC stack it needs is not all released. What each pin
# is for:
#
# MPCComponents its `main`, which has to include JuliaComputing/MPCComponents.jl#31: without it
# the multibody prediction model is rejected as time-varying.
# LinearMPC, acados JLLs unregistered forks MPCComponents builds on.
# LinearMPC, acados JLLs unregistered forks MPCComponents builds on. They are listed under
# `[deps]` rather than `[extras]` even though nothing here calls them: a `[sources]`
# entry binds only for a package the active project depends on, so with them in
# `[extras]` the resolver had no version to place for `acados_jll`, which
# MPCComponents requires, and every `Pkg.resolve` failed with `has no known
# versions`. LinearMPC failed more quietly still -- it is registered, so the
# resolver silently took the release in place of the fork with the disturbance
# cross term.
#
# MultibodyComponents is no longer taken from a local checkout: the registered 0.2.4 resolves
# against the rest of this stack, so a sibling `../MultibodyComponents` is no longer needed and
# this environment resolves from nothing but the registries and the sources below.
#
# DiscreteComponents is no longer pinned either: 0.4.0 has both `AlphaBetaGammaFilter`, the velocity
# estimator (JuliaComputing/DiscreteComponents.jl#119), and `Latest`, the clock transition (#121),
Expand All @@ -55,7 +69,6 @@ TranslationalComponents = "42acc370-819b-4877-bdd6-eb3294461f5d"
[sources]
LinearMPC = {rev = "feat/disturbance-cross-term", url = "https://github.com/baggepinnen/LinearMPC.jl.git"}
MPCComponents = {rev = "main", url = "https://github.com/JuliaComputing/MPCComponents.jl"}
MultibodyComponents = {path = "../MultibodyComponents"}
acados_jll = {rev = "main", url = "https://github.com/baggepinnen/acados_jll.jl"}
tera_renderer_jll = {rev = "main", url = "https://github.com/baggepinnen/tera_renderer_jll.jl"}

Expand All @@ -69,11 +82,12 @@ DyadInterface = "7.1.0"
ElectricalComponents = "2.2.1"
HydraulicComponents = "2.0.3"
LinearAlgebra = "1.12.0"
LinearMPC = "0.10"
MPCComponents = "0.1.0"
Markdown = "1"
ModelingToolkit = "11"
Moshi = "0.3"
MultibodyComponents = "0.2.2"
MultibodyComponents = "0.2.4"
OrderedCollections = "1.8"
OrdinaryDiffEqDefault = "2"
PrecompileTools = "1"
Expand All @@ -86,18 +100,17 @@ SynchJulia = "0.8"
SynchToolkit = "0.5.1"
ThermalComponents = "2.0.5"
TranslationalComponents = "2.4.2"
acados_jll = "0.6.0"
tera_renderer_jll = "0.2"

[dyad]
kernel = "2.3.0"

[extras]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
LinearMPC = "82e1c212-e1a2-49d2-b26a-a31d6968e3bd"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
acados_jll = "49ddb18e-ca18-5f65-a4dd-7588daaac186"
tera_renderer_jll = "73a839a6-9370-58f6-a727-029f0c62a9a5"

[targets]
test = ["CSV", "DataFrames", "Plots", "Test"]
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ pkg> add ModelingToolkit MultibodyComponents SynchToolkit OrdinaryDiffEqDefault
### The simulation-only branch

Those commands resolve `main` only for someone who can reach the repositories the MPC
controller is pinned to: MPCComponents is not registered, and `[sources]` names branch
a branch build of LinearMPC, two unregistered acados JLLs and one local checkout
(see [Environment](#environment) below). Everyone
controller is pinned to: MPCComponents is not registered, and `[sources]` names a branch
build of LinearMPC and two unregistered acados JLLs (see [Environment](#environment) below).
Everyone
else installs the branch `simulation-only`, which is `main` as of the commit before the
MPC work and resolves entirely to registered versions:

Expand Down Expand Up @@ -272,22 +272,28 @@ JuliaComputing/SynchToolkit.jl#186, the array clocked variables the MPC's output
KeyError: key (control_system₊mpc₊u(t))[1] not found
```

This branch checks in `Manifest.toml` and `test/Manifest.toml`, resolved against the pinned stack.
MPCComponents comes from its GitHub `main` (which has to include
MPCComponents comes from its GitHub `main`, which has to include
[JuliaComputing/MPCComponents.jl#31](https://github.com/JuliaComputing/MPCComponents.jl/pull/31):
without it the multibody prediction model is rejected as time-varying), and one package has to
come from a local checkout recorded relative to this repository: `../MultibodyComponents` (the
`~/.julia/dev` checkout; the registered release does not resolve against these pins). With both
next to the repo,
without it the multibody prediction model is rejected as time-varying. Nothing comes from a local
checkout any more -- the registered MultibodyComponents 0.2.4 resolves against this stack -- so

```
julia --project=path/to/QuanserComponents -e 'using Pkg; Pkg.instantiate()' # the package
julia --project=path/to/QuanserComponents/test test/hardware_mpc.jl # the scripts
```

is all it takes. For an environment of your own, copy the `[sources]` block (and the `[extras]`
entries they refer to) from Project.toml into it. The first `using` precompiles the multibody and
acados trees, a few minutes.
is all it takes, from a clone and nothing else. `Manifest.toml` and `test/Manifest.toml` are still
checked in, so an instantiate reproduces the stack the tests ran against, but both environments now
also resolve from scratch.

The unregistered packages are listed under `[deps]` rather than `[extras]`, which is what makes
that true. A `[sources]` entry binds only for a package the active project depends on, so while
`acados_jll` sat in `[extras]` the resolver had no version to place for it -- MPCComponents
requires it -- and `Pkg.resolve` failed with `acados_jll has no known versions`. LinearMPC failed
less visibly: it is registered, so the resolver quietly took the release instead of the fork
carrying the disturbance cross term. For an environment of your own, copy the `[sources]` block
and the `[deps]` entries it names. The first `using` precompiles the multibody and acados trees,
a few minutes.

## Layout

Expand Down
Loading
Loading