Skip to content

Commit c930499

Browse files
author
flo-mair
committed
Configure for new Python Version
1 parent 2c255f9 commit c930499

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

consumer/Dockerfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
FROM amazonlinux:2
22

33
RUN yum install -y java-1.8.0-openjdk.x86_64 &&\
4-
yum install -y amazon-linux-extras &&\
5-
amazon-linux-extras install python3 &&\
4+
yum install -y python3.x86_64 &&\
65
yum install -y git &&\
7-
pip3 install amazon_kclpy
6+
python3 -m pip install amazon_kclpy
87

98
RUN git clone --depth 1 --branch v2.0.1 https://github.com/awslabs/amazon-kinesis-client-python /kclpy &&\
109
mv /kclpy/amazon_kclpy / &&\
1110
mkdir -p app/logs &&\
12-
mv /kclpy/samples/amazon_kclpy_helper.py /app &&\
11+
mv /kclpy/samples/amazon_kclpy_helper.py /usr/bin &&\
1312
rm -rf /kclpy
1413

15-
COPY record_processor.properties record_processor.py setup.py logback.xml run.sh set_properties.py /app/
14+
COPY record_processor.properties record_processor.py setup.py logback.xml run.sh set_properties.py /usr/bin/
1615

17-
RUN python3 app/setup.py install &&\
18-
chmod 755 /app/run.sh
16+
RUN python3 /usr/bin/setup.py install &&\
17+
chmod 777 /usr/bin
1918

2019

21-
ENTRYPOINT ["sh", "./app/run.sh"]
20+
ENTRYPOINT ["sh", "/usr/bin/run.sh"]

consumer/record_processor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/python3
22

33
# Copyright 2014-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
# SPDX-License-Identifier: MIT-0

consumer/run.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/sh
2-
python3 app/set_properties.py
3-
`python3 /usr/bin/amazon_kclpy_helper.py --print_command --java /usr/bin/java --properties app/record_processor.properties --log-configuration app/logback.xml` &
2+
python3 /usr/bin/set_properties.py
3+
chmod 777 /usr/bin/record_processor.py
4+
`python3 /usr/bin/amazon_kclpy_helper.py --print_command --java /usr/bin/java --properties /usr/bin/record_processor.properties --log-configuration /usr/bin/logback.xml` &
45
touch /app/logs/record_processor.log
56
exec tail -f /app/logs/record_processor.log

consumer/set_properties.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
import os
88

9-
with open('app/record_processor.properties', 'r') as file :
9+
with open('/usr/bin/record_processor.properties', 'r') as file :
1010
filedata = file.read()
1111
filedata = filedata.replace('AWS_REGION', os.environ['REGION'])
1212
filedata = filedata.replace('STREAM_NAME', os.environ['STREAM_NAME'])
1313
filedata = filedata.replace('APPLICATION_NAME', os.environ['APPLICATION_NAME'])
1414

15-
with open('app/record_processor.properties', 'w') as file:
15+
with open('/usr/bin/record_processor.properties', 'w') as file:
1616
file.write(filedata)

0 commit comments

Comments
 (0)