Skip to content

gha: refresh AppArmor settings for mysql in gha #1112

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

Conversation

tarilabs
Copy link
Member

@tarilabs tarilabs commented May 14, 2025

Description

we introduced AppArmor setting as part of:

To move to a later version of MySQL 8.0.x supporting also ARM.

We are currently using MySQL 8.3.0.

Also, application of AppArmor seems to fail for ubuntu-24.04, example:

Run set -x
  set -x
  sudo apt-get install apparmor-profiles
  sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
  shell: /usr/bin/bash -e {0}
  env:
    FORCE_COLOR: 1
    IMG_REGISTRY: ghcr.io
    IMG_ORG: kubeflow
    IMG_REPO: model-registry
    pythonLocation: /opt/hostedtoolcache/Python/3.9.[2](https://github.com/kubeflow/model-registry/actions/runs/15023419628/job/42218090795?pr=1111#step:13:2)2/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/[3](https://github.com/kubeflow/model-registry/actions/runs/15023419628/job/42218090795?pr=1111#step:13:3).9.22/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.22/x6[4](https://github.com/kubeflow/model-registry/actions/runs/15023419628/job/42218090795?pr=1111#step:13:4)
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.22/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.22/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.22/x64/lib
    VIRTUALENV_PIP: 23.3.2
+ sudo apt-get install apparmor-profiles
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  apparmor-profiles
0 upgraded, 1 newly installed, 0 to remove and 21 not upgraded.
Need to get 39.6 kB of archives.
After this operation, 373 kB of additional disk space will be used.
Get:1 file:/etc/apt/apt-mirrors.txt Mirrorlist [144 B]
Ign:2 http://azure.archive.ubuntu.com/ubuntu noble-updates/main amd64 apparmor-profiles all 4.0.1really4.0.1-0ubuntu0.24.04.3
Ign:2 https://archive.ubuntu.com/ubuntu noble-updates/main amd64 apparmor-profiles all 4.0.1really4.0.1-0ubuntu0.24.04.3
Err:2 https://security.ubuntu.com/ubuntu noble-updates/main amd64 apparmor-profiles all 4.0.1really4.0.1-0ubuntu0.24.04.3
  404  Not Found [IP: [5](https://github.com/kubeflow/model-registry/actions/runs/15023419628/job/42218090795?pr=1111#step:13:5)2.147.219.192 80]
E: Failed to fetch https://security.ubuntu.com/ubuntu/pool/main/a/apparmor/apparmor-profiles_4.0.1really4.0.1-0ubuntu0.24.04.3_all.deb  404  Not Found [IP: 52.14[7](https://github.com/kubeflow/model-registry/actions/runs/15023419628/job/42218090795?pr=1111#step:13:7).219.192 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

in Remove AppArmor profile for mysql in KinD on GHA step.

Seems the AppArmor setting is:

based on historic GHA runs on main.

The proposed changes just skip apt-install of the AppArmor profile, as in later GitHub runner image, they seems to be installed already out-of-the-box, thus avoiding the difference in the mirroring issue above.

How Has This Been Tested?

since the original failure of MySQL happened in GHA, this can only be tested on GHA.

Merge criteria:

  • All the commits have been signed-off (To pass the DCO check)
  • The commits have meaningful messages; the author will squash them after approval or in case of manual merges will ask to merge with squash.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work.
  • Code changes follow the kubeflow contribution guidelines.
  • For first time contributors: Please reach out to the Reviewers to ensure all tests are being run, ensuring the label ok-to-test has been added to the PR.

If you have UI changes

  • The developer has added tests or explained why testing cannot be added.
  • Included any necessary screenshots or gifs if it was a UI change.
  • Verify that UI/UX changes conform the UX guidelines for Kubeflow.

@tarilabs
Copy link
Member Author

now that's weird, the job failures ( example https://github.com/kubeflow/model-registry/actions/runs/15025633738/job/42225571023?pr=1112 ) reports on Mysql 8.0.x 🤔

@tarilabs
Copy link
Member Author

Looks like:

was merged few minutes after the agreed merge of:

leading to this inconsistency. on it.

@tarilabs
Copy link
Member Author

Unfortunately removing AppArmor exibhit the old issue in

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

for which we applied AppArmor config in

@tarilabs
Copy link
Member Author

This reverts commit e00cd80.

trying with replacing with apparmor-utils

Signed-off-by: Matteo Mortari <[email protected]>
@tarilabs tarilabs force-pushed the tarilabs-20250514-removeAppArmor branch from ce10abb to 5f84ce8 Compare May 14, 2025 17:08
@google-oss-prow google-oss-prow bot added size/M and removed size/S labels May 14, 2025
@tarilabs tarilabs force-pushed the tarilabs-20250514-removeAppArmor branch from 45316c8 to 7eb0455 Compare May 14, 2025 19:21
tarilabs added 2 commits May 14, 2025 21:21
This reverts commit 7eb0455.

Signed-off-by: Matteo Mortari <[email protected]>
@google-oss-prow google-oss-prow bot added size/XS and removed size/M labels May 14, 2025
This reverts commit 6c1a4c8.

This is taken care in separate PR:
kubeflow#1113

Signed-off-by: Matteo Mortari <[email protected]>
Copy link
Member

@pboyd pboyd left a comment

Choose a reason for hiding this comment

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

/lgtm

@tarilabs tarilabs changed the title gha: remove obsolete apparmor settings for mysql in gha gha: refresh AppArmor settings for mysql in gha May 14, 2025
@tarilabs tarilabs marked this pull request as ready for review May 14, 2025 19:50
Copy link
Member

@pboyd pboyd left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Member Author

@tarilabs tarilabs left a comment

Choose a reason for hiding this comment

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

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tarilabs

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit a098b60 into kubeflow:main May 14, 2025
21 checks passed
syntaxsdev pushed a commit to syntaxsdev/model-registry that referenced this pull request May 15, 2025
* gha: remove obsolete apparmor settings for mysql in gha

Signed-off-by: Matteo Mortari <[email protected]>

* align manifest between kubeflow#267 and kubeflow#703

Signed-off-by: Matteo Mortari <[email protected]>

* Revert removal (keep AppArmor) and change script

This reverts commit e00cd80.

trying with replacing with apparmor-utils

Signed-off-by: Matteo Mortari <[email protected]>

* pin ubuntu runners to fetch apparmor settings correctly

Signed-off-by: Matteo Mortari <[email protected]>

* Revert "pin ubuntu runners to fetch apparmor settings correctly"

This reverts commit 769d452.

Signed-off-by: Matteo Mortari <[email protected]>

* attempt by forcing apt mirror to lookup for AppArmor

Signed-off-by: Matteo Mortari <[email protected]>

* test by removing directly the profile

Signed-off-by: Matteo Mortari <[email protected]>

* Revert "test by removing directly the profile"

This reverts commit 7eb0455.

Signed-off-by: Matteo Mortari <[email protected]>

* simply remove with apparmor_parser -R

Signed-off-by: Matteo Mortari <[email protected]>

* Revert "align manifest between kubeflow#267 and kubeflow#703"

This reverts commit 6c1a4c8.

This is taken care in separate PR:
kubeflow#1113

Signed-off-by: Matteo Mortari <[email protected]>

---------

Signed-off-by: Matteo Mortari <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants