Info | ||
---|---|---|
| ||
Supplemental information is available from the JobScheduler Agent for Docker article. |
Introduction
The JobScheduler Universal Agent can be run operated inside a Docker container.
...
- run multiple services inside a docker containerDocker container
- Usually docker containers are restricted to run a single process.
- If JobScheduler Universal Agent is run as this single process, it can be used to start additional processes.
- start and stop services inside a docker Docker container without restarting the docker container
- run any number of shell scripts inside a Docker container
- manage workflows with JobScheduler Master and run distributed job chains with job nodes for different Docker containers
Creating a JobScheduler Universal Agent image
download the Dockerfile
Code Block language bash title Dockerfile collapse true FROM java:8-jre EXPOSE 4445 WORKDIR /root RUN wget https://download.sos-berlin.com/JobScheduler.1.13/jobscheduler_unix_universal_agent.1.13.3.tar.gz && \ tar xfvz jobscheduler_unix_universal_agent.1.13.3.tar.gz CMD ["/root/jobscheduler_agent/bin/jobscheduler_agent.sh", "start_docker"]
- put it into a working directory on a Docker host
- cd into the working directory
create the image with
tCode Block language bash docker build --rm --
tag=jsagent .
The dockerfile Dockerfile is based on the jre8 image of https://registry.hub.docker.com/_/java/. It downloads the current TP indicated release of the JobScheduler Universal Agent and extracts it in the /root directory.
It exposes Port 4445 (the standard port of the JobScheduler Universal Agent).
It start starts the JobScheduler Universal Agent with the "start_docker" parameter. See
Jira | ||||||
---|---|---|---|---|---|---|
|
Stopping the Docker container
If the docker container is stopped with
Code Block | ||
---|---|---|
| ||
docker stop jsagent |
Docker will send a SIGTERM Signal to the Agent start script process which will try to end JobScheduler Universal Agent gracefully. This means that the Agent will not start any new jobs but let running jobs finish normally.
However, by default Docker has a timeout of 10 seconds for stopping a container. So, 10 seconds after the stop command, Docker will kill all running jobs and other processes inside the container.
This might be too short for some jobs to finish, so using a higher timeout is recommended:
Code Block | ||
---|---|---|
| ||
docker stop —-time=120 jsagent |
Change Management References
Jira | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|