Skip to content

Commit

Permalink
Dockerfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Stoffel committed Nov 27, 2023
1 parent 6824a92 commit 583e9ac
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 25 deletions.
35 changes: 13 additions & 22 deletions analytics-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
# Use the base image
FROM softwareag/apama-cumulocity-builder

RUN apt-get update && apt-get -y upgrade
FROM softwareag/apama-cumulocity-builder:10.15

# Set the working directory
WORKDIR /usr/src/app
WORKDIR /apama_work

USER root

RUN microdnf install git

USER sagadmin
# Clone the apama-analytics-builder-block-sdk repository
RUN git clone https://github.com/SoftwareAG/apama-analytics-builder-block-sdk.git

COPY requirements.txt /usr/src/app
COPY flask_wrapper.py /usr/src/app
COPY requirements.txt /apama_work
COPY flask_wrapper.py /apama_work
# Used for tes purposes
RUN mkdir -p /tmp/builder
COPY Math_AB_Extension.zip /tmp/builder/

RUN pip install --upgrade pip
RUN pip install -r requirements.txt

ENTRYPOINT ["python"FROM python:3.8-slim

RUN apt-get update && apt-get -y upgrade

COPY requirements.txt /
COPY sync_class.py /
COPY flask_wrapper.py /

RUN pip install --upgrade pip
RUN pip install -r requirements.txt
#COPY Math_AB_Extension.zip /tmp/builder/

RUN pip3 install --upgrade pip
RUN pip3 install -r requirements.txt

ENTRYPOINT ["python"
CMD ["python3", "flask_wrapper.py"]
11 changes: 9 additions & 2 deletions analytics-service/flask_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,14 @@ def create_extension():
# step 2: run analytics_builder script
# analytics_builder build extension --input work_temp_dir --output zip_name
zip_name = f"{extension_name}.zip"
# subprocess.call(["analytics_builder", "build extension", f"--input {work_temp_dir}", f"--output {zip_name}"])
subprocess.call(
[
"/apama_work/apama-analytics-builder-block-sdk/analytics_builder",
"build extension",
f"--input {work_temp_dir}",
f"--output {zip_name}",
]
)

# step 3 : return result
# extension_result = f"{work_temp_dir}/{zip_name}"
Expand Down Expand Up @@ -111,4 +118,4 @@ def extract_path(path):

if __name__ == "__main__":
# app.run(host="0.0.0.0", port=80, debug=False)
app.run(host="127.0.0.1", port=9080, debug=False)
app.run(host="0.0.0.0", port=1090, debug=False)
3 changes: 2 additions & 1 deletion analytics-service/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
c8y_api
flask
flask
PyGithub

0 comments on commit 583e9ac

Please sign in to comment.