Skip to content

Commit 87c191b

Browse files
Add dockerfile and jobber
1 parent ff23de4 commit 87c191b

3 files changed

Lines changed: 115 additions & 0 deletions

File tree

docker/Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM cern/cc7-base:latest
2+
3+
RUN yum upgrade -y && \
4+
yum clean all && \
5+
rm -rf /var/cache/yum
6+
7+
RUN yum install -y httpd mod_ssl \
8+
sudo git \
9+
perl perl-CPAN perl-CGI perl-DBI perl-DBD-MySQL perl-DateTime perl-File-MimeInfo \
10+
perl-MailTools perl-XML-Twig perl-libxml-perl perl-DateTime-Format-ICal perl-libwww-perl \
11+
perl-Data-ICal python-pip perl-Digest-SHA1 \
12+
sendmail sendmail-cf \
13+
&& yum clean all \
14+
&& rm -rf /var/cache/yum
15+
16+
# Jobber is a lightweight cron replacement written in Go
17+
RUN rpm -i https://github.com/dshearer/jobber/releases/download/v1.4.4/jobber-1.4.4-1.el8.x86_64.rpm
18+
19+
# j2cli is used for templating config files which will be useful for passing environment variables
20+
RUN pip install --no-cache-dir --upgrade pip
21+
RUN pip install --no-cache-dir --upgrade setuptools
22+
RUN pip install --no-cache-dir j2cli
23+
24+
# This file was generated by running CPAN once in "manual" not "local::lib" mode
25+
ADD MyConfig.pm /root/.cpan/CPAN/MyConfig.pm
26+
RUN sudo cpan -i CGI::Untaint
27+
28+
# Get DocDB software and install it
29+
RUN git clone https://github.com/ericvaandering/DocDB.git
30+
RUN mkdir -p /var/www/cgi-bin/DocDB && cp DocDB/DocDB/cgi/* /var/www/cgi-bin/DocDB
31+
RUN mkdir -p /var/www/html/DocDB/Static/ && cp -R /DocDB/DocDB/html/css/ /DocDB/DocDB/html/js/ /DocDB/DocDB/html/img/ /var/www/html/DocDB/Static/
32+
33+
ADD docker-entrypoint.sh /
34+
ADD dot-jobber.yaml /root/.jobber
35+
ENTRYPOINT ["/docker-entrypoint.sh"]

docker/docker-entrypoint.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#! /bin/bash
2+
3+
cp /etc/grid-security/tls.crt /etc/pki/tls/certs/localhost.crt
4+
cp /etc/grid-security/tls.key /etc/pki/tls/private/localhost.key
5+
6+
echo "Starting jobber"
7+
/usr/local/libexec/jobbermaster &
8+
9+
echo "Starting sendmail"
10+
sendmail -bd
11+
12+
echo "Starting apache"
13+
httpd -D FOREGROUND

docker/dot-jobber.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
## This is your jobfile: use it to tell Jobber what jobs you want it to
2+
## run on your behalf. For details of what you can specify here,
3+
## please see https://dshearer.github.io/jobber/doc/.
4+
##
5+
## It consists of two sections: "prefs" and "jobs". In "prefs" you can
6+
## set various general settings. In "jobs", you define your jobs.
7+
8+
version: 1.4
9+
10+
prefs:
11+
## You can have the Jobber daemon keep a log of various activities
12+
## with the "logPath" setting; the log will be written to the given
13+
## path (if the path is relative, it will be interpreted relative to
14+
## your home directory). Your user account must be able to write to
15+
## the given path. NOTE: This is NOT where logs about job runs
16+
## are stored --- for that, see the "runLog" setting below. WARNING:
17+
## Jobber will NOT rotate this file.
18+
#logPath: jobber-log
19+
20+
## You can specify how info about past runs is stored. For
21+
## "type: memory" (the default), they are stored in memory and
22+
## are lost when the Jobber service stops.
23+
#runLog:
24+
# type: memory
25+
# maxLen: 100 # the max number of entries to remember
26+
27+
## For "type: file", past run logs are stored on disk. The log file is
28+
## rotated when it reaches a size of 'maxFileLen' MB. Up to
29+
## 'maxHistories' historical run logs (that is, not including the
30+
## current one) are kept.
31+
#runLog:
32+
# type: file
33+
# path: /tmp/claudius
34+
# maxFileLen: 50m # in MB
35+
# maxHistories: 5
36+
37+
resultSinks:
38+
#- &programSink
39+
# type: program
40+
# path: /home/handleError.sh
41+
42+
#- &systemEmailSink
43+
# type: system-email
44+
45+
#- &filesystemSink
46+
# type: filesystem
47+
# path: /path/to/dir
48+
# data: [stdout, stderr]
49+
# maxAgeDays: 10
50+
51+
jobs:
52+
## This section must contain a YAML sequence of maps like the following:
53+
#DailyBackup:
54+
# cmd: backup daily # shell command to execute
55+
# time: '* * * * * *' # SEC MIN HOUR MONTH_DAY MONTH WEEK_DAY.
56+
# onError: Continue # what to do when the job has an error: Stop, Backoff, or Continue
57+
# notifyOnError: [*programSink] # what to do with result when job has an error
58+
# notifyOnFailure: [*systemEmailSink, *programSink] # what to do with result when the job stops due to errors
59+
# notifyOnSuccess: [*filesystemSink] # what to do with result when the job succeeds
60+
Daily:
61+
cmd: cd /DocDB/DocDB/scripts; ./DocDBDaily.csh > /dev/null
62+
time: R 0 * * * *
63+
onError: Continue
64+
Weekly:
65+
cmd: cd /DocDB/DocDB/scripts; ./DocDBWeekly.csh > /dev/null
66+
time: R 0 * * * 0
67+
onError: Continue

0 commit comments

Comments
 (0)