This is an automated email from the ASF dual-hosted git repository.

ka94 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 82ccfd494 fix: Fix broken Python config in Dockerfile (#4734)
82ccfd494 is described below

commit 82ccfd494b21ab2c90680b675131be0161864199
Author: Keon Amini <[email protected]>
AuthorDate: Thu Mar 23 22:07:54 2023 -0500

    fix: Fix broken Python config in Dockerfile (#4734)
---
 backend/Dockerfile                 | 21 ++++++++++++---------
 backend/test/helper/api.go         |  4 ++--
 backend/test/remote/remote_test.go |  2 +-
 3 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/backend/Dockerfile b/backend/Dockerfile
index a33a2884a..d15ca1240 100644
--- a/backend/Dockerfile
+++ b/backend/Dockerfile
@@ -111,12 +111,12 @@ RUN cd /usr/local/deps/target/lib && \
     done
 
 
-FROM debian:bullseye-slim as base
+FROM python:3.11.2-slim-bullseye as base
 
 ENV PYTHONUNBUFFERED=1
 
 RUN apt-get update && \
-    apt-get install -y python3-dev python3-pip tar curl libssh2-1 zlib1g && \
+    apt-get install -y python3-dev python3-pip tar curl libssh2-1 zlib1g 
libffi-dev default-libmysqlclient-dev && \
     apt-get clean && \
     rm -fr /usr/share/doc/* \
            /usr/share/info/* \
@@ -134,13 +134,16 @@ EXPOSE 8080
 
 WORKDIR /app
 # Setup Python
-COPY backend/python/requirements.txt /app/requirements.txt
+COPY python/ /app/python/
 RUN python3 -m pip install --no-cache --upgrade pip setuptools && \
     python3 -m pip install --no-cache dbt-mysql dbt-postgres && \
-    python3 -m pip install --no-cache -r requirements.txt && \
-    rm -fr /usr/share/python-wheels/* \
+    python3 -m pip install --no-cache -r python/requirements.txt && \
+    rm -fr /usr/share/python-wheels/*
+# Setup Python Poetry package manager
 RUN curl -sSL https://install.python-poetry.org | python3 -
 RUN ln -sf /root/.local/bin/poetry /usr/local/bin
+# Build Python plugins
+RUN /app/python/build.sh
 
 
 FROM base as devlake-base
@@ -152,14 +155,14 @@ COPY --from=build /usr/local/deps/target/lib/*.so* 
/app/libs
 RUN ldconfig -vn /app/libs
 
 # apps
-COPY --from=build /app/backend/bin /app/bin
-COPY --from=build /app/backend/resources/tap /app/resources/tap
+COPY --from=build /app/bin /app/bin
+COPY --from=build /app/resources/tap /app/resources/tap
 
 ENV PATH="/app/bin:${PATH}"
 
-#add tini, prevent zombie process 
+#add tini, prevent zombie process
 RUN apt-get update && \
-    apt-get install -y tini 
+    apt-get install -y tini
 
 ENTRYPOINT ["/usr/bin/tini", "--"]
 
diff --git a/backend/test/helper/api.go b/backend/test/helper/api.go
index 1c46ebb56..237122d65 100644
--- a/backend/test/helper/api.go
+++ b/backend/test/helper/api.go
@@ -165,14 +165,14 @@ func (d *DevlakeClient) GetScope(pluginName string, 
connectionId uint64, scopeId
        }, http.MethodGet, 
fmt.Sprintf("%s/plugins/%s/connections/%d/scopes/%s", d.Endpoint, pluginName, 
connectionId, scopeId), nil)
 }
 
-func (d *DevlakeClient) CreateTransformRule(pluginName string, rules any) any {
+func (d *DevlakeClient) CreateTransformationRule(pluginName string, rules any) 
any {
        return sendHttpRequest[any](d.testCtx, d.timeout, debugInfo{
                print:      true,
                inlineJson: false,
        }, http.MethodPost, fmt.Sprintf("%s/plugins/%s/transformation_rules", 
d.Endpoint, pluginName), rules)
 }
 
-func (d *DevlakeClient) ListTransformRules(pluginName string) []any {
+func (d *DevlakeClient) ListTransformationRules(pluginName string) []any {
        return sendHttpRequest[[]any](d.testCtx, d.timeout, debugInfo{
                print:      true,
                inlineJson: false,
diff --git a/backend/test/remote/remote_test.go 
b/backend/test/remote/remote_test.go
index 599ab9235..8e286155c 100644
--- a/backend/test/remote/remote_test.go
+++ b/backend/test/remote/remote_test.go
@@ -114,7 +114,7 @@ func createTestConnection(client *helper.DevlakeClient) 
*helper.Connection {
 }
 
 func createTestScope(client *helper.DevlakeClient, connectionId uint64) any {
-       res := client.CreateTransformRule(PLUGIN_NAME, FakeTxRule{Name: "Tx 
rule", Env: "test env"})
+       res := client.CreateTransformationRule(PLUGIN_NAME, FakeTxRule{Name: 
"Tx rule", Env: "test env"})
        rule, ok := res.(map[string]interface{})
        if !ok {
                panic("Cannot cast transform rule")

Reply via email to