Skip to content
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

refactor: adjust some cache generation and usage behaviors #888

Merged
merged 10 commits into from
Dec 12, 2024

Conversation

kamiyadm
Copy link
Collaborator

The caches that have been processed are ld.so.cache and font cache.

Code:

  • Add a new member ContainerBuilder to PackageManager. (package_manager)
  • Add a new script to gererate cache in container. (app-cache-generator)
  • Add new func generateCache() to execute app-cache-generator. (pacakge_manager)
  • Add new func removeCache() to remove cache. (package_manager)
  • Mount the cache during running application. (cli)

Mount:(host->container)

  • Remove /var/cache/fontconfig -> /var/cache/fontconfig
  • Add /usr/local/share/fonts -> /usr/local/share/fonts
  • Add /var/lib/linglong/cache/[hash] -> /run/linglong/cache
  • Add /var/lib/linglong/cache/[hash]/fontconfig -> /var/cache/fontconfig

Config:

  • Remove the hook part of config.json

Log:

@deepin-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kamiyadm
Once this PR has been reviewed and has the lgtm label, please assign black-desk for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@kamiyadm kamiyadm force-pushed the fix-20241122-1 branch 6 times, most recently from 49c0a4e to 421dda3 Compare November 30, 2024 09:11
@kamiyadm kamiyadm force-pushed the fix-20241122-1 branch 2 times, most recently from 4127698 to bb66b31 Compare December 5, 2024 06:20
The caches that have been processed are ld.so.cache and font cache.

Code:
 * Add a new member ContainerBuilder to PackageManager. (package_manager)
 * Add a new scripts to gererate cache in container. (ld-cache-generator/font-cache-generator)
 * Add new func generateCache() to execute app-cache-generator. (pacakge_manager)
 * Add new func removeCache() to remove cache. (package_manager)
 * Mount the cache during running application. (cli)

Mount:(host->container)
 * Remove /var/cache/fontconfig -> /var/cache/fontconfig
 * Add /usr/local/share/fonts -> /usr/local/share/fonts
 * Add /var/lib/linglong/cache/[hash] -> /run/linglong/cache
 * Add /var/lib/linglong/cache/[hash]/fontconfig -> /var/cache/fontconfig

Config: (config.json)
 * Remove the hooks part.
 * Change env LINGLONG_LD_SO_CACHE to /run/linglong/cache/ld.so.cache.

Log:
* In the build stage, create the cache directory in
  workdir and mount it to /run/linglong/cache. Then
  generate ld.so.cache in the hook.
* In the run stage, mount the cache dirctory and generate
  both the ld.so.cache and font cache.

Log:
@kamiyadm kamiyadm force-pushed the fix-20241122-1 branch 2 times, most recently from 61024e9 to 7a872f0 Compare December 12, 2024 07:34
libs/linglong/src/linglong/cli/cli.cpp Outdated Show resolved Hide resolved
libs/linglong/src/linglong/cli/cli.cpp Show resolved Hide resolved
libs/linglong/src/linglong/cli/cli.cpp Outdated Show resolved Hide resolved
libs/linglong/src/linglong/cli/cli.cpp Outdated Show resolved Hide resolved
kamiyadm and others added 5 commits December 12, 2024 15:50
* Add dbus method GenerateCache, signal GenerateCacheFinished. (PM)
* Add an exclusive write lock to the application cache in
  ensureCache to ensure that the container runs after the cache
  is generated. (cli)

Log:
If LINGLONG_SKIP_HOME_GENERATE is set, don't mount the home dir of host.

Log:
* If the XDG_DATA_DIRS is not set, the dir that used for storage
  container state will fallback to /run/ll-box. deepin-linglong
  has no permission to create dir in /run, so we should specific
  a writable path to ll-box.
* Change Container::run(Process) to Container::run(Process, RunOption),
  we need to support specific run option.

Log:
Signed-off-by: ComixHe <heyuming@deepin.org>
@ComixHe ComixHe merged commit 4c5184d into OpenAtom-Linyaps:master Dec 12, 2024
5 of 13 checks passed
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