Configure the Podman application profile or queue in LSF to run
jobs in Podman containers.
About this task
You cannot run pre-execution and post-execution scripts in
container jobs. The following are workarounds for specific pre-execution and post-execution operations:
- To prepare data for the container as a pre-execution or post-execution operation, put this data
into a directory that is mounted to a job container.
- To customize the internal job container, you can customize the starter scripts to prepare the
appropriate environment.
Procedure
-
Edit the lsb.applications or lsb.queues file and
define the CONTAINER parameter for the application profile or queue to run
Podman jobs:
In the following examples, LSF uses
the centos image to run the job in the Podman container.
- For sequential
jobs:
CONTAINER=podman[image(centos) options(--rm)]
The
container for the job is removed after the job is done, which is enabled with the podman
run --rm option.
- For parallel jobs:
CONTAINER=podman[image(centos) options(--rm --net=host --ipc=host -v /path/to/my/passwd:/etc/passwd)]
This
command uses the following podman run options:
- --rm
- The container for the job is removed after the job is done
- --net=host
- LSF needs
the host network for launching parallel tasks.
- -v
- LSF needs
the user ID and user name for launching parallel tasks.
Note: The
passwd file must be in the standard format for UNIX and Linux
password files, such as the following format:
user1:x:10001:10001:::
user2:x:10002:10002:::
-
Edit the lsb.applications or lsb.queues file and
define the EXEC_DRIVER parameter for the application profile or queue to run
Podman jobs.
For Podman jobs, you must specify context[user(default)] as the user
account for starting scripts.
If this parameter is specified in both files, the parameter value in the
lsb.applications file overrides the value in the
lsb.queues file.
EXEC_DRIVER=context[user(default)] \
starter[/path/to/serverdir/docker-starter.py] \
controller[/path/to/serverdir/docker-control.py]
Replace /path/to/serverdir
with the actual file path of the
LSF_SERVERDIR directory.
The file permissions of the starter and controller scripts must be 0755 for Podman jobs.