Containerd Tracker provides an implementation of the DRMAA2 JobTracker interface for managing containers with containerd. It allows you to use the DRMAA2 interface to create, control, and manage containerd containers as jobs. The package also contains implementations for managing container lifecycles, getting container information, and mapping container states to DRMAA2 job states.
Containerd Tracker provides an API to manage containerd containers as jobs using the DRMAA2 interface. It offers the following functionality:
-
Creating and starting containerd containers using the DRMAA2 JobTemplate. The container image and command to run within the container are specified in the JobCategory and Args fields of the JobTemplate, respectively.
-
Listing all containerd containers and their corresponding job IDs.
-
Providing job control functions such as suspend, resume, and terminate for managing containerd containers.
-
Mapping DRMAA2 Job Control commands to corresponding containerd actions for seamless integration.
-
Mapping DRMAA2 JobState to containerd state to provide a consistent view of the container's status.
-
Retrieving container information and mapping it to the DRMAA2 JobInfo struct.
Please note that some DRMAA2 features, such as Hold, Release, and Job Arrays, are not supported in the Containerd Tracker due to limitations in containerd.
To use Containerd Tracker, you'll need to create a new ContainerdJobTracker instance with the containerd address:
tracker, err := containerdtracker.NewContainerdJobTracker("/run/containerd/containerd.sock")
A JobTemplate requires:
- JobCategory -> which maps to the container image to be used
- Args -> which is the command to be executed within the given container image
DRMAA2 Job Control | Containerd Action |
---|---|
Suspend | Pause |
Resume | Resume |
Terminate | Kill (SIGTERM) |
DRMAA2 State | Containerd State |
---|---|
Queued | Created |
Running | Running, Pausing |
Suspended | Paused |
Done | Stopped - Exit code 0 |
Failed | Stopped - Exit code != 0 |
Undetermined | other |
The Containerd Tracker provides an implementation to retrieve container information and map it to the DRMAA2 JobInfo struct. Some fields may not be directly available from containerd and might require further customization based on your specific requirements.
Job Arrays are not supported in the Containerd Tracker due to limitations in containerd. However, you can implement job arrays by manually creating multiple tasks sequentially in a loop.
The Containerd Tracker includes Ginkgo tests that can be run to ensure proper functionality. To run the tests, make sure you have Ginkgo and Gomega installed, and then execute ginkgo
in the package directory.
The Containerd Tracker has some limitations, including:
- It does not support DRMAA2 Hold and Release actions.
- Job Arrays are not natively supported in containerd and must be implemented manually.
- Some JobTemplate fields may require additional customization to work seamlessly with containerd configurations.
Despite these limitations, the Containerd Tracker provides a convenient way to use the DRMAA2 interface for managing containerd containers as jobs.