Date: Thu, 28 Mar 2024 13:25:06 +0000 (UTC) Message-ID: <1480688333.11477.1711632306199@change.sos-berlin.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_11476_929525318.1711632306199" ------=_Part_11476_929525318.1711632306199 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The following files are required for the build context:
Dockerfile
jobscheduler_install.xml
with=
individual installation settings. A template of this file is available whe=
n extracting the installer tarball.start_jobscheduler.sh
Download: Dockerfile
FROM openjdk:8 LABEL maintainer=3D"Software- und Organisations-Service GmbH" # default user id has to match later run-time user ARG USER_ID=3D$UID # provide build arguments for release information ARG JS_MAJOR=3D1.13 ARG JS_RELEASE=3D1.13.3 # add installer archive file COPY jobscheduler_linux-x64.${JS_RELEASE}.tar.gz /usr/local/src/ RUN test -e /usr/local/src/jobscheduler_linux-x64.${JS_RELEASE}.tar.gz &= ;& \ tar zxvf /usr/local/src/jobscheduler_linux-x64.${JS_RELEASE}.tar.gz -C = /usr/local/src/ && \ rm -f /usr/local/src/jobscheduler_linux-x64.${JS_RELEASE}.tar.gz &&= amp; \ ln -s /usr/local/src/jobscheduler.${JS_RELEASE} /usr/local/src/jobsched= uler # for JDK < 12, /dev/random does not provide sufficient entropy, see htt= ps://kb.sos-berlin.com/x/lIM3 RUN rm /dev/random && ln -s /dev/urandom /dev/random # copy installer response file and run installer COPY jobscheduler_install.xml /usr/local/src/jobscheduler/jobscheduler_inst= all.xml RUN /usr/local/src/jobscheduler/setup.sh -u /usr/local/src/jobscheduler/job= scheduler_install.xml # make default user the owner of directories RUN groupadd --gid ${USER_ID:-1000} jobscheduler && \ useradd --uid ${USER_ID:-1000} --gid jobscheduler --home-dir /home/jobs= cheduler --no-create-home --shell /bin/bash jobscheduler && \ chown -R jobscheduler:jobscheduler /var/sos-berlin.com # copy and prepare start script COPY start_jobscheduler.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/start_jobscheduler.sh # create volumes for data persistence VOLUME /var/sos-berlin.com/jobscheduler/testsuite/config/live # allow incoming traffic to port EXPOSE 40444 # run-time user, can be overwritten when running the container USER jobscheduler CMD ["/usr/local/bin/start_jobscheduler.sh"]
Download: jobscheduler_install.xml
<?xml version=3D"1.0" encoding=3D"UTF-8" standalone=3D"no"?> <!--=20 XML configuration file for JobScheduler setup The JobScheduler is available with a dual licensing model. - GNU GPL 2.0 License (see http://www.gnu.org/licenses/gpl-2.0.html) - JobScheduler Commercial License (see licence.txt) The setup asks you for the desired license model=20 (see <entry key=3D"licenceOptions" .../> below). If you call the setup with this XML file then you accept=20 at the same time the terms of the chosen license agreement.=20 --> <AutomatedInstallation langpack=3D"eng"> <com.izforge.izpack.panels.UserInputPanel id=3D"home"> <userInput/> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.UserInputPanel id=3D"licences"> <userInput> =20 <!-- Select the license model (GPL or Commercial) --> <entry key=3D"licenceOptions" value=3D"GPL"/> =20 <!-- If you selected GPL as license model than the licence m= ust be empty. Otherwise please enter a license key if available. It is also possible to modify the license key later. -->= ; <entry key=3D"licence" value=3D""/> =20 </userInput> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.HTMLLicencePanel id=3D"gpl_licence"/> <com.izforge.izpack.panels.HTMLLicencePanel id=3D"commercial_licence= "/> <com.izforge.izpack.panels.TargetPanel id=3D"target"> =20 <!-- SELECT THE INSTALLATION PATH FOR THE BINARIES AND LIBRARIES The installation expands this path with the Scheduler ID as su= bdirectory. The path must be absolute! Default paths are /opt/sos-berlin.com/jobscheduler for Unix C:\Program Files\sos-berlin.com\jobscheduler for Windows -->= ; <installpath>/opt/sos-berlin.com/jobscheduler</installpath= > =20 </com.izforge.izpack.panels.TargetPanel> <com.izforge.izpack.panels.UserPathPanel id=3D"userpath"> =20 <!-- SELECT THE DATA PATH FOR CONFIGURATION AND LOG FILES The installation expands this path with the Scheduler ID as su= bdirectory. The path must be absolute! Default paths are /home/[user]/sos-berlin.com/jobscheduler for Unix C:\ProgramData\sos-berlin.com\jobscheduler for Windows --> <UserPathPanelElement>/var/sos-berlin.com/jobscheduler</Us= erPathPanelElement> =20 </com.izforge.izpack.panels.UserPathPanel> <com.izforge.izpack.panels.PacksPanel id=3D"package"> =20 <!-- SELECT THE PACKS WHICH YOU WANT INSTALL --> =20 <!-- Package: JobScheduler JobScheduler Basic Installation THIS PACK IS REQUIRED. IT MUST BE TRUE --> <pack index=3D"0" name=3D"Job Scheduler" selected=3D"true"/> =20 <!-- Package: Database Support Job history and log files can be stored in a database. Databas= e support is=20 available for MySQL, PostgreSQL, Oracle, SQL Server, DB2. THIS PACK IS REQUIRED. IT MUST BE TRUE --> <pack index=3D"2" name=3D"Database Support" selected=3D"true"/&g= t; =20 <!-- Package: Housekeeping Jobs Housekeeping Jobs are automatically launched by the Job Schedu= ler, e.g. to send=20 buffered logs by mail, to remove temporary files or to restart= the JobScheduler. --> <pack index=3D"5" name=3D"Housekeeping Jobs" selected=3D"true"/&= gt; =20 </com.izforge.izpack.panels.PacksPanel> <com.izforge.izpack.panels.UserInputPanel id=3D"network"> <userInput> <!-- Network Configuration --> =20 <!-- Enter the port for TCP communication (e.g. 4444)=20 No longer required! --> <entry key=3D"schedulerPort" value=3D""/> =20 <!-- Enter the port for HTTP communication --> <entry key=3D"schedulerHTTPPort" value=3D"40444"/> =20 <!-- To enter a JobScheduler ID is required.=20 The IDs of multiple instances of the JobScheduler must be = unique per server.=20 The JobScheduler ID expands the above installation paths a= s subdirectory. Please omit special characters like: / \ : ; * ? ! $ % &am= p; " < > ( ) | ^ --> <entry key=3D"schedulerId" value=3D"testsuite"/> =20 <!-- Only for Linux (root permissions required) --> <entry key=3D"schedulerInstallAsDaemon" value=3D"yes"/> =09 <!-- To enter a JobScheduler User (default=3Dcurrent User).= =20 Only for Linux (root permissions required) --> <entry key=3D"runningUser" value=3D""/> =20 <!-- Specify optional Java options here --> <entry key=3D"jsJavaOptions" value=3D""/> =20 <!-- It is recommended to enable TCP access for the host whe= re the JobScheduler will install,=20 optionally enter additional host names or ip addresses. To= enable all hosts in your=20 network to access the JobScheduler enter '0.0.0.0'. --> <entry key=3D"schedulerAllowedHost" value=3D"0.0.0.0"/> =20 <!-- Choose (yes or no) wether the JobScheduler should be st= arted at the end of the installation --> <entry key=3D"launchScheduler" value=3D"no"/> =20 </userInput> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.UserInputPanel id=3D"cluster"> <userInput> <!-- Cluster Configuration / Job Streams Plugin --> =20 <!-- The JobScheduler can be installed independent of other = possibly JobSchedulers,=20 as a primary JobScheduler in a backup system or as a backu= p JobScheduler.=20 Use '' for a standalone, '-exclusive' for a primary=20 or '-exclusive -backup' for a backup JobScheduler. A database is required for a backup system. All JobSchedul= ers in a backup system=20 must have the same JobScheduler ID and the same database.= =20 Further you can set '-distributed-orders' for a load balan= cing cluster. For more information see http://www.sos-berlin.com/doc/de/scheduler.doc/backupsched= uler.xml http://www.sos-berlin.com/doc/de/scheduler.doc/distributed= _orders.xml --> <entry key=3D"clusterOptions" value=3D""/> =20 <!-- Enable JobStreams plugin. For more information see https://kb.sos-berlin.com/x/uoC2A= Q --> <entry key=3D"jobStreamsPlugin" value=3D"on"/> =20 </userInput> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.UserInputPanel id=3D"smtp"> <userInput> <!-- Mail Recipients Configuration / SMTP Authentication --&= gt; =20 <!-- Enter the ip address or host name and port (default: 25= ) of your SMTP server --> <entry key=3D"mailServer" value=3D""/> <entry key=3D"mailPort" value=3D"25"/> =20 <!-- Configure the SMTP authentication if necessary. --> <entry key=3D"smtpAccount" value=3D""/> <entry key=3D"smtpPass" value=3D""/> =20 <!-- Enter the addresses of recipients to which mails with l= og files are automatically forwarded. Separate multiple recipients by commas --> =20 <!-- Account from which mails are sent --> <entry key=3D"mailFrom" value=3D""/> =20 <!-- Recipients of mails --> <entry key=3D"mailTo" value=3D""/> =20 <!-- Recipients of carbon copies: --> <entry key=3D"mailCc" value=3D""/> =20 <!-- Recipients of blind carbon copies --> <entry key=3D"mailBcc" value=3D""/> =20 </userInput> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.UserInputPanel id=3D"email"> <userInput> <!-- Mail Configuration / Event Handler --> =20 <!-- Choose in which cases mails with log files are automati= cally forwarded. --> <entry key=3D"mailOnError" value=3D"yes"/> <entry key=3D"mailOnWarning" value=3D"yes"/> <entry key=3D"mailOnSuccess" value=3D"no"/> =20 <!-- The Housekeeping package is required for configure JobS= cheduler as event handler Choose this option if you intend to use JobScheduler Event= s and - this JobScheduler instance is the only instance which pr= ocesses Events - this JobScheduler instance is a supervisor for other Job= Schedulers which submit Events --> <entry key=3D"jobEvents" value=3D"off"/>=20 =20 </userInput> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.UserInputPanel id=3D"database"> <userInput> <!-- JobScheduler Database Configuration --> =20 <!-- Database connection settings can be specified with foll= owing entries such as databaseHost, databasePort, ... or by a hibernate configur= ation file=20 Posible values are 'withoutHibernateFile' (default) and 'w= ithHibernateFile'. --> <entry key=3D"databaseConfigurationMethod" value=3D"withoutH= ibernateFile"/> =20 <!-- Choose the database management system. Supported values= are 'mysql' for MySQL, 'oracle' for Oracle, 'mssql' for MS SQL Server, 'pgsql' fo= r PostgreSQL, 'db2' for DB2 and 'sybase' for Sybase.=20 Only if databaseConfigurationMethod=3DwithoutHibernateFile= --> <entry key=3D"databaseDbms" value=3D"mysql"/> =20 <!-- Path to a hibernate configuration file if databaseConfi= gurationMethod=3DwithHibernateFile --> <entry key=3D"hibernateConfFile" value=3D""/> =20 <!-- You can choose between 'on' or 'off' to create the data= base tables. If you have modified the initial data of an already existi= ng installation,=20 then the modifications will be undone. Data added remains = unchanged.=20 This entry should be only 'off', when you sure, that all t= ables are already created. --> <entry key=3D"databaseCreate" value=3D"on"/> =20 </userInput> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.UserInputPanel id=3D"dbconnection"> <userInput> <!-- JobScheduler Database Configuration if databaseConfigur= ationMethod=3DwithoutHibernateFile --> =20 <!-- Enter the name or ip address of the database host=20 This entry can also be used to configure the URL(s) for Or= acle RAC databases. For example: <entry key=3D"databaseHost" value=3D"(DESCRIPTION=3D(AD= DRESS_LIST=3D(LOAD_BALANCE=3DOFF)(FAILOVER=3DON) (ADDRESS=3D(PROTOCOL=3DTCP)(HOST=3Dtst-db1.myco.com)(PO= RT=3D1604)) (ADDRESS=3D(PROTOCOL=3DTCP)(HOST=3Dtst-db2.myco.com)(PO= RT=3D1604))) (CONNECT_DATA=3D(SERVICE_NAME=3Dmydb1.myco.com)(SERVER= =3DDEDICATED)))"/> The "databaseSchema" and "databasePort" entries should the= n be left empty. --> <entry key=3D"databaseHost" value=3D"mysql-5-7"/> =20 <!-- Enter the port number for the database instance. Defaul= t ports are for MySQL 3306,=20 Oracle 1521, MS SQL Server 1433, postgreSQL 5432, DB2 5000= 0, Sybase 5000. --> <entry key=3D"databasePort" value=3D"3306"/> =20 <!-- Enter the schema --> <entry key=3D"databaseSchema" value=3D"jobscheduler113"/> =20 <!-- Enter the user name for database access --> <entry key=3D"databaseUser" value=3D"jobscheduler"/> =20 <!-- Enter the password for database access --> <entry key=3D"databasePassword" value=3D"jobscheduler"/> =20 </userInput> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.UserInputPanel id=3D"jdbc"> <userInput> <!-- JobScheduler Database Configuration --> =20 <!-- You can specify an external JDBC connector then set int= ernalConnector =3D no For license reasons MySQL, Sybase, MS SQL Server and Oracl= e ojdbc7 JDBC=20 drivers are not provided.=20 Alternatively you can use the mariadb JDBC Driver for MySQ= L and=20 the jTDS JDBC Driver for MS SQL Server and Sybase which is= provided.=20 An Oracle ojdbc6 JDBC driver is also provided. An internal JDBC connector for DB2 is not available --> =20 <!-- You can choose between 'yes' or 'no' for using the inte= rnal JDBC connector or not --> <entry key=3D"internalConnector" value=3D"yes"/> =20 <!-- Select the path to JDBC Driver --> <entry key=3D"connector" value=3D""/> =20 <!-- Only for DB2: Select the path to DB2 license file for J= DBC Driver --> <entry key=3D"connectorLicense" value=3D""/> =20 </userInput> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.UserInputPanel id=3D"reportingDatabase"&g= t; <userInput> <!-- Reporting Database Configuration=20 NOT SUPPORTED FOR SYBASE AND DB2 --> =20 <!-- Set 'yes' if the JobScheduler and the Reporting databas= e are the same. If 'yes' then further Reporting database variables are ign= ored. --> <entry key=3D"sameDbConnection" value=3D"yes"/> =20 <!-- Database connection settings can be specified with foll= owing entries such as databaseHost, databasePort, ... or by a hibernate configur= ation file=20 Posible values are 'withoutHibernateFile' (default) and 'w= ithHibernateFile'. --> <entry key=3D"reporting.databaseConfigurationMethod" value= =3D"withoutHibernateFile"/> =20 =20 <!-- Choose the database management system. Supported values= are 'mysql' for MySQL, 'oracle' for Oracle, 'mssql' for MS SQL Server, 'pgsql' fo= r PostgreSQL.=20 only if reporting.databaseConfigurationMethod=3DwithoutHib= ernateFile--> <entry key=3D"reporting.databaseDbms" value=3D"mysql"/> =20 <!-- Path to a hibernate configuration file if reporting.dat= abaseConfigurationMethod=3DwithHibernateFile --> <entry key=3D"reporting.hibernateConfFile" value=3D""/> =20 </userInput> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.UserInputPanel id=3D"reportingDbconnectio= n"> <userInput> <!-- Reporting Database Configuration if reporting.databaseC= onfigurationMethod=3DwithoutHibernateFile NOT SUPPORTED FOR SYBASE AND DB2 --> =20 <!-- Enter the name or ip address of the database host=20 This entry can also be used to configure the URL(s) for Or= acle RAC databases. For example: <entry key=3D"reporting.databaseHost" value=3D"(DESCRIP= TION=3D(ADDRESS_LIST=3D(LOAD_BALANCE=3DOFF)(FAILOVER=3DON) (ADDRESS=3D(PROTOCOL=3DTCP)(HOST=3Dtst-db1.myco.com)(PO= RT=3D1604)) (ADDRESS=3D(PROTOCOL=3DTCP)(HOST=3Dtst-db2.myco.com)(PO= RT=3D1604))) (CONNECT_DATA=3D(SERVICE_NAME=3Dmydb1.myco.com)(SERVER= =3DDEDICATED)))"/> The "reporting.databaseSchema" and "reporting.databasePort= " entries should then be left empty. --> <entry key=3D"reporting.databaseHost" value=3D"mysql-5-7"/&g= t; =20 <!-- Enter the port number for the database instance. Defaul= t ports are for MySQL 3306,=20 Oracle 1521, MS SQL Server 1433, postgreSQL 5432. --> <entry key=3D"reporting.databasePort" value=3D"3306"/> =20 <!-- Enter the schema --> <entry key=3D"reporting.databaseSchema" value=3D"jobschedule= r113"/> =20 <!-- Enter the user name for database access --> <entry key=3D"reporting.databaseUser" value=3D"jobscheduler"= /> =20 <!-- Enter the password for database access --> <entry key=3D"reporting.databasePassword" value=3D"jobschedu= ler"/> =20 </userInput> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.UserInputPanel id=3D"reportingJdbc"> <userInput> <!-- Reporting Database Configuration=20 NOT SUPPORTED FOR SYBASE AND DB2 --> =20 <!-- You can specify an external JDBC connector then set rep= orting.internalConnector =3D no For license reasons MySQL, MS SQL Server and Oracle ojdbc7= JDBC=20 drivers are not provided.=20 Alternatively you can use the mariadb JDBC Driver for MySQ= L and=20 the jTDS JDBC Driver for MS SQL Server and Sybase which is= provided.=20 An Oracle ojdbc6 JDBC driver is also provided. --> =20 <!-- You can choose between 'yes' or 'no' for using the inte= rnal JDBC connector or not --> <entry key=3D"reporting.internalConnector" value=3D"yes"/>= ; =20 <!-- Select the path to JDBC Driver --> <entry key=3D"reporting.connector" value=3D""/> =20 </userInput> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.UserInputPanel id=3D"end"> <userInput/> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.InstallPanel id=3D"install"/> <com.izforge.izpack.panels.ProcessPanel id=3D"process"/> <com.izforge.izpack.panels.FinishPanel id=3D"finish"/> </AutomatedInstallation>
Download: start_jobscheduler.sh
#!/bin/s= h /opt/sos-berlin.com/jobscheduler/testsuite/bin/jobscheduler.sh start withou= t-change-user && tail -f /dev/null
jobscheduler.sh
is used.=
The tail
command prevents the start script from terminating i=
n order to keep the container alive. The sub-directory testsuite represents the JobScheduler ID that is specified with the above ins=
taller response file.
There are a number of ways how to write a build command, find the follow= ing example:
A typical build command could look like this:
#!/bin/s= h IMAGE_NAME=3D"master-1-13" docker build --no-cache --rm --tag=3D$IMAGE_NAME --file=3D./build/Dockerfil= e --network=3Djs --build-arg=3D"USER_ID=3D$UID" ./build
--build-arg
that injects the USE=
R_ID
environment variable into the image with the numeric ID of the =
account running the build command. This simplifies later access to the volu=
me exposed by the Dockerfile as the same numeric user ID and group ID insid=
e and outside of the container are used.There are a number of ways how to write a run command, find the followin= g example:
live
folder of the =
JobScheduler Master installation:#!/bin/s= h IMAGE_NAME=3D"master-1-13" docker volume create --name=3D$IMAGE_NAME ln -s /var/lib/docker/volumes/$IMAGE_NAME/_data/ ./live sudo chmod o+r /var/lib/docker sudo chmod o+rx /var/lib/docker/volumes sudo chown -R $USER:$USER /var/lib/docker/volumes/$IMAGE_NAME
live
that points to the Docker volumelive
folder.A typical run command could look like this:
#!/bin/s= h IMAGE_NAME=3D"master-1-13" RUN_USER_ID=3D"$(id -u $USER):$(id -g $USER)" mkdir -p /some/path/logs docker run -dit --rm --user=3D$RUN_USER_ID --hostname=3D$IMAGE_NAME --netwo= rk=3Djs --publish=3D50444:40444 --mount=3D"type=3Dvolume,src=3D$IMAGE_NAME,= dst=3D/var/sos-berlin.com/jobscheduler/testsuite/config/live" --volume=3D/s= ome/path/logs:/var/log/sos-berlin.com/jobscheduler/testsuite:Z --name=3D$IM= AGE_NAME $IMAGE_NAME
RUN_USER_ID
variable is populated with the numeric ID =
of the account and the group that executes the run command. This value is a=
ssigned the --user
option to inject the account information in=
to the container (replacing the account specified with the USE jobsch=
eduler
instruction in the Dockerfile).logs
directory to be created that is refere=
nced with the --volume
option to expose the log directory of t=
he JobScheduler Master for reading. Consider that the testsuite
sub-directory is created from the value of the JobScheduler ID that is sp=
ecified with the installer response file. Avoid to modify log files in this=
directory and to add new files.--mount
option is used in order to map a previously cr=
eated Docker volume (assumed to be the value of the src=3D
opt=
ion) e.g. to the JobScheduler Master's live
folder. This allow=
s to read and to write job related files to this directory that will automa=
tically be picked up by JobScheduler Master.