Repository navigation
Expand file tree
/
Copy pathDockerfile.autoreducer
More file actions
72 lines (57 loc) · 2.69 KB
/
Copy pathDockerfile.autoreducer
File metadata and controls
72 lines (57 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM registry.access.redhat.com/ubi9/ubi
# install various dependencies
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
RUN dnf updateinfo
RUN dnf install -y procps-ng python3-numpy python3-pip
# Inspection tools
RUN dnf install -y vim
# rpm needs to special groups first
RUN getent group users || groupadd users
RUN useradd snsdata -G users
# put the developer configuration file in place
RUN mkdir -p /etc/autoreduce/
RUN mkdir -p /opt/postprocessing/log/
ARG CONFIG_FILE=tests/configuration/post_process_consumer.conf
COPY ${CONFIG_FILE} /etc/autoreduce/post_processing.conf
# install the fake test data
ARG DATA_TARBALL=/tmp/SNSdata.tar.gz
COPY SNSdata.tar.gz ${DATA_TARBALL}
RUN ls ${DATA_TARBALL}
RUN mkdir /SNS
RUN cd /SNS && tar xzf ${DATA_TARBALL}
# fake SNS and HFIR instruments for load testing
COPY scripts/profiling/reduce_sleep.py scripts/profiling/load_test_instruments.py /opt/load_test/
RUN python3 /opt/load_test/load_test_instruments.py --root / --script /opt/load_test/reduce_sleep.py
# install pyoncat
COPY tests/python3-pyoncat-2.1-1.noarch.rpm /tmp/
RUN dnf install -y /tmp/python3-pyoncat-2.1-1.noarch.rpm
# install postprocessing (4.7.0 adds the AMQP consumer; this tag has no "v")
RUN dnf install -y https://github.com/neutrons/post_processing_agent/releases/download/4.7.0/postprocessing-4.7.0-1.el9.noarch.rpm
# Install dependencies
ARG PLOTLY_VERSION=5
RUN pip3 install beautifulsoup4 requests setuptools wheel numpy urllib3
# Install git for pip to clone repositories
RUN dnf install -y git
# Install plot_publisher from GitHub (main branch)
RUN pip3 install git+https://github.com/neutrons/plot_publisher.git@main
# Install specific plotly version based on build arg
RUN if [ "$PLOTLY_VERSION" = "5" ]; then \
pip3 install plotly==5.17.0; \
elif [ "$PLOTLY_VERSION" = "6" ]; then \
pip3 install plotly==6.0.0; \
else \
pip3 install plotly==5.17.0; \
fi
# use the system trust store (which update-ca-trust populates) instead of the certifi bundle
# shipped with the pip-installed requests, so the self-signed test certificate is trusted
ENV REQUESTS_CA_BUNDLE=/etc/pki/tls/certs/ca-bundle.crt
# create startup script
# add updating certificates to add self-signed certificate for local testing
RUN echo "#!/bin/bash" > /usr/bin/run_postprocessing && \
echo "update-ca-trust" >> /usr/bin/run_postprocessing && \
echo "/opt/postprocessing/queueProcessor.py &" >> /usr/bin/run_postprocessing && \
echo "sleep 1" >> /usr/bin/run_postprocessing && \
echo "tail -F /opt/postprocessing/log/postprocessing.log" >> /usr/bin/run_postprocessing && \
chmod +x /usr/bin/run_postprocessing
# start the service
CMD ["run_postprocessing"]