Skip to content

Commit 0a4b4c7

Browse files
Merge pull request #27 from DataKitchen/release/3.0.0
Release/3.0.0
2 parents 008edc7 + 3ceef1c commit 0a4b4c7

File tree

169 files changed

+11541
-3863
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+11541
-3863
lines changed

.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ node_modules/
1515
scripts/
1616
venv/
1717
.ruff_cache/
18+
deploy
19+
!deploy/install_*.sh

.github/workflows/python-job.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
inputs:
66
python-version:
77
type: string
8-
default: "3.10"
8+
default: "3.12"
99
run:
1010
required: true
1111
type: string

CONTRIBUTORS.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ Thanks to everyone who has contributed to DataOps TestGen!
1616
- [Eric Estabrooks](https://www.linkedin.com/in/ericestabrooks/) 🤔
1717
- [Gil Benghiat](https://www.linkedin.com/in/gilbertbenghiat/) 🤔 💬
1818
- [Chris Bergh](https://www.linkedin.com/in/chrisbergh/) 🤔 📖
19+
- [Astor Fernandez](https://www.linkedin.com/in/astorfernandez/) 💻

Dockerfile

-40
This file was deleted.

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ As an alternative to the Docker Compose [installation with dk-installer (recomme
8383

8484
| Software | Tested Versions | Command to check version |
8585
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------|------------------------------|
86-
| [Python](https://www.python.org/downloads/) <br/>- Most Linux and macOS systems have Python pre-installed. <br/>- On Windows machines, you will need to download and install it. | 3.10, 3.11, 3.12 | `python3 --version` |
86+
| [Python](https://www.python.org/downloads/) <br/>- Most Linux and macOS systems have Python pre-installed. <br/>- On Windows machines, you will need to download and install it. | 3.12 | `python3 --version` |
8787
| [PostgreSQL](https://www.postgresql.org/download/) | 14.1, 15.8, 16.4 | `psql --version`|
8888

8989
### Install the TestGen package
9090

9191
We recommend using a Python virtual environment to avoid any dependency conflicts with other applications installed on your machine. The [venv](https://docs.python.org/3/library/venv.html#creating-virtual-environments) module, which is part of the Python standard library, or other third-party tools, like [virtualenv](https://virtualenv.pypa.io/en/latest/) or [conda](https://docs.conda.io/en/latest/), can be used.
9292

93-
Create and activate a virtual environment with a TestGen-compatible version of Python (`>=3.10`). The steps may vary based on your operating system and Python installation - the [Python packaging user guide](https://packaging.python.org/en/latest/tutorials/installing-packages/) is a useful reference.
93+
Create and activate a virtual environment with a TestGen-compatible version of Python (`>=3.12`). The steps may vary based on your operating system and Python installation - the [Python packaging user guide](https://packaging.python.org/en/latest/tutorials/installing-packages/) is a useful reference.
9494

9595
_On Linux/Mac_
9696
```shell
@@ -100,7 +100,7 @@ source venv/bin/activate
100100

101101
_On Windows_
102102
```powershell
103-
py -3.10 -m venv venv
103+
py -3.12 -m venv venv
104104
venv\Scripts\activate
105105
```
106106

@@ -144,7 +144,7 @@ Source the file to apply the environment variables. For the Windows equivalent,
144144
source local.env
145145
```
146146

147-
Make sure the PostgreSQL database server is up and running. Initialize the application database for TestGen.
147+
Make sure the PostgreSQL database server is up and running. Initialize the application database for TestGen.
148148
```shell
149149
testgen setup-system-db --yes
150150
```

deploy/docker-bake.hcl

+22-13
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,32 @@
1+
variable "TESTGEN_LABELS" {}
2+
variable "TESTGEN_BASE_LABEL" {}
13
variable "TESTGEN_VERSION" {}
2-
variable "PUBLIC_RELEASE" {
3-
default = false
4-
}
54

6-
function "docker_repo" {
7-
params = []
8-
result = PUBLIC_RELEASE ? "datakitchen/dataops-testgen" : "datakitchen/dataops-testgen-qa"
5+
target "testgen-release" {
6+
args = {
7+
TESTGEN_VERSION = "${TESTGEN_VERSION}"
8+
TESTGEN_BASE_LABEL = "${TESTGEN_BASE_LABEL}"
9+
}
10+
context = "."
11+
dockerfile = "deploy/testgen.dockerfile"
12+
platforms = ["linux/amd64", "linux/arm64"]
13+
tags = formatlist("datakitchen/dataops-testgen:%s", split(" ", TESTGEN_LABELS))
914
}
1015

11-
target "testgen" {
16+
target "testgen-qa" {
1217
args = {
1318
TESTGEN_VERSION = "${TESTGEN_VERSION}"
19+
TESTGEN_BASE_LABEL = "${TESTGEN_BASE_LABEL}"
1420
}
1521
context = "."
16-
dockerfile = "Dockerfile"
22+
dockerfile = "deploy/testgen.dockerfile"
23+
platforms = ["linux/amd64", "linux/arm64"]
24+
tags = [format("datakitchen/dataops-testgen-qa:%s", index(split(" ", TESTGEN_LABELS), 0))]
25+
}
26+
27+
target "testgen-base" {
28+
context = "."
29+
dockerfile = "deploy/testgen-base.dockerfile"
1730
platforms = ["linux/amd64", "linux/arm64"]
18-
tags = [
19-
"${docker_repo()}:v${TESTGEN_VERSION}",
20-
PUBLIC_RELEASE ? "${docker_repo()}:v${index(regex("([0-9]+.[0-9]+).[0-9]+", TESTGEN_VERSION), 0)}": "",
21-
PUBLIC_RELEASE ? "${docker_repo()}:v${index(regex("([0-9]+).[0-9]+.[0-9]+", TESTGEN_VERSION), 0)}": ""
22-
]
31+
tags = formatlist("datakitchen/dataops-testgen-base:%s", split(" ", TESTGEN_LABELS))
2332
}

deploy/install_arrow.sh

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env bash
2+
3+
export ARROW_VERSION=18.0.0
4+
export ARROW_SHA256=9c473f2c9914c59ab571761c9497cf0e5cfd3ea335f7782ccc6121f5cb99ae9b
5+
6+
export ARROW_HOME=/dk
7+
export PARQUET_HOME=/dk
8+
9+
mkdir /arrow
10+
11+
# Obtaining and expanding Arrow
12+
wget -q https://github.com/apache/arrow/archive/apache-arrow-${ARROW_VERSION}.tar.gz -O /tmp/apache-arrow.tar.gz
13+
echo "${ARROW_SHA256} *apache-arrow.tar.gz" | sha256sum /tmp/apache-arrow.tar.gz
14+
tar -xvf /tmp/apache-arrow.tar.gz -C /arrow --strip-components 1
15+
16+
pushd /arrow/cpp
17+
18+
# Configure the build using CMake
19+
cmake --preset ninja-release-python
20+
21+
# Configuring cmake for ARM only
22+
if [ "$(uname -m)" = "arm64" ] || [ "$(uname -m)" = "aarch64" ]; then
23+
cmake -DCMAKE_CXX_FLAGS="-march=armv8-a"
24+
fi
25+
26+
# Pre-fetch dependencies without building
27+
cmake --build . --target re2_ep -- -j2 || true
28+
29+
# Apply the patch to re2 after the dependencies are fetched but before the build
30+
pushd re2_ep-prefix/src/re2_ep
31+
32+
cat <<EOF | patch -p1
33+
diff --git a/util/pcre.h b/util/pcre.h
34+
--- a/util/pcre.h
35+
+++ b/util/pcre.h
36+
@@ -166,0 +166,1 @@
37+
+#include <cstdint>
38+
EOF
39+
40+
popd
41+
42+
# Finish processing dependencies after patch
43+
cmake --build . --target re2_ep -- -j2
44+
45+
# Continue with the build and install Apache Arrow
46+
cmake --build . --target install
47+
48+
popd
49+
50+
rm -rf /arrow /tmp/apache-arrow.tar.gz

deploy/install_linuxodbc.sh

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bash
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+
case $(uname -m) in
7+
x86_64) architecture="amd64" ;;
8+
arm64) architecture="arm64" ;;
9+
aarch64) architecture="arm64" ;;
10+
*) architecture="unsupported" ;;
11+
esac
12+
if [[ "unsupported" == "$architecture" ]];
13+
then
14+
echo "Alpine architecture $(uname -m) is not currently supported.";
15+
exit;
16+
fi
17+
18+
#Download the desired package(s)
19+
curl -O https://download.microsoft.com/download/7/6/d/76de322a-d860-4894-9945-f0cc5d6a45f8/msodbcsql18_18.4.1.1-1_$architecture.apk
20+
curl -O https://download.microsoft.com/download/7/6/d/76de322a-d860-4894-9945-f0cc5d6a45f8/mssql-tools18_18.4.1.1-1_$architecture.apk
21+
22+
#(Optional) Verify signature, if 'gpg' is missing install it using 'apk add gnupg':
23+
curl -O https://download.microsoft.com/download/7/6/d/76de322a-d860-4894-9945-f0cc5d6a45f8/msodbcsql18_18.4.1.1-1_$architecture.sig
24+
curl -O https://download.microsoft.com/download/7/6/d/76de322a-d860-4894-9945-f0cc5d6a45f8/mssql-tools18_18.4.1.1-1_$architecture.sig
25+
26+
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --import -
27+
gpg --verify msodbcsql18_18.4.1.1-1_$architecture.sig msodbcsql18_18.4.1.1-1_$architecture.apk
28+
gpg --verify mssql-tools18_18.4.1.1-1_$architecture.sig mssql-tools18_18.4.1.1-1_$architecture.apk
29+
30+
#Install the package(s)
31+
apk add --no-cache --non-interactive --allow-untrusted msodbcsql18_18.4.1.1-1_$architecture.apk
32+
apk add --no-cache --non-interactive --allow-untrusted mssql-tools18_18.4.1.1-1_$architecture.apk

deploy/testgen-base.dockerfile

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
FROM python:3.12.7-alpine3.20
2+
3+
ENV LANG=C.UTF-8
4+
ENV LC_ALL=C.UTF-8
5+
ENV PYTHONDONTWRITEBYTECODE=1
6+
ENV PYTHONFAULTHANDLER=1
7+
ENV ACCEPT_EULA=Y
8+
9+
RUN apk update && apk add --no-cache \
10+
gcc \
11+
g++ \
12+
bash \
13+
libffi-dev \
14+
openssl-dev \
15+
cargo \
16+
musl-dev \
17+
postgresql-dev \
18+
cmake \
19+
rust \
20+
linux-headers \
21+
libc-dev \
22+
libgcc \
23+
libstdc++ \
24+
ca-certificates \
25+
zlib-dev \
26+
bzip2-dev \
27+
xz-dev \
28+
lz4-dev \
29+
zstd-dev \
30+
snappy-dev \
31+
brotli-dev \
32+
build-base \
33+
autoconf \
34+
boost-dev \
35+
flex \
36+
libxml2-dev \
37+
libxslt-dev \
38+
libjpeg-turbo-dev \
39+
ninja \
40+
git \
41+
curl \
42+
unixodbc-dev \
43+
gpg \
44+
openssl=3.3.2-r1 \
45+
gfortran \
46+
openblas-dev
47+
48+
RUN mkdir /dk
49+
50+
COPY --chmod=775 ./deploy/install_linuxodbc.sh /tmp/dk/install_linuxodbc.sh
51+
RUN /tmp/dk/install_linuxodbc.sh
52+
53+
COPY --chmod=775 ./deploy/install_arrow.sh /tmp/dk/install_arrow.sh
54+
RUN /tmp/dk/install_arrow.sh
55+
56+
# Install TestGen's main project empty pyproject.toml to install (and cache) the dependencies first
57+
COPY ./pyproject.toml /tmp/dk/pyproject.toml
58+
RUN python3 -m pip install --prefix=/dk /tmp/dk
59+
60+
RUN apk del \
61+
gcc \
62+
g++ \
63+
bash \
64+
libffi-dev \
65+
openssl-dev \
66+
cargo \
67+
musl-dev \
68+
postgresql-dev \
69+
cmake \
70+
rust \
71+
linux-headers \
72+
libc-dev \
73+
build-base \
74+
autoconf \
75+
boost-dev \
76+
flex \
77+
ninja \
78+
curl \
79+
unixodbc-dev \
80+
gpg \
81+
ca-certificates \
82+
git

deploy/testgen.dockerfile

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
ARG TESTGEN_BASE_LABEL
2+
ARG TESTGEN_VERSION
3+
4+
FROM datakitchen/dataops-testgen-base:${TESTGEN_BASE_LABEL} as build-image
5+
6+
# Now install everything
7+
COPY . /tmp/dk/
8+
RUN python3 -m pip install --prefix=/dk /tmp/dk
9+
10+
FROM python:3.12.7-alpine3.20 AS release-image
11+
12+
RUN addgroup -S testgen && adduser -S testgen -G testgen
13+
14+
COPY --from=build-image --chown=testgen:testgen /dk/ /dk
15+
COPY --from=build-image /usr/local/lib/ /usr/local/lib
16+
COPY --from=build-image /usr/lib/ /usr/lib
17+
COPY --from=build-image /opt/microsoft/ /opt/microsoft
18+
COPY --from=build-image /etc/odbcinst.ini /etc/odbcinst.ini
19+
20+
# The OpenSSL upgrade is not carried from the build image, so we have to upgrade it again
21+
#RUN apk add --no-cache openssl=3.3.2-r1
22+
23+
ENV PYTHONPATH=/dk/lib/python3.12/site-packages
24+
ENV PATH="$PATH:/dk/bin:/opt/mssql-tools/bin/"
25+
26+
ENV TESTGEN_VERSION=${TESTGEN_VERSION}
27+
ENV TG_RELEASE_CHECK=docker
28+
ENV TESTGEN_DOCKER_HUB_REPO=datakitchen/dataops-testgen-enterprise
29+
ENV STREAMLIT_SERVER_MAX_UPLOAD_SIZE=200
30+
31+
RUN mkdir /var/lib/testgen && chown testgen:testgen /var/lib/testgen
32+
33+
USER testgen
34+
35+
WORKDIR /dk
36+
37+
ENTRYPOINT ["testgen"]
38+
CMD [ "ui", "run" ]

docs/local_development.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This document describes how to set up your local environment for TestGen develop
1010

1111
### Clone repository
1212

13-
Login to your GitHub account.
13+
Login to your GitHub account.
1414

1515
Fork the [dataops-testgen](https://github.com/DataKitchen/dataops-testgen) repository, following [GitHub's guide](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo).
1616

@@ -23,17 +23,17 @@ git clone https://github.com/YOUR-USERNAME/dataops-testgen
2323

2424
We recommend using a Python virtual environment to avoid any dependency conflicts with other applications installed on your machine. The [venv](https://docs.python.org/3/library/venv.html#creating-virtual-environments) module, which is part of the Python standard library, or other third-party tools, like [virtualenv](https://virtualenv.pypa.io/en/latest/) or [conda](https://docs.conda.io/en/latest/), can be used.
2525

26-
From the root of your local repository, create and activate a virtual environment with a TestGen-compatible version of Python (`>=3.10`). The steps may vary based on your operating system and Python installation - the [Python packaging user guide](https://packaging.python.org/en/latest/tutorials/installing-packages/) is a useful reference.
26+
From the root of your local repository, create and activate a virtual environment with a TestGen-compatible version of Python (`>=3.12`). The steps may vary based on your operating system and Python installation - the [Python packaging user guide](https://packaging.python.org/en/latest/tutorials/installing-packages/) is a useful reference.
2727

2828
_On Linux/Mac_
2929
```shell
30-
python3.10 -m venv venv
30+
python3.12 -m venv venv
3131
source venv/bin/activate
3232
```
3333

3434
_On Windows_
3535
```powershell
36-
py -3.10 -m venv venv
36+
py -3.12 -m venv venv
3737
venv\Scripts\activate
3838
```
3939

@@ -84,7 +84,7 @@ Run a PostgreSQL instance as a Docker container.
8484
docker compose -f docker-compose.local.yml up -d
8585
```
8686

87-
Initialize the application database for TestGen.
87+
Initialize the application database for TestGen.
8888
```shell
8989
testgen setup-system-db --yes
9090
```

0 commit comments

Comments
 (0)