From ad05210ff7752abbe8d207a8bfd151295b79acbd Mon Sep 17 00:00:00 2001 From: ErikO <49541561+EJOOSTEROP@users.noreply.github.com> Date: Thu, 30 Mar 2023 12:33:41 -0400 Subject: [PATCH 1/7] Update dockerfile Troubleshooting: Commenting out creation of DuckDB databases. --- dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dockerfile b/dockerfile index e723d30..d0a2cca 100644 --- a/dockerfile +++ b/dockerfile @@ -47,10 +47,11 @@ COPY ./DuckDB_CLI/duckdb_cli-linux-amd64 /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLD # https://docs.docker.com/engine/reference/builder/#volume RUN mkdir -p /${MELTANO_PROJ_ROOT}/data/dev/ \ && mkdir -p /${MELTANO_PROJ_ROOT}/data/test/ \ -&& mkdir -p /${MELTANO_PROJ_ROOT}/data/prod/ \ -&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/dev/data.duckdb "select * from pg_tables;" \ -&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/test/data.duckdb "select * from pg_tables;" \ -&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/prod/data.duckdb "select * from pg_tables;" +&& mkdir -p /${MELTANO_PROJ_ROOT}/data/prod/ +###\ +###&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/dev/data.duckdb "select * from pg_tables;" \ +###&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/test/data.duckdb "select * from pg_tables;" \ +###&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/prod/data.duckdb "select * from pg_tables;" RUN meltano invoke airflow dags pause stage_gie_dag \ && meltano invoke airflow dags pause stage_gie_backfill_dag From da4a40216bbc41f16152aef99c6756a729ea0d80 Mon Sep 17 00:00:00 2001 From: ErikO <49541561+EJOOSTEROP@users.noreply.github.com> Date: Thu, 30 Mar 2023 12:43:58 -0400 Subject: [PATCH 2/7] Update dockerfile Troubleshooting: putting one DuckDB container creation back in. --- dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerfile b/dockerfile index d0a2cca..b6a1784 100644 --- a/dockerfile +++ b/dockerfile @@ -47,9 +47,9 @@ COPY ./DuckDB_CLI/duckdb_cli-linux-amd64 /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLD # https://docs.docker.com/engine/reference/builder/#volume RUN mkdir -p /${MELTANO_PROJ_ROOT}/data/dev/ \ && mkdir -p /${MELTANO_PROJ_ROOT}/data/test/ \ -&& mkdir -p /${MELTANO_PROJ_ROOT}/data/prod/ +&& mkdir -p /${MELTANO_PROJ_ROOT}/data/prod/ \ +&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/dev/data.duckdb "select * from pg_tables;" ###\ -###&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/dev/data.duckdb "select * from pg_tables;" \ ###&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/test/data.duckdb "select * from pg_tables;" \ ###&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/prod/data.duckdb "select * from pg_tables;" From 3f17410947d3a617b843f91e979d9239b512678b Mon Sep 17 00:00:00 2001 From: ErikO <49541561+EJOOSTEROP@users.noreply.github.com> Date: Thu, 30 Mar 2023 13:53:17 -0400 Subject: [PATCH 3/7] Update dockerfile Troubleshoot: try different duckdb cli approach. --- dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dockerfile b/dockerfile index b6a1784..6036966 100644 --- a/dockerfile +++ b/dockerfile @@ -47,12 +47,14 @@ COPY ./DuckDB_CLI/duckdb_cli-linux-amd64 /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLD # https://docs.docker.com/engine/reference/builder/#volume RUN mkdir -p /${MELTANO_PROJ_ROOT}/data/dev/ \ && mkdir -p /${MELTANO_PROJ_ROOT}/data/test/ \ -&& mkdir -p /${MELTANO_PROJ_ROOT}/data/prod/ \ -&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/dev/data.duckdb "select * from pg_tables;" +&& mkdir -p /${MELTANO_PROJ_ROOT}/data/prod/ ###\ +###&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/dev/data.duckdb "select * from pg_tables;" \ ###&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/test/data.duckdb "select * from pg_tables;" \ ###&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/prod/data.duckdb "select * from pg_tables;" +RUN /project/duckdb_cli/duckdb /project/data/dev/data.duckdb "select * from pg_tables;" + RUN meltano invoke airflow dags pause stage_gie_dag \ && meltano invoke airflow dags pause stage_gie_backfill_dag From 33e167ef869cc2d20da6883e483e0d9ac64d6794 Mon Sep 17 00:00:00 2001 From: ErikO <49541561+EJOOSTEROP@users.noreply.github.com> Date: Thu, 30 Mar 2023 14:11:14 -0400 Subject: [PATCH 4/7] Update dockerfile Troubleshoot: add permission changes to files. --- dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dockerfile b/dockerfile index 6036966..948b3e5 100644 --- a/dockerfile +++ b/dockerfile @@ -53,6 +53,8 @@ RUN mkdir -p /${MELTANO_PROJ_ROOT}/data/dev/ \ ###&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/test/data.duckdb "select * from pg_tables;" \ ###&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/prod/data.duckdb "select * from pg_tables;" +RUN chmod u+x /project/duckdb_cli/duckdb +RUN chmod -R u+x /project/data/ RUN /project/duckdb_cli/duckdb /project/data/dev/data.duckdb "select * from pg_tables;" RUN meltano invoke airflow dags pause stage_gie_dag \ From cb2358ac0bd8b4dff11730594677f41aca6ee636 Mon Sep 17 00:00:00 2001 From: ErikO <49541561+EJOOSTEROP@users.noreply.github.com> Date: Thu, 30 Mar 2023 14:23:42 -0400 Subject: [PATCH 5/7] Update dockerfile chmod on duckdb only (not yet the new folders) --- dockerfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dockerfile b/dockerfile index 948b3e5..8fee113 100644 --- a/dockerfile +++ b/dockerfile @@ -42,20 +42,20 @@ COPY ./dags/. /${MELTANO_PROJ_ROOT}/${PROJECT}/orchestrate/dags/ # https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#add-or-copy ARG DUCKDB_CLI_FOLDER=duckdb_cli COPY ./DuckDB_CLI/duckdb_cli-linux-amd64 /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER} +RUN chmod -R u+x /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/ # TODO: put into a Docker volume? Just database or complete ${MELTANO_PROJ_ROOT} folder? # https://docs.docker.com/engine/reference/builder/#volume RUN mkdir -p /${MELTANO_PROJ_ROOT}/data/dev/ \ && mkdir -p /${MELTANO_PROJ_ROOT}/data/test/ \ -&& mkdir -p /${MELTANO_PROJ_ROOT}/data/prod/ -###\ -###&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/dev/data.duckdb "select * from pg_tables;" \ -###&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/test/data.duckdb "select * from pg_tables;" \ -###&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/prod/data.duckdb "select * from pg_tables;" - -RUN chmod u+x /project/duckdb_cli/duckdb -RUN chmod -R u+x /project/data/ -RUN /project/duckdb_cli/duckdb /project/data/dev/data.duckdb "select * from pg_tables;" +&& mkdir -p /${MELTANO_PROJ_ROOT}/data/prod/ \ +&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/dev/data.duckdb "select * from pg_tables;" \ +&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/test/data.duckdb "select * from pg_tables;" \ +&& /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/duckdb /${MELTANO_PROJ_ROOT}/data/prod/data.duckdb "select * from pg_tables;" + + +###RUN chmod -R u+x /project/data/ +###RUN /project/duckdb_cli/duckdb /project/data/dev/data.duckdb "select * from pg_tables;" RUN meltano invoke airflow dags pause stage_gie_dag \ && meltano invoke airflow dags pause stage_gie_backfill_dag From a0349e756fb6e8b22a5343ed0abb82b431bf5a98 Mon Sep 17 00:00:00 2001 From: EJOOSTEROP <49541561+EJOOSTEROP@users.noreply.github.com> Date: Thu, 30 Mar 2023 14:33:35 -0400 Subject: [PATCH 6/7] chmod on dbduck --- dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/dockerfile b/dockerfile index e723d30..727b8fb 100644 --- a/dockerfile +++ b/dockerfile @@ -42,6 +42,7 @@ COPY ./dags/. /${MELTANO_PROJ_ROOT}/${PROJECT}/orchestrate/dags/ # https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#add-or-copy ARG DUCKDB_CLI_FOLDER=duckdb_cli COPY ./DuckDB_CLI/duckdb_cli-linux-amd64 /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER} +RUN chmod -R u+x /${MELTANO_PROJ_ROOT}/${DUCKDB_CLI_FOLDER}/ # TODO: put into a Docker volume? Just database or complete ${MELTANO_PROJ_ROOT} folder? # https://docs.docker.com/engine/reference/builder/#volume From 55c034571ebce2d1ff62d9f1626b7b4b3d68d9cd Mon Sep 17 00:00:00 2001 From: EJOOSTEROP <49541561+EJOOSTEROP@users.noreply.github.com> Date: Thu, 30 Mar 2023 14:55:52 -0400 Subject: [PATCH 7/7] chmod duckdb in Dockerfile. Modify and update container action. --- .github/workflows/build-container.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container.yml index fb4ed05..d52f64f 100644 --- a/.github/workflows/build-container.yml +++ b/.github/workflows/build-container.yml @@ -10,8 +10,16 @@ name: Create and publish a Docker image on: + workflow_dispatch: push: - branches: ['release'] + branches: + - 'release' + - 'master' + tags: + - 'v*' + pull_request: + branches: + - 'master' env: REGISTRY: ghcr.io @@ -29,7 +37,8 @@ jobs: uses: actions/checkout@v3 - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + #uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -37,12 +46,14 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + #uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + uses: docker/metadata-action@v4 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Build and push Docker image - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + #uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + uses: docker/build-push-action@v4 with: context: . push: true