RHEL AI ships with a script in /usr/local/bin called ilab which makes running ilab commands feel native even though they're actually running in a podman container
Issues
The script is outdated / used several different container images for different purposes, while it should be just using the single instructlab image
The volume mounts were incorrect, as instructlab now uses XDG paths
Unnecessary directory creation for HF_CACHE
Unnecessary GPU count logic
Script has unnecessary fiddling of ilab parameters, essentially creating a UX that deviates from the natural ilab CLI
Solutions
Changed script to use the single container image IMAGE_NAME (this was already the case mostly, except for old references to LVLM_NAME and TRAIN_NAME which no longer get replaced leading to a broken PODMAN_COMMAND_SERVE. Also adjusted entrypoint to use the ilab executable in the pyenv
Will now mount the host's ~/.config and ~/.local into the container's corresponding directories, for instructlab to use and for its config / data to persist across invocations
Will now mount ~/.cache into the container's corresponding .cache directory, so that the information stored in the default HF_CACHE is also persisted across invocations
Removed unnecessary GPU count logic
Removed all parameter parsing / fiddling
Other changes
Added secret/fake "shell" ilab subcommand which opens a shell in the wrapper's container, useful for troubleshooting issues with the wrapper itself
ilab
wrapper script adjustmentsTicket RHELAI-442
Background
RHEL AI ships with a script in
/usr/local/bin
calledilab
which makes runningilab
commands feel native even though they're actually running in a podman containerIssues
The script is outdated / used several different container images for different purposes, while it should be just using the single instructlab image
The volume mounts were incorrect, as instructlab now uses XDG paths
Unnecessary directory creation for
HF_CACHE
Unnecessary GPU count logic
Script has unnecessary fiddling of
ilab
parameters, essentially creating a UX that deviates from the naturalilab
CLISolutions
Changed script to use the single container image
IMAGE_NAME
(this was already the case mostly, except for old references toLVLM_NAME
andTRAIN_NAME
which no longer get replaced leading to a brokenPODMAN_COMMAND_SERVE
. Also adjusted entrypoint to use theilab
executable in the pyenvWill now mount the host's
~/.config
and~/.local
into the container's corresponding directories, forinstructlab
to use and for its config / data to persist across invocationsWill now mount
~/.cache
into the container's corresponding.cache
directory, so that the information stored in the defaultHF_CACHE
is also persisted across invocationsRemoved unnecessary GPU count logic
Removed all parameter parsing / fiddling
Other changes
Added secret/fake "shell"
ilab
subcommand which opens a shell in the wrapper's container, useful for troubleshooting issues with the wrapper itself