Skip to content

Commit 6d36981

Browse files
Updating for CentOS8.
1 parent a19a364 commit 6d36981

File tree

3 files changed

+61
-24
lines changed

3 files changed

+61
-24
lines changed

build/Dockerfile

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
11
# syntax = docker/dockerfile:1.0-experimental
2-
FROM centos:7
3-
ARG dirac_version=v6r21p7
2+
from centos:8
3+
ARG dirac_version=v6r22p6
44
ARG lcgtools_version=v14r1
55
ARG python_version=27
66
ARG productionsystem_version=master
77

8-
RUN yum install -y centos-release-scl
9-
RUN yum install -y rh-python36
10-
RUN yum install -y wget git gcc
11-
RUN yum clean all
8+
RUN dnf swap -y coreutils-single coreutils # Fix for wrapper coreutils
9+
RUN dnf install -y gcc git wget python2 python3 python3-devel
10+
RUN alternatives --set python /usr/bin/python2 # Set unversioned python command to python2 for DIRAC scripts
11+
RUN python3 -m pip install --upgrade pip setuptools wheel
12+
RUN python3 -m pip install --upgrade productionsystem@git+https://github.com/alexanderrichards/ProductionSystem.git@$productionsystem_version
13+
RUN dnf clean all
1214

15+
# DIRAC setup
1316
RUN mkdir -p /root/dirac_ui
14-
1517
WORKDIR /root/dirac_ui
16-
1718
RUN wget -np -O dirac-install https://raw.githubusercontent.com/DIRACGrid/DIRAC/integration/Core/scripts/dirac-install.py
1819
RUN chmod u+x dirac-install
19-
RUN ./dirac-install -r $dirac_version -i $python_version -g $lcgtools_version
20+
RUN ./dirac-install --dirac-os -r $dirac_version -i $python_version -g $lcgtools_version
2021
RUN --mount=type=secret,id=proxy,dst=/tmp/x509up_u0 . /root/dirac_ui/bashrc && dirac-configure -F -S GridPP -C dips://dirac01.grid.hep.ph.ic.ac.uk:9135/Configuration/Server -I
22+
# These two lines are necessary as git commands broken in DIRACOS so need to check out first then pip install else could do commented out line below
23+
RUN git clone -b $productionsystem_version https://github.com/alexanderrichards/ProductionSystem.git
24+
RUN . /root/dirac_ui/bashrc && python -m pip install --upgrade ProductionSystem/
25+
#RUN . /root/dirac_ui/bashrc && python -m pip install -v --trusted-host github.com --upgrade productionsystem@git+https://github.com/alexanderrichards/ProductionSystem.git@$productionsystem_version
2126
RUN rm -f dirac-install
2227

23-
WORKDIR /root
2428

25-
RUN echo "virtualenv venv3" | scl enable rh-python36 -
26-
RUN . venv3/bin/activate && pip install --upgrade pip setuptools wheel
27-
RUN --mount=type=ssh . venv3/bin/activate && pip install productionsystem@git+git://github.com/alexanderrichards/ProductionSystem.git@$productionsystem_version
28-
RUN . dirac_ui/bashrc && python -m pip install --upgrade pip setuptools wheel
29-
RUN --mount=type=ssh . dirac_ui/bashrc && python -m pip install --upgrade productionsystem@git+git://github.com/alexanderrichards/ProductionSystem.git@$productionsystem_version
29+
## setup cron jobs - maybe not needed if mounting from outside.
30+
31+
32+
WORKDIR /root
3033

3134
COPY startup.sh /root/startup.sh
3235

build/build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
#!/usr/bin/env bash
2-
DOCKER_BUILDKIT=1 docker build --ssh default --no-cache --progress=plain --secret id=proxy,src=/tmp/x509up_u$ID -t alexanderrichards/productionsystem:latest .
1+
#!/bin/bash
2+
(. ~/dirac_ui/bashrc && dirac-proxy-init -x)
3+
#DOCKER_BUILDKIT=1 docker build --no-cache --progress=plain --secret id=proxy,src=/tmp/x509up_u`id -u` -t alexanderrichards/productionsystem:latest .
4+
DOCKER_BUILDKIT=1 docker build --progress=plain --secret id=proxy,src=/tmp/x509up_u`id -u` -t alexanderrichards/productionsystem:latest .

build/startup.sh

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
2+
3+
trap "stop_daemon $1 && exit 0" SIGTERM
4+
5+
function stop_daemon {
6+
case "$1" in
7+
dirac)
8+
echo "*** Stopping DIRAC daemon. ***"
9+
(. /root/dirac_ui/bashrc && dirac-daemon.py stop)
10+
;;
11+
monitoring)
12+
echo "*** Stopping monitoring daemon. ***"
13+
monitoring-daemon.py stop
14+
;;
15+
webapp)
16+
echo "*** Stopping web app daemon. ***"
17+
webapp-daemon.py stop
18+
;;
19+
all)
20+
stop_daemon dirac
21+
stop_daemon monitoring
22+
stop_daemon webapp
23+
;;
24+
*)
25+
echo "Unknown parameter: $1"
26+
echo "Expected: {dirac|monitoring|webapp|all}"
27+
exit 1
28+
esac
29+
}
230

331
function start_daemon {
432
case "$1" in
@@ -8,16 +36,16 @@ function start_daemon {
836
;;
937
monitoring)
1038
echo "*** Starting monitoring daemon. ***"
11-
(. /root/venv3/bin/activate && monitoring-daemon.py start)
39+
monitoring-daemon.py start
1240
;;
1341
webapp)
1442
echo "*** Starting web app daemon. ***"
15-
(. /root/venv3/bin/activate && webapp-daemon.py start)
43+
webapp-daemon.py start
1644
;;
1745
all)
18-
start_daemon dirac
19-
start_daemon monitoring
20-
start_daemon webapp
46+
start_daemon dirac
47+
start_daemon monitoring
48+
start_daemon webapp
2149
;;
2250
*)
2351
echo "Unknown parameter: $1"
@@ -27,4 +55,8 @@ function start_daemon {
2755
}
2856

2957
start_daemon $1
30-
/bin/bash
58+
# Allow time to receive and process SIGTERM handler
59+
while true
60+
do
61+
sleep 5
62+
done

0 commit comments

Comments
 (0)