Skip to content

Commit a19a364

Browse files
Add Docker image build files.
This necessitated removing build/ from the .gitignore. modified: .gitignore new file: build/Dockerfile new file: build/build.sh new file: build/startup.sh
1 parent cca1b62 commit a19a364

File tree

4 files changed

+67
-1
lines changed

4 files changed

+67
-1
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ __pycache__/
99
# Distribution / packaging
1010
.Python
1111
env/
12-
build/
1312
develop-eggs/
1413
dist/
1514
downloads/

build/Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# syntax = docker/dockerfile:1.0-experimental
2+
FROM centos:7
3+
ARG dirac_version=v6r21p7
4+
ARG lcgtools_version=v14r1
5+
ARG python_version=27
6+
ARG productionsystem_version=master
7+
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
12+
13+
RUN mkdir -p /root/dirac_ui
14+
15+
WORKDIR /root/dirac_ui
16+
17+
RUN wget -np -O dirac-install https://raw.githubusercontent.com/DIRACGrid/DIRAC/integration/Core/scripts/dirac-install.py
18+
RUN chmod u+x dirac-install
19+
RUN ./dirac-install -r $dirac_version -i $python_version -g $lcgtools_version
20+
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
21+
RUN rm -f dirac-install
22+
23+
WORKDIR /root
24+
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
30+
31+
COPY startup.sh /root/startup.sh
32+
33+
CMD ["all"]
34+
35+
ENTRYPOINT ["/root/startup.sh"]

build/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
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 .

build/startup.sh

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

0 commit comments

Comments
 (0)