How to fix plug conflicts with binding¶
The example below binds plugs for the mount interface,
but the same process works for any other interface that supports bindings.
Suppose you have two SDKs that each declare a plug of the same interface,
and the plugs are in conflict.
Here, we use fictional torchaudio:hub and torchvision:hub
that both point to the ~/.cache/torch/hub directory on the host,
where the SDKs store their models.
Create or open your workshop definition and list both SDKs:
.workshop/digits.yaml¶name: digits base: ubuntu@22.04 sdks: - name: torchaudio - name: torchvision
Launching this workshop would cause a conflict because both SDKs want to mount the same directory in the workshop, which is not allowed.
To address this issue, bind the
torchvision:hubplug to thetorchaudio:hubplug by adding abindattribute in the workshop definition:.workshop/digits.yaml¶name: digits base: ubuntu@22.04 sdks: - name: torchaudio - name: torchvision plugs: hub: bind: torchaudio:hub
Launch the workshop. Workshop now recognizes that
torchvision:hubis bound totorchaudio:huband therefore mounts a single directory for both plugs.$ workshop launch digits
Verify the binding with workshop connections:
$ workshop connections digits INTERFACE PLUG SLOT NOTES mount digits/torchaudio:hub digits/system:mount bind.1 mount digits/torchvision:hub digits/system:mount bind.1
Both plugs share the same
bind.1note, which implies they reference the same mount.Any operation on one side automatically applies to the other. For example, after remounting
torchaudio:hub, the information fortorchvision:hubis updated as well:$ mkdir -p .cache/hub $ workshop remount digits/torchaudio:hub .cache/hub $ workshop info digits ... mounts: hub: host-source: /home/user/digits/.cache/hub workshop-target: /home/workshop/.cache/torch/hub
See also¶
Explanation:
Reference: