Skip to content

Commit 08df56b

Browse files
author
Teodor Kostadinov
authored
Feature/v1.0.1 (#4)
* Updating the runtime to v5.12 * In progress * save: checkpoint * save: checkpoint * save: checkpoint * Ready for release
1 parent 93073ca commit 08df56b

File tree

11 files changed

+171
-48
lines changed

11 files changed

+171
-48
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# CHANGELOG
22

3+
## 1.0.1 (2021-11-24)
4+
5+
### Improvements
6+
7+
- [general] - Updating the ADF Runtime to v5.12.7984.1
8+
- [drivers] - Adding IBM DB2 ODBC Driver (v5.11.4)
9+
10+
311
## 1.0.0 (2021-09-21)
412

513
### Improvements

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2019
22

33
LABEL maintainer="Ingeii"
44

5-
ENV RUNTIME_DOWNLOAD_URL="https://download.microsoft.com/download/E/4/7/E4771905-1079-445B-8BF9-8A1A075D8A10/IntegrationRuntime_5.10.7918.2.msi"
5+
ENV RUNTIME_DOWNLOAD_URL="https://download.microsoft.com/download/E/4/7/E4771905-1079-445B-8BF9-8A1A075D8A10/IntegrationRuntime_5.12.7984.1.msi"
66

77
WORKDIR "C:/adf-runtime"
88

99
COPY scripts .
10+
COPY drivers ./drivers
1011

11-
RUN ["powershell", "./build.ps1", "-RuntimeDownloadUrl $env:RUNTIME_DOWNLOAD_URL"]
12-
12+
RUN ["powershell", "./install-runtime.ps1", "-RuntimeDownloadUrl $env:RUNTIME_DOWNLOAD_URL"]
13+
RUN ["powershell", "./install-drivers.ps1"]
1314
CMD ["powershell", "./entrypoint.ps1"]
1415

1516
HEALTHCHECK --start-period=120s CMD ["powershell", "./healthcheck.ps1"]

README.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
- [Solution](#solution)
2828
- [Error Code 1500](#error-code-1500)
2929
- [Solution](#solution-1)
30+
- [Error SQLSTATE IM004, SQLAllocHandle on SQL_HANDLE_ENV](#error-sqlstate-im004-sqlallochandle-on-sql_handle_env)
31+
- [Solution](#solution-2)
3032
- [Thanks](#thanks)
3133
- [Future Improvements](#future-improvements)
3234

@@ -36,13 +38,14 @@ This is a working solution on how to use Azure Data Factory Self-Hosted Integrat
3638

3739
## Version Matrix
3840

39-
| Image Version | ADF Self-Hosted Runtime Version |
40-
| -------------- | ------------------------------- |
41-
| 1.0.0 (latest) | 5.10.7918.2 |
41+
| Image Version | ADF Self-Hosted Runtime Version | Bundled Drivers |
42+
| -------------- | ------------------------------- | -------------------------- |
43+
| 1.0.0 | 5.10.7918.2 | N/A |
44+
| 1.0.1 (latest) | 5.12.7984.1 | IBM DB2 ODBC Driver 5.11.4 |
4245

4346
## Docker Hub
4447

45-
You can find a pre-built vesion of the image in our Docker Hub account:
48+
You can find a pre-built version of the image in our Docker Hub account:
4649

4750
[Ingenii Solutions](https://hub.docker.com/r/ingeniisolutions/adf-self-hosted-integration-runtime/tags)
4851

@@ -60,7 +63,7 @@ Below are the environment variables the image understands.
6063
| AUTH_KEY | No (Required) | The [ADF authentication key](https://docs.microsoft.com/en-us/azure/data-factory/create-self-hosted-integration-runtime?tabs=data-factory#create-a-self-hosted-ir-via-ui) |
6164
| NODE_NAME | `container hostname` | The name of the node that will be displayed in ADF. |
6265
| OFFLINE_NODE_AUTO_DELETION_TIME_IN_SECONDS | `601` (10 minutes) | The number of seconds that a node has to be offline to be automatically cleaned up from ADF. (it has to be the same for all nodes in the same runtime) |
63-
| ENABLE_HA | `false` | If you are planning to use multiple containers (nodes) in a single runtime, pleasae set this to true. |
66+
| ENABLE_HA | `false` | If you are planning to use multiple containers (nodes) in a single runtime, please set this to true. |
6467
| HA_PORT | `8060` | The HA port used for communication between the nodes. |
6568

6669
## Usage
@@ -150,6 +153,19 @@ Also, if you are to have more than one node, you need to set ENABLE_HA to `true`
150153

151154
You most likely have 4 registered nodes with the current runtime. Azure Data Factory supports only 4 registered nodes per integration runtime.
152155

156+
### Error SQLSTATE IM004, SQLAllocHandle on SQL_HANDLE_ENV
157+
158+
Applies to: IBM DB2 ODBC Driver Only
159+
160+
The error is generated whenever the docker image is executed with [isolation mode](https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/hyperv-container) set to `hyperv` and not `process`.
161+
This typically occurs on Windows Desktop OS as that defaults to isolated: hyperv mode and Windows Server OS defaults to isolated: process mode.
162+
163+
#### Solution
164+
165+
If you are going to be using IBM DB2 ODBC Driver, it is highly suggested to run the image inside Windows Server 2019 or above. [Isolation mode](https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/hyperv-container) should be set to `process`.
166+
167+
168+
153169
## Thanks
154170

155171
This repository was heavily inspired by what was already done [here](https://github.com/Azure/Azure-Data-Factory-Integration-Runtime-in-Windows-Container) by [@wxygeek](https://github.com/wxygeek)

docker-compose.dtp.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,20 @@ services:
88
ENABLE_HA: "true"
99
AUTH_KEY: $PRODUCTION_CONNECTION_STRING
1010
restart: always
11+
isolation: process
1112

1213
test:
1314
image: $IMAGE_REGISTRY/$IMAGE_REPOSITORY:$IMAGE_VERSION
1415
environment:
1516
ENABLE_HA: "true"
1617
AUTH_KEY: $TEST_CONNECTION_STRING
1718
restart: always
19+
isolation: process
1820

1921
dev:
2022
image: $IMAGE_REGISTRY/$IMAGE_REPOSITORY:$IMAGE_VERSION
2123
environment:
2224
ENABLE_HA: "true"
2325
AUTH_KEY: $DEV_CONNECTION_STRING
24-
restart: always
26+
restart: always
27+
isolation: process

docker-compose.single.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ services:
77
environment:
88
ENABLE_HA: "true"
99
AUTH_KEY: $PRODUCTION_CONNECTION_STRING
10-
restart: always
10+
restart: always
11+
isolation: process

drivers/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Install Additional Drivers
2+
3+
## Overview
4+
5+
Each additional driver to be installed has to be created according to the directory structure and installation mechanism.
6+
7+
## Directory Structure
8+
9+
`<vendor>`/[`vendor sub-type`]/`<driver type>`
10+
11+
Examples:
12+
13+
* `ibm`/`db2`/`odbc`
14+
* `mariadb`/`odbc`
15+
* `postgresql`/`pgsql`
16+
17+
18+
## Install Script
19+
20+
Each driver directory has an `install.ps1` script plus (if needed) additional files required for the installation. The `install.ps1` script will be called by the `install-drivers.ps1` script inside the `scripts` directory.
21+
22+
Please make sure to add all necessary steps to automate the installation of the additional driver inside the `install.ps1` script. It is also
23+
recommended to have clean-up steps to remove setup files, zip files etc. That would help to keep the image small.

drivers/ibm/db2/odbc/dsdriver.rsp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
PROD = IBM_DATA_SERVER_DRIVER
2+
LIC_AGREEMENT = ACCEPT
3+
FILE = C:\Program Files\IBM\IBM DATA SERVER DRIVER
4+
COMP = ODBC_SUPPORT
5+
COPY_NAME = IBMDBCL
6+
DB2_ODBC_DSN_TYPE = SYSTEM
7+
DB2_ODBC_DSN_ACTION = ADD

drivers/ibm/db2/odbc/install.ps1

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
function Write-Log() {
2+
Param(
3+
[string] $Message,
4+
[string] $TextColor = "White"
5+
)
6+
7+
$timeNow = Get-Date -Format "dd/MM/yyyy HH:mm:ss"
8+
9+
Write-Host "[$timeNow] $Message" -ForegroundColor $TextColor
10+
}
11+
12+
function Install-Driver {
13+
Write-Log -Message "Installing the IBM DB2 ODBC Driver..."
14+
15+
$setupFile = (Get-ChildItem -Path $PSScriptRoot | Where-Object { $_.Name -Match "setup.exe" })[0].Name
16+
$setupFilePath = Join-Path -Path $PSScriptRoot -ChildPath $setupFile
17+
18+
Write-Log -Message $setupFilePath
19+
20+
Start-Process $setupFilePath -Wait -ArgumentList "/n Default /u dsdriver.rsp" -WorkingDirectory $PSScriptRoot
21+
if (!$?) {
22+
Write-Log -Message "Installation failed."
23+
exit 1
24+
}
25+
26+
Write-Log -Message "Installaton complete."
27+
28+
# Clean up the driver directory
29+
$setupFilePath | Remove-Item -Force
30+
}
31+
32+
# Install the driver
33+
try {
34+
Install-Driver
35+
}
36+
catch {
37+
Write-Log -Message "Unable to install the driver."
38+
Write-Log -Message $_
39+
exit 1
40+
}

drivers/ibm/db2/odbc/setup.exe

69.8 MB
Binary file not shown.

scripts/install-drivers.ps1

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Param(
2+
$Workdir = $(Get-Location)
3+
)
4+
5+
Import-Module $PSScriptRoot\common.ps1
6+
7+
Write-Log -Message "Installing additional drivers.."
8+
9+
# Install vendor drivers
10+
$DriversPath = Join-Path -Path $Workdir -ChildPath "drivers"
11+
$InstallScriptName = "install.ps1"
12+
13+
$DriverInstallScripts = Get-ChildItem -Path $DriversPath -Filter $InstallScriptName -Recurse
14+
15+
# Find the install.ps1 script in each driver directory and call it.
16+
ForEach ($script in $DriverInstallScripts) {
17+
# Call the install script in the driver folder.
18+
&$script.FullName
19+
}
20+
21+
Write-Log -Message "Additional drivers installed."

0 commit comments

Comments
 (0)