Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • JOC Cockpit comes preinstalled with a Docker® image.
  • Before running the JOC Cockpit container the following requirements should be met:
    • The Either the embedded H2® database is should be used or an external database is should be available and is accessible , - see the JS7 - Database article for more information.
    • Docker volumes are created with persistent JOC Cockpit configuration data and log files.
    • A Docker network or similar mechanism is available to enable network access between JOC Cockpit, Controller instance(s) and Agents.
  • Initial operation for JOC Cockpit includes:
    • to register registering the Controller instance(s) and Agents that are used in the job scheduling environment.
    • optionally to register registering a JS7 Controller cluster. 

...

After pulling the JOC Cockpit image you can run the container with a number of options like thissuch as:


Code Block
languagebash
titleRunning the JOC Cockpit Container for HTTP Connections
linenumberstrue
#!/bin/sh

docker run -dit --rm \
      --hostname=js7-joc-primary \
      --network=js7 \
      --publish=17446:4446 \
      --env="RUN_JS_JAVA_OPTIONS=-Xmx256m" \
      --env="RUN_JS_USER_ID=$(id -u $USER):$(id -g $USER)" \
      --mount="type=volume,src=js7-joc-primary-config,dst=/var/sos-berlin.com/js7/joc/resources/joc" \
      --mount="type=volume,src=js7-joc-primary-logs,dst=/var/log/sos-berlin.com/js7/joc" \
      --name js7-joc-primary \
      sosberlin/js7:joc-2-0-0-SNAPSHOT

...

  • --network The above example makes use of a Docker network - created e.g. with the command , for example, using the docker network create js7  command - to allow network sharing between containers. Note that any inside ports used by Docker containers are visible within a Docker network. Therefore a JOC Cockpit instance running for the inside port 4446 is accessible can be accessed with the container's hostname and the same port within the Docker network.
  • --publish The JOC Cockpit is prepared has been configured to listen to the HTTP port 4446. An outside port of the Docker host can be mapped to the JOC Cockpit inside HTTP port. This is not required for use with a Docker network, see --network, however, it will allow direct access to the JOC Cockpit from the Docker host by via its outside port .
  • --env=RUN_JS_JAVA_OPTIONS This allows to inject any Java options to be injected into the JOC Cockpit container. Preferably this is used to specify memory requirements of JOC Cockpit, e.g. for example,  with -Xmx256m.
  • --env=RUN_JS_USER_ID Inside the container the JOC Cockpit is operated for by the jobscheduler user account jobscheduler. In order to access e.g. , forexample, log files created by the JOC Cockpit that , which are mounted to the Docker host it is recommended that you map the account that is starting the container to the jobscheduler account inside the container. The RUN_JS_USER_ID environment variable accepts the user ID and group ID of the account that will be mapped. The example above example makes use of the current user.
  • --mount The following volume mounts are suggested:
    • config: The optional configuration folder allows to specify specification of individual settings for JOC Cockpit operation, see the chapters below chapters and the JS7 - JOC Cockpit Configuration Items article. Without this folder the default settings are used.
    • logs: In order to have JOC make JOC Cockpit log files persisted persistent they have to be written to a volume that is mounted for the container. Feel free to adjust the volume name from the src attribute, however. However, the value of the dst attribute should not be changed as it reflects the directory hierarchy inside the container.
    • Docker offers a number of ways how to mount or to bind volumes to containers that include e.g. to create local directories and to bind of mounting or binding volumes to containers including, for example, creation of local directories and binding them to volumes like this:

      Code Block
      languagebash
      titleExample how to create Docker volumes
      linenumberstrue
      # example to map volumes to directories on the Docker host prior to running the JOC Cockpit container
      mkdir -p /home/sos/js7/js7-joc-primary/config /home/sos/js7/js7-joc-primary/logs
      docker volume create --driver local --opt o=bind --opt type=none --opt device="/home/sos/js7/js7-joc-primary/config" js7-joc-primary-config
      docker volume create --driver local --opt o=bind --opt type=none --opt device="/home/sos/js7/js7-joc-primary/logs" js7-joc-primary-logs

      There are alternative ways how to achieve this. As a result you should have a access to the directories /var/sos-berlin.com/js7/joc/resources/joc and /var/log/sos-berlin.com/js7/joc inside the container and data in both locations should be persistedpersistent. If volumes are not created before running the container then they will be mounted automatically. However, you should have access to data in the volumes, e.g. by access to /var/lib/docker/volumes/js7-joc-primary-config etc.

...

The database connection is configured before initial start of the JOC Cockpit container.

When The following chapters can be skipped when using the H2® embedded database then you can skip the following chapters. It to evaluate JS7. Here it is sufficient to have the Hibernate configuration ready as this database runs in pre-configured mode inside the container.

...

JS7 ships with a number of JDBC Drivers.

  • For JDBC Drivers for use with H2®, MariaDB®, MySQL®, Oracle®, PostgreSQL® JDBC Drivers are included with JS7.
    • For details about JDBC Driver versions see versions see the JS7 - Database article.
    • Should you have a good reason to use a different version of a JDBC Driver then you can apply the JDBC Driver version of your choice.
  • For use with Microsoft SQL Server®
    • it is required to download the JDBC Driver the JDBC Driver has to be downloaded by the user as it cannot be bundled with open source software due to license conflicts.
  • You can download a JDBC Driver Drivers from the vendor's site sites and store the resulting *.jar file(s) with in the following location:
    • Location in the container: /var/sos-berlin.com/js7/joc/resources/joc/lib
    • Consider to access accessing this directory from the volume that is mounted when running the container, e.g. from a local folder /home/sos/js7/js7-joc-primary/config/lib.
    • Consider Refer to the JS7 - Database article for details about the proceeding.

...

  • Location in the container: /var/sos-berlin.com/js7/joc/resources/joc/hibernate.cfg.xml
  • Consider to access accessing the configuration file from the volume that is mounted when running the container, e.g. , for example, from a local folder /home/sos/js7/js7-joc-primary/config.
  • For Information about modification of the hibernate.cfg.xml file consider explanations for your DBMS product available with can be found in the JS7 - Database article.

Create Database Objects

By default On startup, the  JOC Cockpit checks on startup by default if database objects exist and otherwise creates them on-the-fly.

...

  • docker exec -ti is the command that connects to the JOC Cockpit container js7-joc-primary.
  • js7-joc-primary is the name of the JOC Cockpit container as specified with in the above docker run command mentioned above.
  • /bin/sh -c runs a shell inside the container and executes a script to install and to populate the database objects required for operation of JOC Cockpit.
  • Note that there is no harm in re-running the script a number of times as it will not remove existing data from the database.

...