Skip to content

Pin database Docker images and show digests in CI#18903

Merged
harupy merged 3 commits intomlflow:masterfrom
harupy:show-docker-image-digests
Nov 19, 2025
Merged

Pin database Docker images and show digests in CI#18903
harupy merged 3 commits intomlflow:masterfrom
harupy:show-docker-image-digests

Conversation

@harupy
Copy link
Member

@harupy harupy commented Nov 19, 2025

What changes are proposed in this pull request?

This PR addresses MSSQL schema instability caused by Docker image updates and improves CI observability:

  1. Pin all database images to specific digests to prevent automatic updates from changing schema/behavior
  2. Update MSSQL schema file with constraint names from the current image
  3. Add --digests flag to show SHA256 digests in CI logs

Background

MSSQL Docker image was recently updated from a2fbff321505 (1.61GB) to 55c3fe0f8428 (1.79GB):

REPOSITORY                       TAG       IMAGE ID       CREATED        SIZE
postgres                         latest    80c0891f5de9   11 hours ago   456MB
mcr.microsoft.com/mssql/server   latest    a2fbff321505   3 weeks ago    1.61GB 👈
mysql                            latest    f6b0ca07d79d   3 weeks ago    934MB

REPOSITORY                       TAG       DIGEST                                                                    IMAGE ID       CREATED        SIZE
postgres                         latest    sha256:c1f0abd909b477d6088c72e4cd6eb01ea525344caca1b58689ae884204369502   80c0891f5de9   20 hours ago   456MB
mcr.microsoft.com/mssql/server   latest    sha256:54b23ca766287dab5f6f55162923325f07cdec6ccb42108f37c55c87e7688ebd   55c3fe0f8428   3 weeks ago    1.79GB 👈
mysql                            latest    sha256:569c4128dfa625ac2ac62cdd8af588a3a6a60a049d1a8d8f0fac95880ecdbbe5   f6b0ca07d79d   4 weeks ago    934MB

SQL Server auto-generates foreign key constraint names with hex suffixes based on internal object IDs. When the Docker image updates, these IDs change, resulting in different constraint names even though the schema structure remains identical.

Example constraint name changes:

  • FK__experimen__exper__4F7CD00DFK__experimen__exper__628FA481
  • FK__model_vers__name__5812160EFK__model_vers__name__6B24EA82

Pinned image digests

All database images are now pinned to prevent future automatic updates:

  • PostgreSQL: sha256:c1f0abd909b477d6088c72e4cd6eb01ea525344caca1b58689ae884204369502
  • MySQL: sha256:569c4128dfa625ac2ac62cdd8af588a3a6a60a049d1a8d8f0fac95880ecdbbe5
  • MSSQL: sha256:54b23ca766287dab5f6f55162923325f07cdec6ccb42108f37c55c87e7688ebd

How is this PR tested?

  • Existing unit/integration tests

The MSSQL schema file is auto-generated during CI runs. This update ensures the checked-in schema matches the pinned Docker image.

Does this PR require documentation update?

  • No. You can skip the rest of this section.

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/build: Build and test infrastructure for MLflow

How should the PR be classified in the release notes? Choose one:

  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section

Should this PR be included in the next patch release?

  • Yes (this PR will be cherry-picked and included in the next patch release)
  • No (this PR will be included in the next minor release)

🤖 Generated with Claude Code

Add --digests flag to docker images command to display SHA256 digests.
This helps track exact image versions and identify when MSSQL image
updates cause schema constraint name changes.

Also update MSSQL schema file to reflect constraint names from the
latest MSSQL Docker image (mcr.microsoft.com/mssql/server).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
@github-actions
Copy link
Contributor

@harupy Thank you for the contribution! Could you fix the following issue(s)?

⚠ Invalid PR template

This PR does not appear to have been filed using the MLflow PR template. Please copy the PR template from here and fill it out.

@harupy harupy changed the title Show Docker image digests in CI Update MSSQL schema for new Docker image and show digests in CI Nov 19, 2025
@github-actions github-actions bot added area/build Build and test infrastructure for MLflow rn/none List under Small Changes in Changelogs. labels Nov 19, 2025
@harupy harupy added the team-review Trigger a team review request label Nov 19, 2025
Copy link
Member Author

@harupy harupy Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest tag of the mssql image was updated yesterday:
https://mcr.microsoft.com/en-us/artifact/mar/mssql/server/tag/latest

image

harupy and others added 2 commits November 19, 2025 10:04
Pin mcr.microsoft.com/mssql/server to specific digest to prevent
automatic updates from changing SQL Server's auto-generated foreign
key constraint names.

Digest: sha256:54b23ca766287dab5f6f55162923325f07cdec6ccb42108f37c55c87e7688ebd
Image ID: 55c3fe0f8428 (1.79GB)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
Pin all database Docker images to specific digests for consistency:
- postgres: sha256:c1f0abd909b477d6088c72e4cd6eb01ea525344caca1b58689ae884204369502
- mysql: sha256:569c4128dfa625ac2ac62cdd8af588a3a6a60a049d1a8d8f0fac95880ecdbbe5

This prevents automatic updates from introducing unexpected schema
or behavior changes across all database backends.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
@harupy harupy changed the title Update MSSQL schema for new Docker image and show digests in CI Pin database Docker images and show digests in CI Nov 19, 2025

mssql:
image: mcr.microsoft.com/mssql/server
image: mcr.microsoft.com/mssql/server@sha256:54b23ca766287dab5f6f55162923325f07cdec6ccb42108f37c55c87e7688ebd
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added digest to pin the image

Copy link
Member

@BenWilson2 BenWilson2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic solution. We should probably give proper aliases to those FKEYs some day... just so that don't have these crazy auto-generated names. This approach looks great as a workaround for now (we'll eventually need to update the images due to security reports / CVEs of older images or when MSFT takes them down I imagine)

@harupy harupy enabled auto-merge November 19, 2025 01:26
@harupy harupy added this pull request to the merge queue Nov 19, 2025
Merged via the queue into mlflow:master with commit c48fb20 Nov 19, 2025
47 of 49 checks passed
@harupy harupy deleted the show-docker-image-digests branch November 19, 2025 01:58
mprahl pushed a commit to opendatahub-io/mlflow that referenced this pull request Nov 21, 2025
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Tian-Sky-Lan pushed a commit to Tian-Sky-Lan/mlflow that referenced this pull request Nov 24, 2025
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Tian Lan <sky.blue266000@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Build and test infrastructure for MLflow rn/none List under Small Changes in Changelogs. team-review Trigger a team review request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants