File tree Expand file tree Collapse file tree 4 files changed +64
-6
lines changed
metis-processing-engine-flink Expand file tree Collapse file tree 4 files changed +64
-6
lines changed Original file line number Diff line number Diff line change 3
3
echo building flink-poc docker image that can be deployed on the openshift cluster.
4
4
5
5
# images
6
- echo " building :: flink java 21 base $( realpath flink-java21) "
7
- docker build --no-cache -t flink:2.0.0-java21_poc flink-java21
6
+ # echo "building :: flink java 21 base $(realpath flink-java21)"
7
+ # docker build --no-cache -t flink:2.0.0-java21_poc flink-java21
8
8
9
- echo " building :: flink-node $( realpath flink-with-tools) "
10
- docker build --no-cache -t flink-with-tools:2.0.0-java21 flink-with-tools
9
+ # echo "building :: flink-node $(realpath flink-with-tools)"
10
+ # docker build --no-cache -t flink-with-tools:2.0.0-java21 flink-with-tools
11
11
12
12
echo " building :: shared libs: $( realpath metis-processing-engine-flink/shared-libs) "
13
13
mvn -f metis-processing-engine-flink/shared-libs clean install
14
14
echo " building :: flink-node $( realpath metis-processing-engine-flink) "
15
15
docker build --no-cache -t metis-processing-engine-flink:2.0.0-java21 metis-processing-engine-flink
16
16
17
17
# echo "Pushing to the repository: registry.paas.psnc.pl"
18
- # docker tag metis-processing-engine-flink:2.0.0-java21 registry.paas.psnc.pl/ecloud-poc/metis-processing-engine-flink:2.0.0-java21
19
- # docker push registry.paas.psnc.pl/ecloud-poc/metis-processing-engine-flink:2.0.0-java21
18
+ docker tag metis-processing-engine-flink:2.0.0-java21 registry.paas.psnc.pl/ecloud-poc/metis-processing-engine-flink:2.0.0-java21-s3
19
+ docker push registry.paas.psnc.pl/ecloud-poc/metis-processing-engine-flink:2.0.0-java21-s3
20
20
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ RUN apt-get update && apt-get install -y \
21
21
net-tools \
22
22
dnsutils \
23
23
vim \
24
+ s3fs \
25
+ fuse \
24
26
&& rm -rf /var/lib/apt/lists/*
25
27
26
28
COPY install.sh /
Original file line number Diff line number Diff line change @@ -2,3 +2,12 @@ FROM flink-with-tools:2.0.0-java21
2
2
3
3
LABEL maintainer="PSNC"
4
4
COPY shared-libs/target/dependency/* /opt/flink/lib/
5
+
6
+ RUN mkdir -p /mnt/s3
7
+ RUN chmod 777 /mnt/s3
8
+
9
+
10
+ COPY entrypoint.sh /entrypoint.sh
11
+ RUN chmod +x /entrypoint.sh
12
+
13
+ ENTRYPOINT ["/entrypoint.sh" ]
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+ if [ -z " ${S3_ACCESS_KEY} " ] || [ -z " ${S3_SECRET_KEY} " ] || [ -z " ${S3_BUCKET} " ] || [ -z " ${S3_ENDPOINT} " ] || [ -z " ${S3_REGION} " ]; then
4
+ echo " Some S3 variables not found in environment"
5
+ if [ -z " ${S3_ACCESS_KEY} " ]; then
6
+ echo " S3_ACCESS_KEY not found in environment"
7
+ fi
8
+
9
+ if [ -z " ${S3_SECRET_KEY} " ]; then
10
+ echo " S3_SECRET_KEY not found in environment"
11
+ fi
12
+
13
+ if [ -z " ${S3_BUCKET} " ]; then
14
+ echo " S3_BUCKET not found in environment"
15
+ fi
16
+
17
+ if [ -z " ${S3_ENDPOINT} " ]; then
18
+ echo " S3_ENDPOINT not found in environment"
19
+ fi
20
+
21
+ if [ -z " ${S3_REGION} " ]; then
22
+ echo " S3_REGION not found in environment"
23
+ fi
24
+
25
+ echo " Proceeding without mounting s3 to filesystem"
26
+ else
27
+ # Save credentials in a file for s3fs
28
+ echo " ${S3_ACCESS_KEY} :${S3_SECRET_KEY} " > /tmp/passwd-s3fs
29
+ chmod 600 /tmp/passwd-s3fs
30
+
31
+ # Mount the S3 bucket using s3fs
32
+ s3fs " ${S3_BUCKET} " /mnt/s3 \
33
+ -o passwd_file=/tmp/passwd-s3fs \
34
+ -o url=" ${S3_ENDPOINT} " \
35
+ -o endpoint=" ${S3_REGION} " \
36
+ -o use_path_request_style \
37
+ -o allow_other \
38
+ -o nonempty
39
+
40
+ mkdir -p /mnt/s3/http-jobs
41
+ mkdir -p /http-jobs
42
+
43
+ ln -s /mnt/s3/http-jobs /http-jobs
44
+
45
+ fi
46
+
47
+ exec " $@ "
You can’t perform that action at this time.
0 commit comments