forked from MetPX/sarracenia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_fuse
55 lines (47 loc) · 2.33 KB
/
Dockerfile_fuse
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
# Steps
# Install Sarracenia (sr) v3 from apt
# Define a TARGET_DIR for sr v3 subscriptions
#
# Intended usage : mount TARGET_DIR to an existing directory on host which itself is FUSE mounted to cloud storage
# e.g. via `s3fs` fow S3 buckets or `blobfuse2` for Azure blob storage containers
#
# As a result, files written in TARGET_DIR get written to the cloud by virtue of TARGET_DIR being mapped to cloud.
# FUSE mounting directories on the host mean no credentials are included in -- or need to be passed to -- the image
FROM ubuntu:22.04
LABEL org.opencontainers.image.authors="[email protected]"
# Duration (s) that sr3 will be running for; defaults to 60
ENV duration 60
# sr3 configuration file
ENV sr3_conf swob
#RUN apt update && apt-get -y install \
# && adduser --disabled-password --gecos '' g2c
# Add ppa and blobfuse2 as root
RUN apt-get update && apt-get install -y curl gnupg software-properties-common \
&& curl -sSL https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& apt-add-repository https://packages.microsoft.com/ubuntu/22.04/prod && apt-get update \
&& apt-get -y install blobfuse2 \
&& add-apt-repository ppa:ssc-hpc-chp-spc/metpx && apt update \
&& apt-get -y install metpx-sr3 python3-amqp
RUN adduser --disabled-password --gecos '' g2c
USER g2c
WORKDIR /home/g2c
# We have to create directories in /home/g2c for sr3 to work
# IMPORTANT : Running this image needs each of the 5 directories to be mapped to localhost directories
# e.g.
# docker run -d \
# -e duration=10 \
# -e sr3_conf=swob \
# -v /localhost_config_dir/subscribe:/home/g2c/.config/sr3/subscribe \
# -v /localhost_config_dir/log:/home/g2c/.config/sr3/log \
# -v /localhost_cache_dir/subscribe:/home/g2c/.cache/sr3/subscribe \
# -v /localhost_cache_dir/log:/home/g2c/.cache/sr3/log \
# -v /localhost_fuse-mounted_dir:/home/g2c/.config/sr3/output \
# image
RUN mkdir -p /home/g2c/.config/sr3/subscribe \
&& mkdir -p /home/g2c/.config/sr3/log \
&& mkdir -p /home/g2c/.cache/sr3/subscribe \
&& mkdir -p /home/g2c/.cache/sr3/log \
&& mkdir -p /home/g2c/.config/sr3/output
# && cp /usr/lib/python3/dist-packages/sarracenia/examples/subscribe/dd_swob.conf /home/g2c/.config/sr3/subscribe
# TODO : ADD A STAGE TO KEEP SR3 ONLY
CMD sr3 start subscribe/$sr3_conf && sleep $duration && sr3 stop subscribe/$sr3_conf && sleep 10