Skip to content

Add cleanup script to base images #7687

Merged
romoh merged 7 commits intomainfrom
user/romoh/fix-srv
Feb 7, 2024
Merged

Add cleanup script to base images #7687
romoh merged 7 commits intomainfrom
user/romoh/fix-srv

Conversation

@romoh
Copy link
Copy Markdown
Contributor

@romoh romoh commented Feb 5, 2024

Remove /srv linking that is created by the toolchain & filesystems package. Toolkit and filesystem package unnecessarily symlink /var/srv & /srv which interferes with other scenarios. This will be fixed in Mariner 3.0, this PR is a mitigation for 2.0 images.

More details:

ln -svfn var/srv %{buildroot}/srv
srv symlink created by the toolkit https://github.com/microsoft/CBL-Mariner/blob/4e4223205fdd0154713821430f2224290ff94a74/toolkit/scripts/toolchain/container/toolchain_initial_chroot_setup.sh#L41
The symlink is also created by https://github.com/microsoft/CBL-Mariner/blob/4e4223205fdd0154713821430f2224290ff94a74/SPECS/filesystem/filesystem.spec#L63

On any mariner image, the symlink is left behind which is interfering with scenarios where customers want to mount a volume over /srv

PR also adds cleanup for any logs that may be left after the build process is completed.

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • The toolchain has been rebuilt successfully (or no changes were made to it)
  • The toolchain/worker package manifests are up-to-date
  • Any updated packages successfully build (or no packages were changed)
  • Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
  • Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
  • All package sources are available
  • cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
  • LICENSE-MAP files are up-to-date (./SPECS/LICENSES-AND-NOTICES/data/licenses.json, ./SPECS/LICENSES-AND-NOTICES/LICENSES-MAP.md, ./SPECS/LICENSES-AND-NOTICES/LICENSE-EXCEPTIONS.PHOTON)
  • All source files have up-to-date hashes in the *.signatures.json files
  • sudo make go-tidy-all and sudo make go-test-coverage pass
  • Documentation has been updated to match any changes to the build system
  • Ready to merge

Summary

What does the PR accomplish, why was it needed?

Does this affect the toolchain?

NO

Test Methodology

Built locally and validated.

romoh added 2 commits February 5, 2024 14:03
Signed-off-by: Roaa Sakr <romoh@microsoft.com>
Signed-off-by: Roaa Sakr <romoh@microsoft.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added the main PR Destined for main label Feb 5, 2024
romoh added 2 commits February 5, 2024 17:53
Signed-off-by: Roaa Sakr <romoh@microsoft.com>
Signed-off-by: Roaa Sakr <romoh@microsoft.com>
@romoh romoh marked this pull request as ready for review February 6, 2024 18:23
@romoh romoh requested a review from a team as a code owner February 6, 2024 18:23
Comment thread toolkit/imageconfigs/scripts/cleanup.sh
Comment thread toolkit/imageconfigs/scripts/cleanup.sh
vinceaperri
vinceaperri previously approved these changes Feb 6, 2024
Comment thread toolkit/imageconfigs/scripts/cleanup.sh
@vinceaperri vinceaperri dismissed their stale review February 6, 2024 18:27

just comment

Comment thread toolkit/imageconfigs/scripts/cleanup.sh
Signed-off-by: Roaa Sakr <romoh@microsoft.com>
@romoh romoh requested review from neha170 and vinceaperri February 6, 2024 18:43
romoh added 2 commits February 6, 2024 10:48
Signed-off-by: Roaa Sakr <romoh@microsoft.com>
Signed-off-by: Roaa Sakr <romoh@microsoft.com>
@cwize1
Copy link
Copy Markdown
Contributor

cwize1 commented Feb 6, 2024

The '/srv' -> '/var/srv' symlink is created by the filesystem package, not the toolchain.

Comment thread toolkit/imageconfigs/scripts/cleanup.sh
Comment thread toolkit/imageconfigs/scripts/cleanup.sh
@romoh
Copy link
Copy Markdown
Contributor Author

romoh commented Feb 6, 2024

The '/srv' -> '/var/srv' symlink is created by the filesystem package, not the toolchain.

It is created by both.

@romoh romoh requested a review from cwize1 February 6, 2024 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

main PR Destined for main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants