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

[58431] Restore images in all-in-one docker container #16973

Conversation

cbliard
Copy link
Member

@cbliard cbliard commented Oct 16, 2024

Ticket

https://community.openproject.org/wp/58431

What are you trying to accomplish?

Restore asset images on docker all-in-one container.
We can't do much for docker images existing having already this issue (from openproject/openproject:14.5.0 to 14.6.1).

Screenshots

Images missing:
image

What approach did you choose and why?

Images are precompiled and when they are served, there is a translation from the image name to its actual path. For instance asset_path("logo_openproject_white_big.png") =>
assets/logo_openproject_white_big-2c6d79fa03613154cf6bd67c622dbae5b93ed3199e0e7332d96b6f8ec21f85a1.png.

Translation is done with the public/assets/.sprockets-manifest-*.json file which tracks the mapping between the asset file name and its actual path.

To build the docker images for all architectures, the assets are precompiled once for all architectures, uploaded as a GitHub artifact, and then downloaded for each architecture when building the images.

The files are uploaded with the actions/upload-artifact action, but hidden files are excluded by default since v4.4. That's why the file is missing and the images from sprockets pipeline are not correctly served.

This PR restores the images by explicitly adding public/assets/.sprockets-manifest-*.json to the assets files artifact.

This issue does not affect flavor builds because the assets are compiled during the docker build (no upload/download excluding hidden files)

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

https://community.openproject.org/wp/58431

Images are precompiled and when they are served, there is a translation
from the image name to its actual path. For instance
`asset_path("logo_openproject_white_big.png")` =>
`assets/logo_openproject_white_big-2c6d79fa03613154cf6bd67c622dbae5b93ed3199e0e7332d96b6f8ec21f85a1.png`.

Translation is done with the `public/assets/.sprockets-manifest-*.json`
file which tracks the mapping between the asset file name and its actual
path.

To build the docker images for all architectures, the assets are
precompiled once for all architectures, uploaded as a GitHub artifact,
and then downloaded for each architecture when building the images.

The files are uploaded with the `actions/upload-artifact` action, but
hidden files are excluded by default since v4.4. That's why the file is
missing and the images from sprockets pipeline are not correctly served.

This commit restores the images by explicitly adding
`public/assets/.sprockets-manifest-*.json` to the assets files artifact.
@cbliard cbliard force-pushed the bugfix/58431-some-images-are-missing-when-running-openproject-all-in-one-container branch from f9ce83d to f437a9c Compare October 16, 2024 12:55
@cbliard cbliard merged commit f5f2550 into release/14.6 Oct 16, 2024
7 checks passed
@cbliard cbliard deleted the bugfix/58431-some-images-are-missing-when-running-openproject-all-in-one-container branch October 16, 2024 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants