Skip to content

Build sqlsrv for ARM architectures too #164

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

Merged
merged 2 commits into from
Mar 16, 2023

Conversation

andrewnicols
Copy link
Contributor

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]:

  • msodbcsql17 supports SQL Server 2012 and up
  • msodbcsql18 18.0 supports SQL Server 2014 and up
  • msodbcsql18 18.1 supports SQL Server 2014 and up

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
Copy link
Contributor Author

Note: This PR is based upon #163.

This change makes it much faster to make smaller changes to the image
by:
- moving the ADD commands to more targeted additions in order of build
  size
- breaking out the Oracle and sqlsrv builds into their own ADD and RUN
  sections in the Dockerfile
- moving the addition of non build-related files to right at the end of
  the Dockerfile

These changes mean that it is possible to more easily developer the
image, for example:
- you can now make changes to files within the /usr directory without
  recompiling all PHP extensions
- you can now iterate on the Oracle and/or sqlsrv extensions without
  recompiling all PHP extensinos
- you can now iterate on the sqlsrv extension, without recompiling all
  PHP extensions

Whist this has little effect on the end image, or the build process
within CI systems, local development is substantially improved (unless
you're making changes to the php-extensions.sh script).
@stronk7
Copy link
Member

stronk7 commented Mar 16, 2023

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 stronk7 merged commit 50f9dd3 into moodlehq:master Mar 16, 2023
@stronk7
Copy link
Member

stronk7 commented Mar 16, 2023

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

@stronk7
Copy link
Member

stronk7 commented Mar 16, 2023

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
Copy link
Member

stronk7 commented Mar 16, 2023

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
Copy link
Member

stronk7 commented Mar 16, 2023

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
Copy link
Contributor Author

andrewnicols commented Mar 16, 2023 via email

@andrewnicols
Copy link
Contributor Author

andrewnicols commented Mar 16, 2023 via email

@scara
Copy link
Contributor

scara commented Mar 17, 2023

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

HTH,
Matteo

@andrewnicols
Copy link
Contributor Author

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
Copy link
Member

stronk7 commented Mar 17, 2023

I've created moodlehq/moodle-docker#253 @ moodle-docker. Will prepare something there soon.

@stronk7
Copy link
Member

stronk7 commented Mar 17, 2023

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

stronk7 added a commit to stronk7/moodle-php-apache that referenced this pull request Mar 17, 2023
stronk7 added a commit to stronk7/moodle-php-apache that referenced this pull request Mar 17, 2023
This reverts commit 50f9dd3, reversing
changes made to b532e39.

Part of moodlehq#168, this reverts moodlehq#164
stronk7 added a commit to stronk7/moodle-php-apache that referenced this pull request Mar 17, 2023
stronk7 added a commit to stronk7/moodle-php-apache that referenced this pull request Mar 17, 2023
@stronk7
Copy link
Member

stronk7 commented Mar 17, 2023

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

  • master (latest)
  • 8.2 (8.2-bullseye)
  • 8.1 (8.1-bullseye)
  • 8.0 (8.0-bullseye)

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

  • 8.2-buster
  • 8.1-buster
  • 8.0-buster

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

Ciao :-)

stronk7 added a commit to stronk7/moodle-php-apache that referenced this pull request Mar 17, 2023
This reverts commit 50f9dd3, reversing
changes made to b532e39.

Part of moodlehq#168, this reverts moodlehq#164
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants