moodlehq / moodle-php-apache

PHP + Apache docker images for Moodle development
61 stars 68 forks source link

Build sqlsrv for ARM architectures too #164

Closed andrewnicols closed 1 year ago

andrewnicols commented 1 year ago

The msodbcsql18 package is now available under the MS Bullseye repository, and they've added support for some new architectures.

The new Release file offers the following architecture support:

Architectures: amd64 arm64 armhf all

I'm not sure on how the driver version may affect us, but according to the (SQL version compatibility table)[https://learn.microsoft.com/en-us/sql/connect/odbc/windows/system-requirements-installation-and-driver-files?view=sql-server-ver16]:

At the same time, Moodle 3.10 dropped support for SQL Server 2012.

Moodle 3.9 only supports PHP 7.2 - PHP 7.4. Moodle 3.11 supports PHP 7.3 - 8.0 Moodle 4.00 supports PHP 7.3 - 8.0 Moodle 4.01 supports PHP 7.3 - 8.1 Moodle 4.02 supports PHP 8.0 - 8.2

I think we're safe to bump the msodbsql version to 18 for PHP 8.0 and up.

andrewnicols commented 1 year ago

Note: This PR is based upon #163.

stronk7 commented 1 year ago

Hi,

apart from the patch (will look soon, sure it's ok), I'm a little bit confused about the versions commented above.

We made SQL*Server 2017 a requirement with Moodle 3.11.0.

And Moodle 3.11.x supports php73, php74 and php80.

In the other side, the current msodbcsql18 driver seems to be 18.2.x and it seems to be available both to debian 11 (bullseye) and 10 (buster) (link to OS support).

And, finally, the (PECL) sqlsrv extension 5.11.0 has dropped compatibility with php74.

So yeah, we only can go for this to php >= 8.0

Now, looking to the patch... ciao :-)

stronk7 commented 1 year ago

Merged into master. Will backport to >= 8.0 as commented above, paying special attention to the buster (10) builds.

stronk7 commented 1 year ago

Ah, pity... there aren't arm64 odbc18 drivers for buster (10), only for bullseye (11):

So, in the buster versions, I'm going to disable the arm64 generation, only bullseye will have them.

Ciao :-)

stronk7 commented 1 year ago

Done, now all the images (>= php80) are using msodbcsql18, the bullseye (11) one have the sqlsrv available both for amd64 and arm64 and the buster (10) ones only for amd64 (as it was previously).

stronk7 commented 1 year ago

Drat,

it seems that msodbcsql18 (or the new extension) comes with "Always Encrypted" enabled by default, or "Encrypt=true" on connection... so all SQL*Server jobs are now failing because of that (we don't have proper certs in the server).

We need to find a way to disable the encryption by default or to make it accept self-signeds...

Ciao :-)

andrewnicols commented 1 year ago

https://techcommunity.microsoft.com/t5/sql-server-blog/odbc-driver-18-0-for-sql-server-released/ba-p/3169228

Client side setting so we’ll need to put it into dboptions I guess

On Fri, 17 Mar 2023 at 07:00, Eloy Lafuente @.***> wrote:

Drat,

it seems that msodbcsql18 comes with "Always Encrypted" enabled by default, so all SQL*Server jobs are now failing because of that (we don't have proper certs in the server).

We need to find a way to disable the encryption by default or to make it accept self-signeds...

Ciao :-)

— Reply to this email directly, view it on GitHub https://github.com/moodlehq/moodle-php-apache/pull/164#issuecomment-1472871477, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC2K74G6BT4F6OQLCO7LGDW4OLOZANCNFSM6AAAAAAV3G7NPI . You are receiving this because you authored the thread.Message ID: @.***>

andrewnicols commented 1 year ago

https://github.com/moodle/moodle/blob/12a81769265a4fa75232ff1639423be1565c9fa9/config-dist.php#L81

On Fri, 17 Mar 2023 at 07:00, Eloy Lafuente @.***> wrote:

Drat,

it seems that msodbcsql18 comes with "Always Encrypted" enabled by default, so all SQL*Server jobs are now failing because of that (we don't have proper certs in the server).

We need to find a way to disable the encryption by default or to make it accept self-signeds...

Ciao :-)

— Reply to this email directly, view it on GitHub https://github.com/moodlehq/moodle-php-apache/pull/164#issuecomment-1472871477, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC2K74G6BT4F6OQLCO7LGDW4OLOZANCNFSM6AAAAAAV3G7NPI . You are receiving this because you authored the thread.Message ID: @.***>

scara commented 1 year ago

Hello Everyone, at the end, based on @andrewnicols commit, https://github.com/moodlehq/moodle-ci-runner/commit/8dcbdc1ca751f48f09f0e2e594b563be2e29ee48, the same approach should be ported into https://github.com/moodlehq/moodle-docker/blob/4c4d1d58f5234bd70005bfcdbda84064cb4110d5/config.docker-template.php

HTH, Matteo

andrewnicols commented 1 year ago

Thanks @scara, yeah - that's my plan. We also have MDL-77669 and I think we may need to rever this for 8.0.

stronk7 commented 1 year ago

I've created https://github.com/moodlehq/moodle-docker/issues/253 @ moodle-docker. Will prepare something there soon.

stronk7 commented 1 year ago

And have created #168 about to revert this until the 2 detected problems are fixed.

stronk7 commented 1 year ago

For the records, I'm reverting the changes in the following moodle-php-apache images:

And I'm leaving with the ODBC 18 library and the new php-sqlsrv drivers the following images:

So we can test things with buster images while the bullseye ones (default @ CI) continue using the old / safe library and driver.

Ciao :-)