File tree Expand file tree Collapse file tree 6 files changed +63
-18
lines changed
Expand file tree Collapse file tree 6 files changed +63
-18
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env sh
2+
3+ # From: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server
4+ # modifications: Added --non-interactive and --no-cache flags, removed sudo, added aarch64 as an alias for arm64
5+
6+ architecture=" unsupported"
7+
8+ case " $( uname -m) " in
9+ x86_64)
10+ architecture=" amd64"
11+ ;;
12+ arm64|aarch64)
13+ architecture=" arm64"
14+ ;;
15+ esac
16+
17+ if [ " unsupported" = " $architecture " ]; then
18+ echo " Alpine architecture $( uname -m) is not currently supported."
19+ exit 1
20+ fi
21+
22+ # Download the desired package(s)
23+ curl -O https://download.microsoft.com/download/7/6/d/76de322a-d860-4894-9945-f0cc5d6a45f8/msodbcsql18_18.4.1.1-1_$architecture .apk
24+ curl -O https://download.microsoft.com/download/7/6/d/76de322a-d860-4894-9945-f0cc5d6a45f8/mssql-tools18_18.4.1.1-1_$architecture .apk
25+
26+ # (Optional) Verify signature, if 'gpg' is missing install it using 'apk add gnupg':
27+ curl -O https://download.microsoft.com/download/7/6/d/76de322a-d860-4894-9945-f0cc5d6a45f8/msodbcsql18_18.4.1.1-1_$architecture .sig
28+ curl -O https://download.microsoft.com/download/7/6/d/76de322a-d860-4894-9945-f0cc5d6a45f8/mssql-tools18_18.4.1.1-1_$architecture .sig
29+
30+ curl https://packages.microsoft.com/keys/microsoft.asc | gpg --import -
31+ gpg --verify msodbcsql18_18.4.1.1-1_$architecture .sig msodbcsql18_18.4.1.1-1_$architecture .apk
32+ gpg --verify mssql-tools18_18.4.1.1-1_$architecture .sig mssql-tools18_18.4.1.1-1_$architecture .apk
33+
34+ # Install the package(s)
35+ apk add --no-cache --non-interactive --allow-untrusted msodbcsql18_18.4.1.1-1_$architecture .apk
36+ apk add --no-cache --non-interactive --allow-untrusted mssql-tools18_18.4.1.1-1_$architecture .apk
Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ RUN apk update && apk upgrade && apk add --no-cache \
1515 musl-dev \
1616 gfortran \
1717 linux-headers=6.6-r0 \
18+ # Tools needed for installing the MSSQL ODBC drivers \
19+ curl \
20+ gpg \
1821 # Additional libraries needed and their dev counterparts. We add both so that we can remove
1922 # the *-dev later, keeping the libraries
2023 openblas=0.3.28-r0 \
@@ -28,6 +31,9 @@ RUN apk add --no-cache \
2831 libarrow=18.1.0-r0 \
2932 apache-arrow-dev=18.1.0-r0
3033
34+ COPY --chmod=775 ./deploy/install_linuxodbc.sh /tmp/dk/install_linuxodbc.sh
35+ RUN /tmp/dk/install_linuxodbc.sh
36+
3137# Install TestGen's main project empty pyproject.toml to install (and cache) the dependencies first
3238COPY ./pyproject.toml /tmp/dk/pyproject.toml
3339RUN mkdir /dk
@@ -40,7 +46,11 @@ RUN apk del \
4046 cmake \
4147 musl-dev \
4248 gfortran \
49+ curl \
50+ gpg \
4351 linux-headers \
4452 openblas-dev \
4553 unixodbc-dev \
4654 apache-arrow-dev
55+
56+ RUN rm /tmp/dk/install_linuxodbc.sh
Original file line number Diff line number Diff line change 1- ARG TESTGEN_BASE_LABEL=v3
1+ ARG TESTGEN_BASE_LABEL=v4
22
33FROM datakitchen/dataops-testgen-base:${TESTGEN_BASE_LABEL} AS release-image
44
55# Args have to be set in current build stage: https://github.com/moby/moby/issues/37345
66ARG TESTGEN_VERSION
77ARG TESTGEN_DOCKER_HUB_REPO
88
9+ ENV PYTHONPATH=/dk/lib/python3.12/site-packages
10+ ENV PATH=$PATH:/dk/bin
11+
912# Now install everything
1013COPY . /tmp/dk/
1114RUN python3 -m pip install --prefix=/dk /tmp/dk
@@ -17,12 +20,9 @@ RUN addgroup -S testgen && adduser -S testgen -G testgen
1720RUN mkdir /var/lib/testgen
1821RUN chown -R testgen:testgen /var/lib/testgen /dk/lib/python3.12/site-packages/streamlit/static
1922
20- ENV PYTHONPATH=/dk/lib/python3.12/site-packages
21- ENV PATH=$PATH:/dk/bin
22-
2323ENV TESTGEN_VERSION=${TESTGEN_VERSION}
24- ENV TG_RELEASE_CHECK=docker
2524ENV TESTGEN_DOCKER_HUB_REPO=${TESTGEN_DOCKER_HUB_REPO}
25+ ENV TG_RELEASE_CHECK=docker
2626ENV STREAMLIT_SERVER_MAX_UPLOAD_SIZE=200
2727
2828USER testgen
Original file line number Diff line number Diff line change 1414
1515DOCKER_BUILDER_NAME = "dk-builder"
1616DOCKER_BUILDER_PLATFORMS = "linux/amd64,linux/arm64"
17- TESTGEN_DEFAULT_BASE_LABEL = "v3"
18-
1917
2018@task
2119def required_tools (ctx : Context ) -> None :
@@ -91,7 +89,7 @@ def build_public_image(
9189 version : str = "" ,
9290
9391 load : bool = False ,
94- base_label : str = TESTGEN_DEFAULT_BASE_LABEL ,
92+ base_label : str = "" ,
9593 debug : bool = False
9694) -> None :
9795 """Builds and pushes the TestGen image"""
@@ -114,12 +112,12 @@ def build_public_image(
114112 if debug :
115113 extra_args .append ("--print" )
116114
117- ctx . run (
118- f"docker buildx bake -f deploy/docker-bake.hcl testgen- { target } { ' ' . join (extra_args ) } " ,
119- env = {
120- "TESTGEN_LABELS" : " " . join ( label ),
121- "TESTGEN_BASE_LABEL" : base_label ,
122- "TESTGEN_VERSION" : version ,
123- },
124- echo = True ,
125- )
115+ env = {
116+ "TESTGEN_LABELS" : " " . join (label ) ,
117+ "TESTGEN_VERSION" : version ,
118+ }
119+ if base_label :
120+ env [ "TESTGEN_BASE_LABEL" ] = base_label
121+
122+ cmd = f"docker buildx bake -f deploy/docker-bake.hcl testgen- { target } { ' ' . join ( extra_args ) } "
123+ ctx . run ( cmd , env = env , echo = True )
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
88
99[project ]
1010name = " dataops-testgen"
11- version = " 3.7.1 "
11+ version = " 3.7.6 "
1212description = " DataKitchen's Data Quality DataOps TestGen"
1313authors = [
1414 {
"name" =
" DataKitchen, Inc." ,
"email" =
" [email protected] " },
Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ def validate_test(test_definition):
134134 connection ["connect_by_key" ],
135135 connection ["private_key" ],
136136 connection ["private_key_passphrase" ],
137+ connection ["http_path" ],
137138 sql_query ,
138139 )
139140
You can’t perform that action at this time.
0 commit comments