Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/pip/jinja2-3.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
teaf-wise authored Jun 24, 2024
2 parents a967062 + e6a1449 commit ad248f8
Show file tree
Hide file tree
Showing 40 changed files with 611 additions and 106 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @transferwise/analytics-platform
9 changes: 3 additions & 6 deletions .github/workflows/connectors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,17 @@ concurrency:
cancel-in-progress: true

jobs:
check:
test_install_connectors:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]

steps:
- name: Checking out repo
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
python-version: 3.8

- name: Check all connectors are installable
run: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
if: steps.check.outcome == 'failure'
run: |
cp dev-project/.env.template dev-project/.env
docker-compose -f dev-project/docker-compose.yml up -d
docker compose -f dev-project/docker-compose.yml up -d
- name: Wait for test containers to be ready
timeout-minutes: 5
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
if: steps.check.outcome == 'failure'
run: |
cp dev-project/.env.template dev-project/.env
docker-compose -f dev-project/docker-compose.yml up -d
docker compose -f dev-project/docker-compose.yml up -d
- name: Wait for test containers to be ready
if: steps.check.outcome == 'failure'
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
if: steps.check.outcome == 'failure'
run: |
cp dev-project/.env.template dev-project/.env
docker-compose -f dev-project/docker-compose.yml up -d
docker compose -f dev-project/docker-compose.yml up -d
- name: Wait for test containers to be ready
if: steps.check.outcome == 'failure'
Expand Down Expand Up @@ -189,7 +189,7 @@ jobs:
if: steps.check.outcome == 'failure'
run: |
cp dev-project/.env.template dev-project/.env
docker-compose -f dev-project/docker-compose.yml up -d
docker compose -f dev-project/docker-compose.yml up -d
- name: Wait for test containers to be ready
if: steps.check.outcome == 'failure'
Expand Down Expand Up @@ -239,7 +239,7 @@ jobs:
if: steps.check.outcome == 'failure'
run: |
cp dev-project/.env.template dev-project/.env
docker-compose -f dev-project/docker-compose.yml up -d
docker compose -f dev-project/docker-compose.yml up -d
- name: Wait for test containers to be ready
if: steps.check.outcome == 'failure'
Expand Down Expand Up @@ -292,7 +292,7 @@ jobs:
if: steps.check.outcome == 'failure'
run: |
cp dev-project/.env.template dev-project/.env
docker-compose -f dev-project/docker-compose.yml up -d
docker compose -f dev-project/docker-compose.yml up -d
- name: Wait for test containers to be ready
if: steps.check.outcome == 'failure'
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/lint_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ concurrency:
jobs:
lint_and_test:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9"]

steps:
- name: Checking out repo
Expand All @@ -29,11 +26,11 @@ jobs:
continue-on-error: true
run: ./scripts/ci_check_no_file_changes.sh python

- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python 3.8
if: steps.check.outcome == 'failure'
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
python-version: 3.8

- name: Install dependencies
if: steps.check.outcome == 'failure'
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
0.60.2b1 (2024-06-12)
---------------------
- Bump `pymongo`from `4.7.3` to `3.13.0`

0.60.1 (2024-06-12)
-------------------
- Bump `pymongo`from `3.12.3` to `4.7.3`

0.60.0 (2024-05-10)
-------------------
- Bump `pipelinewise-tap-mysql`from `1.5.6` to `1.6.0`
- Attempt SSL for MariaDB and PG sources as Preferred connection method

0.58.3 (2023-11-28)
-------------------
- Bump `pipelinewise-tap-kafka`from `8.2.0` to `8.2.1`
Expand Down
54 changes: 43 additions & 11 deletions dev-project/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: '3'
services:
### Primary container with PipelineWise CLI
pipelinewise:
image: python:3.8-slim-buster
platform: linux/amd64
image: ubuntu:20.04
container_name: pipelinewise_dev
working_dir: /opt/pipelinewise
entrypoint: /opt/pipelinewise/dev-project/entrypoint.sh
Expand Down Expand Up @@ -34,8 +34,17 @@ services:
context: ./pg
dockerfile: Dockerfile
container_name: pipelinewise_dev_postgres_source
# Making some logical decoding adjustments
command: -c "wal_level=logical" -c "max_replication_slots=5" -c "max_wal_senders=5"
volumes:
- ./pg/pg_hba.conf:/var/lib/postgresql/pg_hba.conf
# Making some logical decoding and ssl adjustments
command: >
-c "wal_level=logical"
-c "max_replication_slots=5"
-c "max_wal_senders=5"
-c "ssl=on"
-c "ssl_cert_file=/var/lib/postgresql/server.crt"
-c "ssl_key_file=/var/lib/postgresql/server.key"
-c "hba_file=/var/lib/postgresql/pg_hba.conf"
ports:
- ${TAP_POSTGRES_PORT_ON_HOST}:${TAP_POSTGRES_PORT}
environment:
Expand All @@ -47,11 +56,26 @@ services:

# MySQL service container used as test source database
db_mysql_source:
image: mariadb:10.2.26
image: mariadb:10.6.17
container_name: pipelinewise_dev_mysql_source
ports:
- ${TAP_MYSQL_PORT_ON_HOST}:${TAP_MYSQL_PORT}
command: --default-authentication-plugin=mysql_native_password --server-id=1 --log-bin=mysql-bin --binlog-format=ROW --binlog-do-db=${TAP_MYSQL_DB} --binlog-do-db=${TAP_MYSQL_REPLICA_DB}
volumes:
- ./my/server-cert.pem:/etc/my.cnf.d/certificates/server-cert.pem
- ./my/server-key.pem:/etc/my.cnf.d/certificates/server-key.pem
- ./my/ca-cert.pem:/etc/my.cnf.d/certificates/ca-cert.pem
command: >
--default-authentication-plugin=mysql_native_password
--server-id=1
--log-bin=mysql-bin
--binlog-format=ROW
--binlog-do-db=${TAP_MYSQL_DB}
--binlog-do-db=${TAP_MYSQL_REPLICA_DB}
--tls_version=TLSv1.2
--require_secure_transport=ON
--ssl_cert=/etc/my.cnf.d/certificates/server-cert.pem
--ssl_key=/etc/my.cnf.d/certificates/server-key.pem
--ssl_ca=/etc/my.cnf.d/certificates/ca-cert.pem
environment:
MYSQL_ROOT_PASSWORD: ${TAP_MYSQL_ROOT_PASSWORD}
MYSQL_USER: ${TAP_MYSQL_USER}
Expand All @@ -61,7 +85,7 @@ services:
- pipelinewise_network

db_mysql_source_replica:
image: mariadb:10.2.26
image: mariadb:10.6.17
container_name: pipelinewise_dev_mysql_source_replica
ports:
- ${TAP_MYSQL_REPLICA_PORT_ON_HOST}:${TAP_MYSQL_REPLICA_PORT}
Expand All @@ -76,7 +100,9 @@ services:

db_mongo_source:
container_name: "pipelinewise_dev_mongodb_source"
image: "mongo:4.2-bionic"
build:
context: ./mongo
dockerfile: Dockerfile
ports:
- ${TAP_MONGODB_PORT_ON_HOST}:${TAP_MONGODB_PORT}
environment:
Expand All @@ -86,9 +112,15 @@ services:
MONGO_USERNAME: ${TAP_MONGODB_USER}
MONGO_PASSWORD: ${TAP_MONGODB_PASSWORD}
MONGO_REPLICA_HOST: db_mongo_source
volumes:
- ./mongo/create_user.sh:/docker-entrypoint-initdb.d/create_user.sh
command: [mongod, --replSet, rs0]
command: >
mongod
--bind_ip_all
--replSet rs0
--keyFile /etc/ssl/replica.key
--tlsMode requireTLS
--tlsAllowConnectionsWithoutCertificates
--tlsCertificateKeyFile /etc/ssl/mongodb.pem
--tlsCAFile /etc/ssl/rootCA.pem
networks:
- pipelinewise_network

Expand Down
37 changes: 20 additions & 17 deletions dev-project/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,34 @@

set -e

apt-get update
apt-get install -y --no-install-recommends \
wget \
gnupg \
git
apt update

# Add Mongodb ppa
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add -
echo "deb https://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata

apt-get update
apt-get install -y --no-install-recommends \
apt install -y --no-install-recommends \
wget \
gnupg \
git \
alien \
gettext-base \
libaio1 \
mariadb-client \
mbuffer \
mongodb-database-tools \
mongodb-org-shell \
postgresql-client
postgresql-client \
python3.8 python3-pip python3-venv python3-dev

rm -rf /var/lib/apt/lists/* \
apt upgrade -y
# rm -rf /var/lib/apt/lists/* \

# Do a bunch of Mongo things
wget -q --no-check-certificate https://downloads.mongodb.com/compass/mongodb-mongosh_2.2.9_amd64.deb
apt install ./mongodb-mongosh_2.2.9_amd64.deb
rm -f mongodb-mongosh_2.2.9_amd64.deb
wget -q --no-check-certificate https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2004-x86_64-100.9.5.deb
apt install ./mongodb-database-tools-ubuntu2004-x86_64-100.9.5.deb
rm -f mongodb-database-tools-ubuntu2004-x86_64-100.9.5.deb

dev-project/mongo/initiate-replica-set.sh

# Install Oracle Instant Client required for tap-oracle
# ORA_INSTACLIENT_URL=https://download.oracle.com/otn_software/linux/instantclient/193000/oracle-instantclient19.3-basiclite-19.3.0.0.0-1.x86_64.rpm
Expand All @@ -33,11 +39,8 @@ rm -rf /var/lib/apt/lists/* \
# rm -f oracle-instantclient.rpm

# Build test databases

tests/db/tap_mysql_db.sh
tests/db/tap_postgres_db.sh

dev-project/mongo/init_rs.sh
tests/db/tap_mongodb.sh
tests/db/target_postgres.sh

Expand Down
7 changes: 7 additions & 0 deletions dev-project/mongo/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM mongo:5.0.26-focal

COPY --chown=mongodb:root --chmod=400 rootCA.pem /etc/ssl/rootCA.pem
COPY --chown=mongodb:root --chmod=400 mongodb.pem /etc/ssl/mongodb.pem
COPY --chown=mongodb:root --chmod=400 replica.key /etc/ssl/replica.key

COPY create-pipelinewise-user.sh /docker-entrypoint-initdb.d/create-pipelinewise-user.sh
10 changes: 10 additions & 0 deletions dev-project/mongo/create-pipelinewise-user.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
echo 'CREATE MONGODB PIPELINEWISE USER'

mongo --tls --tlsAllowInvalidCertificates -u $MONGO_INITDB_ROOT_USERNAME -p $MONGO_INITDB_ROOT_PASSWORD --authenticationDatabase admin admin <<EOF
db.getName();
db.createUser({
user: $(jq --arg 'user' $MONGO_USERNAME --null-input '$user'),
pwd: $(jq --arg 'pwd' $MONGO_PASSWORD --null-input '$pwd'),
roles: [{ role: 'readWrite', db: "$MONGO_INITDB_DATABASE" }]
});
EOF
8 changes: 0 additions & 8 deletions dev-project/mongo/create_user.sh

This file was deleted.

12 changes: 0 additions & 12 deletions dev-project/mongo/init_rs.sh

This file was deleted.

10 changes: 10 additions & 0 deletions dev-project/mongo/initiate-replica-set.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -e

echo
echo 'INITIALIZING MONGODB REPLICASET'
echo

mongosh "mongodb://$TAP_MONGODB_ROOT_USER:$TAP_MONGODB_ROOT_PASSWORD@$TAP_MONGODB_HOST:$TAP_MONGODB_PORT/?tls=true&tlsAllowInvalidCertificates=true&authSource=admin&directConnection=true"<<EOF
rs.initiate({_id: "rs0", members: [{_id: 0, host: '$TAP_MONGODB_HOST:$TAP_MONGODB_PORT'}]});
EOF
46 changes: 46 additions & 0 deletions dev-project/mongo/mongodb.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC8RDu+Q6GGIH0M
IW/6RzDSxqbK5XSLyBSKhX+DNqY8QKvkh1NAhlob0MaDFWlf34gOS7YQ3/VDCxSi
u/PadT28aCMJJqRko3u1OuhlAUuVBrFUA0mqQ+Xo7eXQiO7Xg17iF0vnM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x8U9nSI
HOmCJMamIR4wDQYJKoZIhvcNAQELBQADggEBAFdzTHva6pbkX/4dNJ4vy9oiYMuN
iWYyqB/99KfPEHlU/RFiNePXfwL4BI18A7IAKQ5Dl0Vd1ub6X17SegA6+OMKDfu6
DGmhgYHoBL4JXNd16LtOA9eHQtxynPTjhsSkuSz7i6eAumegK2EuZuw6fYHNXpmb
0ZTsRlGWWsrZJFtL5P7RUici9ZheDBhjEs9yYNMOM/VFTn2OAN5MTIY79O28DWQj
Uvx8DEw+YrxGLFqcDKjv7CKESti11PfAF67ERjQyURjqpeiVqO+D1SGzpdnXdisl
c9/k/p4rWNZe4LX9XyA1oLJUcZNNl3XUtghGu93YUMquWeBH9C4aklIhV1s=
-----END CERTIFICATE-----
16 changes: 16 additions & 0 deletions dev-project/mongo/replica.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
T2+O83yAELto/7Or19tC1xf8XGHIVYG5QUwtMDwCchC1Y0X/UgxnU34lsqoqtkjg
4z2SPwFQ4N/aCr5Ah/dRrBTXhFv03P5UD0aRTcQxQQTv5ubLTO3fe5SFc3uhvKKk
WiB9zlHElf21RVGXmnHHlNJQF2LeC8bRNIJtmCBIOYCy8SRt2NCecviME1B5k6Ly
pcKOKttHDOKOhJXeS8YhpkPEbB0fuX8/vPcP8AdDlv6XbIe9MG4x06I/1bDuyl6V
kp/VV1G6Hyy2w9q0ZV3sEgZay5wvzlWjcWaMJXpyjmQdQugGv59jQ23S0kToH7Pg
S/HMVy1AhS/PSzZveYZwAB993jqxH/UYTs8CapeUpHG9WfJoJlJtX8yzK9HuSHY8
ygCulhfXWIwhXP5Pv4cWM4DrFPYwLBBLXTyTOCCBEvrmFJB6ZggHbYgbzNK0Kvkj
IvLceSDJpFiwlCQ9MKyLfZublxv0DyqI3TV7yvjJ/XwbqNNGj+6/CodvY0RbemPG
4RmWLHsOx7sSt2AKoIM3LdNAZCq27hA/uEx8VzBXhz4qVraV50zz7yrtNRfu91At
vBM+DKQdY4Wj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