-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ci cd take2 #62
Merged
Merged
Ci cd take2 #62
Changes from 27 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
c734aaa
integrate dbt-adapter-tests
dataders fb8c9c0
still missing docker commands
dataders e383a8d
start up vars
dataders a92047c
has to be string for SQL Server
dataders 7bbba90
add dockerfile
dataders a0c27dd
added for debugging purposes
dataders 6119801
mssql-tools only on packages.microsoft.com
dataders e9190ae
add to path
dataders 893ed2f
connect this way?
dataders 1cb1bb7
add wait command
dataders 0127c9c
needed for testing
dataders 3bfbef2
needed for wait time?
dataders 150b870
alternative
dataders acb4935
explicitly encrypt and trust
dataders cc3a80b
reprex simpler without dbt
dataders 063ec4a
typo
dataders e464bcf
indentation error
dataders 82a13d0
bool inputs outputs 'Yes' when True
dataders a79824d
helping out future us
dataders 42b444f
enable all tests I know should work
dataders 18b6731
sleep is sufficient
dataders d6f5f95
sleeping not needed
dataders 6fc4779
update with upstream
dataders a45504d
clarity
dataders 0ea46f2
need sleep
dataders b2b9c75
only failing test
dataders 0d4df19
run all tests that are currently passing
dataders 6e13086
Merge branch 'master' of https://github.com/mikaelene/dbt-sqlserver i…
dataders fdc6171
New try at tests. Only changed user and pass. Need to replace with va…
mikaelene e0bbc88
Merge branch 'CI_CD_take2' of https://github.com/mikaelene/dbt-sqlser…
dataders 05dfb9e
bugfix encrypt & trust_cert attr weren't respected
dataders 5745b2f
align with CircleCI config
dataders 94592a4
document new params
dataders a820aaf
cleaner explanation
dataders 85f28e9
Merge pull request #64 from dbt-msft/ci_for_sqlserver
mikaelene f666ed5
Removed Authentication=SqlPassword for standard sql user pass auth
mikaelene 6743a1b
Updated the sqlserver.dbtspec to reflect how I imagine most users con…
mikaelene File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
python: circleci/[email protected] | ||
|
||
jobs: | ||
build-and-test: | ||
docker: | ||
- image: dataders/pyodbc:1.4 | ||
- image: mcr.microsoft.com/mssql/server:2019-latest | ||
environment: | ||
ACCEPT_EULA: 'yes' | ||
MSSQL_SA_PASSWORD: 5atyaNadella | ||
MSSQL_IP_ADDRESS: 0.0.0.0 | ||
executor: python/default | ||
steps: | ||
- checkout | ||
- run: | ||
name: wait for SQL Server container to set up | ||
command: sleep 30 | ||
- run: | ||
name: test connection via SQL CMD | ||
command: sqlcmd -S 'localhost,1433' -U sa -P 5atyaNadella -Q 'create database blog' | ||
- python/install-packages: | ||
pkg-manager: pip | ||
- run: | ||
name: Test adapter against dbt-adapter-tests | ||
command: tox -e integration-synapse | ||
|
||
workflows: | ||
main: | ||
jobs: | ||
- build-and-test: | ||
context: | ||
- DBT_SYNAPSE_PROFILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
FROM python:3.7-slim AS base | ||
|
||
ADD requirements.txt ./ | ||
|
||
# Setup dependencies for pyodbc | ||
RUN \ | ||
apt-get update && \ | ||
apt-get install -y curl build-essential unixodbc-dev g++ apt-transport-https && \ | ||
gpg --keyserver hkp://keys.gnupg.net --recv-keys 5072E1F5 | ||
|
||
# install netcat (i.e. `nc` command) | ||
RUN apt install -y netcat | ||
|
||
RUN \ | ||
export ACCEPT_EULA='Y' && \ | ||
# Install pyodbc db drivers for MSSQL | ||
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \ | ||
curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list && \ | ||
apt-get update && \ | ||
apt-get install -y msodbcsql17 odbc-postgresql mssql-tools | ||
|
||
# add sqlcmd to the path | ||
ENV PATH="$PATH:/opt/mssql-tools/bin" | ||
|
||
# Update odbcinst.ini to make sure full path to driver is listed | ||
RUN \ | ||
sed 's/Driver=psql/Driver=\/usr\/lib\/x86_64-linux-gnu\/odbc\/psql/' /etc/odbcinst.ini > /tmp/temp.ini && \ | ||
mv -f /tmp/temp.ini /etc/odbcinst.ini | ||
# Install pip | ||
RUN \ | ||
pip install --upgrade pip && \ | ||
pip install -r requirements.txt && \ | ||
rm requirements.txt | ||
# permission management | ||
RUN \ | ||
chmod +rwx /etc/ssl/openssl.cnf && \ | ||
# change TLS back to version 1 | ||
sed -i 's/TLSv1.2/TLSv1/g' /etc/ssl/openssl.cnf && \ | ||
# allow weak certificates (certificate signed with SHA1) | ||
# by downgrading OpenSSL security level from 2 to 1 | ||
sed -i 's/SECLEVEL=2/SECLEVEL=1/g' /etc/ssl/openssl.cnf | ||
|
||
RUN \ | ||
# Cleanup build dependencies | ||
apt-get remove -y curl apt-transport-https debconf-utils g++ gcc rsync build-essential gnupg2 && \ | ||
apt-get autoremove -y && apt-get autoclean -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
dbt-core~=0.18.0 | ||
pyodbc>=4.0.27 | ||
azure-identity>=1.4.0 | ||
black~=20.8b1 | ||
pytest-dbt-adapter~=0.3.0 | ||
tox==3.2.0 | ||
flake8>=3.5.0 | ||
certifi==2020.6.20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
target: | ||
type: sqlserver | ||
driver: "ODBC Driver 17 for SQL Server" | ||
schema: "dbt_test_{{ var('_dbt_random_suffix') }}" | ||
host: localhost | ||
#database: msdb | ||
database: dbt_test | ||
username: SA | ||
#password: 5atyaNadella | ||
password: "TheStrongestPass!" | ||
encrypt: true | ||
trust_cert: true | ||
port: 1433 | ||
threads: 8 | ||
sequences: | ||
test_dbt_empty: empty | ||
test_dbt_base: base | ||
test_dbt_ephemeral: ephemeral | ||
test_dbt_incremental: incremental | ||
test_dbt_snapshot_strategy_timestamp: snapshot_strategy_timestamp | ||
test_dbt_snapshot_strategy_check_cols: snapshot_strategy_check_cols | ||
test_dbt_data_test: data_test | ||
test_dbt_schema_test: schema_test | ||
#test_dbt_ephemeral_data_tests: data_test_ephemeral_models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[tox] | ||
skipsdist = True | ||
envlist = unit, flake8, integration-synapse | ||
|
||
[testenv:integration-synapse] | ||
basepython = python3 | ||
commands = /bin/bash -c '{envpython} -m pytest -v test/integration/sqlserver.dbtspec' | ||
passenv = DBT_SYNAPSE_DB DBT_SYNAPSE_PORT DBT_SYNAPSE_PWD DBT_SYNAPSE_SERVER DBT_SYNAPSE_UID | ||
deps = | ||
-r{toxinidir}/requirements.txt | ||
-e. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikaelene by "breaks old way of setting up profile" do you mean that I've toggled Encrypt to now be
False
by default instead ofTrue
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like that. I removed the cert settings stuff from my profile and it stopped working. Just have to make sure the pr doesn’t break the adapter for all users 😀