-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add Db2 libraries to Docker build #404
Comments
From consulting this page: https://www.ibm.com/support/pages/db2-odbc-cli-driver-download-and-installation-information a proposed solution is to put a copy of the IBM® Data Server Driver for ODBC and CLI on www.hammerdb.com to be fetched using curl/wget during the build. The SQL Server and Oracle libraries can already be fetched directly from Microsoft and Oracle locations directly. The guidance at the link above says: This suggests that the file can be redistributed as described, however, these "certain conditions" do not appear to be detailed anywhere. If we cannot get a resolution to this issue, another alternative is to remove Db2 from the Docker build and/or create a Db2 only image, where the user will need to do a manual driver download only for this image. Input is requested on whether to move ahead with redistributing a copy as the licence suggests is permissible, or whether anyone knows what the "certain conditions" are and whether this would prevent moving ahead with the proposed solution. |
I have asked the question again to the Db2 Licensing folks. It's truly bizarre why IBM providse a driver package that is not 100% redistributable. In the case of HammerDB, it's like they'd expect us to unpack the driver into HammerDB and only redistribute the subset that qualifies as "royalty-free". |
As we are currently in the process of updating Docker for v4.11 this question has arisen again, so updating additional information on this topic. From here https://www.ibm.com/support/pages/download-initial-version-115-clients-and-drivers the available forms of the IBM client driver (that provide the functionality we are interested in) are:
In particular this guide https://public.dhe.ibm.com/ps/products/db2/info/vr105/pdf/en_US/DB2InstallingClients-db2ite1050.pdf This file also explains the restrictions that we were missing before: Restrictions The file redist.txt referred to does not exist, however the file odbc_REDIST.txt does with the list of the following files:
Doing a diff of the provided files and the redist files the difference is the following:
So it appears that we could take the initial list of files, remove the ones above and then be able to provide a version of the Db2 client library for download from hammerdb.com. The crucial client library file that HammerDB needs is libdb2.so.1 - and this is included in the list of redistributable files with the IBM Data Server Driver for ODBC and CLI (CLI Driver):
However trying to load db2tcl from this client in HammerDB gives us a missing symbols error from the library included with the IBM Data Server Driver for ODBC and CLI (CLI Driver)
And checking the library confirms that this is missing:
However, we do use this api in the schema delete functionality, so it is needed.
In contrast IBM Data Server Runtime Client and IBM Data Server Client do include this api and the libdb2.so.1 library is included in these clients in the tar.gz file BASE_CLIENT_11.5.4.0_linuxamd64_x86_64.tar.gz - so the library is different.
However, it does not look like IBM Data Server Runtime Client and IBM Data Server Client are redistributable. Only the IBM Data Server Driver for ODBC and CLI (CLI Driver) is redistributable but does not contain the functionality we need. So this remains unresolved, and we still cannot add the Db2 libraries to HammerDB Docker, meaning Db2 remains the only database where the user has to download and install either the IBM Data Server Runtime Client or IBM Data Server Client themselves. This will remain the case until:
Any additional authoritative answer from IBM is welcome on this topic as Db2 is the only database with this restriction and we cannot make it easier for Db2 to work 'out-of-the-box'. |
It also looks like the following libraries as well as libdb2.so.1 are needed by HammerDB and all of these are missing from the redistribution list:
|
We have tested a build with the 2 lists above of the redistributable files and the additional libraries, and this works OK for Db2 tests. Awaiting any response to advise if (or not) such a build can be used for our Docker builds so Db2 can work out-of-the-box. |
I did some digging into the API / library issue:
So I see two options here:
|
On the redistribution front, it seems like repackaging is still the expectation. Since the PDF you reference is for Db2 10.5 which is out of support, I dug around in our docs, and found similar wording in our current version (11.5), which does permit redistribution. While it doesn't explicitly reference it, it's safe to assume that redistribution must follow the rules in odbc_REDIST.txt in the tarball. https://www.ibm.com/docs/en/db2/11.5?topic=overviews-data-server-clients Installation is to simply extract the tarball: Download link: |
Many thanks @memmertoIBM for taking the time to look into this for us. That is really appreciated and it looks like we now have a path forward. So it is clear that we can redistribute the "IBM Data Server Driver for ODBC and CLI (CLI Driver)" for our Docker build if it is made up of only the files in odbc_REDIST.txt. Our plan would be to build this tar.gz and pull it from hammerdb.com when building a Docker image so then Db2 would work out-of-the-box. However, for now the sqlefrce_api issues looks like a problem, we found we needed this before doing a drop, otherwise the drop would hang so the drop without it wouldn't work and we have the delete option in all the databases and all the example scripts. Therefore, it looks like the best option is to wait for Db2 v12 (which it looks like is due in November?) to check if "IBM Data Server Driver for ODBC and CLI (CLI Driver)" then contains the sqlefrce_api. If it doesn't, we may then have to then do a special build for Docker of the Db2 interface, where the schema delete functionality is replaced by a message to say it is not available with the "IBM Data Server Driver for ODBC and CLI (CLI Driver)" - although as the Docker build pulls the regular HammerDB binary we will need to work out how to distinguish between the separate builds. |
I can temporarily remove the call to If all connections are dropped prior to dropping the schema, the force is a no-op anyway. |
That could be the best solution then. If db2tcl can compile against the odbc_REDIST.txt list as well as it includes the header files then that would make things a lot easier going forward. |
Libraries for all databases apart from Db2 can be automatically included in the Docker build.
Currently, Db2 libraries need to be manually added to the odbc_cli directory. This issue is a placeholder to find a solution to including the Db2 libraries automatically in the Dockerbuild by either finding a suitable location from where they can be officially downloaded as per the other libraries or to include them with the correct permissions from IBM as redistributable in the odbc_cli directory.
The text was updated successfully, but these errors were encountered: