eclipse-ankaios / ankaios

Eclipse Ankaios provides workload and container orchestration for automotive High Performance Computing (HPC) software.
https://eclipse-ankaios.github.io/ankaios/
Apache License 2.0
60 stars 22 forks source link

Mkdocs social media plugin in relation with google fonts breaks doc builds #220

Closed inf17101 closed 6 months ago

inf17101 commented 6 months ago

The social plugin of mkdocs (defined inside the mkdocs.yml) downloads google fonts on the fly when building the documentation.

The issue can only be reproduced if you delete your local .cache folder inside the ankaios repository because the social plugin would cache and safe some files there. So, if you have an older .cache content including the roboto font from the last weeks, then the build would still work. To simulate CI / CD pipeline behavior make sure to delete the folder before building the doc.

It fails with a "bad zip" error: image

After analyzing the code, it seems when downloading the Roboto.zip (google font) in a programmatic way (curl, the python code itself from the plugin) the file content contains just some javascript but not the zip file content of the font. However, when downloading it via the browser manually on the google fonts page, it works and can be extracted as a zip file.

This is the code the plugin uses: /usr/local/lib/python3.11/dist-packages/material/plugins/social/plugin.py

image

When inserting a print to output the "name" argument it outputs "Roboto" as the font and downloads it. When inserting the few lines of code into a python interpreter session the file does indeed contain not a valid zip content.

However, it doesn't matter if it is a temporary failure on google serves or what else, we shall not rely on a google font external resource that can break builds.

Suggestions:

I have opened a test PR with a simple change: https://github.com/eclipse-ankaios/ankaios/actions/runs/8469434225/job/23204768790?pr=221 (the pipeline has failed with "bad zip" error.

If we comment out social plugin it builds successfully.

Current Behavior

The Documentation build fails because of google font download issue. See test PR: #221

Expected Behavior

The Documentation shall build successfully.

Context (Environment)

Github Actions Local builds within the devcontainer

Final result

To be filled by the one closing the issue.

windsource commented 6 months ago

This is a known problem and has been fixed in MkDocs Material 9.5.16 so we just need to create a new dev container.