Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
mgramin committed Oct 4, 2024
1 parent c1fa353 commit 12b7242
Showing 5 changed files with 107 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mssqlserver/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM mcr.microsoft.com/mssql-tools
ADD --chown=mssql:root https://raw.githubusercontent.com/microsoft/sql-server-samples/master/samples/databases/northwind-pubs/instnwnd.sql /opt/instnwnd.sql
19 changes: 19 additions & 0 deletions mssqlserver/config.tdk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
default_config:
mode: KEEP
# mode: MASKING
# mode: GENERATION
# target_ratio: 2.0


tables:

- table_name_with_schema: "dbo.Customers"
transformations:
- columns: ["CompanyName", "Address", "ContactName", "Phone", "Fax"]
mode: MASKING


table_truncation_mode: "TRUNCATE"
schema_creation_mode: DROP_AND_CREATE
safety_mode: "RELAXED"
cycle_resolution_strategy: DEFER_FOREIGN_KEY
84 changes: 84 additions & 0 deletions mssqlserver/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
version: '3.5'

services:

input_db:
container_name: input_db
image: mcr.microsoft.com/mssql/server:2022-latest
ports:
- 6000:1433
environment:
MSSQL_SA_PASSWORD: ${MSSQL_SA_PASSWORD:-Secret_password_1}
ACCEPT_EULA: Y
healthcheck:
test: >
echo 'select 1;' | /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U sa -P Secret_password_1

Check warning on line 15 in mssqlserver/docker-compose.yaml

GitHub Actions / yamllint

15:81 [line-length] line too long (94 > 80 characters)
interval: 3s
timeout: 3s
retries: 10


output_db:
container_name: output_db
image: mcr.microsoft.com/mssql/server:2022-latest
ports:
- 6001:1433
environment:
MSSQL_SA_PASSWORD: ${MSSQL_SA_PASSWORD:-Secret_password_1}
ACCEPT_EULA: Y
healthcheck:
test: >
echo 'select 1;' | /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U sa -P Secret_password_1

Check warning on line 31 in mssqlserver/docker-compose.yaml

GitHub Actions / yamllint

31:81 [line-length] line too long (94 > 80 characters)
interval: 3s
timeout: 3s
retries: 10


databases:
container_name: databases
build: .
command: >
bash -c "/opt/mssql-tools/bin/sqlcmd -S input_db -U SA -P Secret_password_1 -i /opt/init.sql

Check warning on line 41 in mssqlserver/docker-compose.yaml

GitHub Actions / yamllint

41:81 [line-length] line too long (98 > 80 characters)
&& /opt/mssql-tools/bin/sqlcmd -S input_db -U SA -P Secret_password_1 -d northwind -i /opt/instnwnd.sql

Check warning on line 42 in mssqlserver/docker-compose.yaml

GitHub Actions / yamllint

42:81 [line-length] line too long (109 > 80 characters)
&& /opt/mssql-tools/bin/sqlcmd -S input_db -U SA -P Secret_password_1 -d northwind -i /opt/prepare_source_db.sql

Check warning on line 43 in mssqlserver/docker-compose.yaml

GitHub Actions / yamllint

43:81 [line-length] line too long (118 > 80 characters)
&& /opt/mssql-tools/bin/sqlcmd -S output_db -U SA -P Secret_password_1 -i /opt/init.sql"

Check warning on line 44 in mssqlserver/docker-compose.yaml

GitHub Actions / yamllint

44:81 [line-length] line too long (94 > 80 characters)
volumes:
- ./init.sql:/opt/init.sql
- ./prepare_source_db.sql:/opt/prepare_source_db.sql
depends_on:
input_db:
condition: service_healthy
output_db:
condition: service_healthy


tdk:
extends:
file: ../parent-compose.yml
service: tdk
environment:
SYNTHESIZED_INPUT_URL: jdbc:sqlserver://input_db:1433;databaseName=northwind;encrypt=false
SYNTHESIZED_INPUT_USERNAME: SA
SYNTHESIZED_INPUT_PASSWORD: Secret_password_1
SYNTHESIZED_OUTPUT_URL: jdbc:sqlserver://output_db:1433;databaseName=northwind;encrypt=false
SYNTHESIZED_OUTPUT_USERNAME: SA
SYNTHESIZED_OUTPUT_PASSWORD: Secret_password_1
SYNTHESIZED_KEY: ${SYNTHESIZED_KEY}
SYNTHESIZED_USERCONFIG_FILE: /app/config.yaml
JAVA_TOOL_OPTIONS: >
-Dlogging.level.io.synthesized.tdk.executor.lite.LiteTransformer=INFO
-Dlogging.level.io.synthesized.tdk=WARN
-Dlogging.level.com.zaxxer.hikari=WARN
-Dlogging.level.org.reflections=WARN
-Dlogging.level.org.jooq=WARN
-XX:+UseContainerSupport
-XX:MaxRAMPercentage=80.0
-Dspring.main.banner-mode=CONSOLE
-Dspring.banner.location=file:/app/banner.txt
volumes:
- ./config.tdk.yaml:/app/config.yaml
- ../banner.txt:/app/banner.txt
- ../logback-lite-executor.xml:/app/logback-lite-executor.xml
depends_on:
databases:
condition: service_completed_successfully
1 change: 1 addition & 0 deletions mssqlserver/init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
create database northwind;
1 change: 1 addition & 0 deletions mssqlserver/prepare_source_db.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table dbo.[Order Details] DROP CONSTRAINT PK_Order_Details;

0 comments on commit 12b7242

Please sign in to comment.