-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Can't run website in a container via make container-serve
due to the image absence
#49460
Comments
I am also facing the same issue. |
/triage accepted Only affects contributors, not website visitors, but we should get a fix in place; we may need to revisit how we build and publish the container image(s) |
Until we fix this, there are two workarounds you can use:
If you like helping out, SIG Docs can guide you towards working on a longer term fix. The best place to offer help is the |
Got the link to the failing prow job on the 15th Jan https://prow.k8s.io/view/gs/kubernetes-ci-logs/logs/post-website-push-image-k8s-website-hugo/1879257326494420992 A cursory glance makes me think that the issue might have something to do with npm and package.json but I will need to look into it more. EDIT: Maybe its related to ed1cc81 |
We should check that the container build works for AArch64 (ideally: we also add some CI checks to reject PRs that break image builds) I think it builds fine for AMD64, but maybe only for AMD64. In the cloud we build a multiarch image. |
#49529 is an attempt to debug the issue. |
I (still) suspect that a local AArch64 build would also fail. |
Yeah. I see: #24 84.50 npm error npm error ld-linux-aarch64.so.1: /root/.npm/_cacache/tmp/git-cloneXXXXXXMFelHl/node_modules/hugo-extended/vendor/hugo: Not a valid dynamic program
#24 84.50 npm error npm error ✖ Hugo installation failed. :(
#24 84.50 npm error npm error node:internal/errors:984
#24 84.50 npm error npm error const err = new Error(message); Looks like an issue with NPM rather than the infrastructure. Possible the alpine image no longer have this lib for |
I was able to reproduce this locally when building a multi-arch build. So, I did some testing and found that this issue is not AArch64 related rather it's Alpine+AArch64 related. The issue is that the hugo-extended binary just doesn't run on Alpine + AArm64. It's not the Thing is, onlyh the
I think alpine is missing something critical since hugo-extended is dynamically linked. On a side note, existing images built for AArch64 won't work on it as the Dockerfile downloads the amd64 binary only (see https://github.com/kubernetes/contributor-site/blob/148e2934d70ecc89ab2a770407defb973dbab8d4/Dockerfile#L27) EDIT: Welp, I found this issue gohugoio/hugo#10839 and the "solutions" don't work either, the solutions being adding the |
That's a link to a different Git repository; did you mean to link there @SayakMukhopadhyay ? |
If we can avoid NPM wanting to download Hugo, that'll help. But not a small fix. |
I did mean to point to the contrib site Dockerfile as thats the one I was testing the npm install on (since its smaller and faster). But now I see that the website uses Go as a base image and builds Hugo from source. Let me test as building might be the best option. |
I did some further digging and have a few observations and potential solutions. An important point to note is that To verify this, I tried installing the deps using yarn v1 and yarn installs the deps without any problems. Do note that I have also checked this with the the latest Yarn but using the latest Yarn is a bit involved. Thus, imo, the issue is with how npm resolves git dependencies. I can see the following options to solve this:
My personal preference is to go with Hugo Modules as that seems to be the recommendation by Hugo too (see https://gohugo.io/hugo-modules/use-modules/). Moreover, yarn does a lot of things very different from npm (for eg. |
Let's do whatever's simpler. However, you might find Hugo Modules harder than you think @SayakMukhopadhyay - we already have a No objection to using |
Thing is, AFAIK, to use Yarn within the container, we need to move away from using npm to yarn for the project itself. Yarn uses a different lock file which needs to be committed. Moreover, this also entails having corepack installed and modifying the package.json to depend on yarn everywhere (see the Backstage project as an example, it uses Yarn and corepack, see https://github.com/backstage/backstage/blob/master/package.json#L139 and https://backstage.io/docs/getting-started/#prerequisites). It can be done, but it's important to note that the change will not be container specific and result in the project needing yarn to get started in all environments. |
@sftim I'm trying to build the image locally and run it on macOS ARM64 I face the following issue: |
@biswajeet0192 I believe you - but you didn't ask a question. |
Ok @sftim I didn't initially get what you meant by this but now I understand. Even |
It seems that the issue of Kubernetes documentation maintenance in general needs to be discussed extensively by the SIG Docs 🤔 to develop a strategy for further action to improve the overall state of maintenance of the entire project. |
@sftim I have attached a reference for my error. And by performing the above steps mentioned by you to run the repo locally, issue doesn't got resolved. So I posted this to ask regarding if there is another way to resolve it on macOS with ARM64 processor. |
@biswajeet0192 GitHub issues are not really the best place to ask for advice, even about work-arounds. However, you could look at https://github.com/kubernetes/website/?tab=readme-ov-file#using-this-repository and follow the advice there for running locally without a container. |
@sftim In my mac, it is |
Until this issue is fixed, you will need to build your image using |
@sftim - IMHO the simplest solution is to use the I've been down this path and explored the options, and the simplest is to keep using the tools we have now and change the Docsy dependency so that |
OK, sure - let's do it that way. |
@chalin Just to confirm, do you mean |
Right, the v0.6.x branch 👍🏻 sorry for the confusion. |
Alright, I will raise a PR to do that and will do the same for the 0.7.2 upgrade. But, since its a workaround, I have started a discussion over at npm hoping to get some thoughts on this. |
/reopen This is not yet fixed. |
Let's hope this time's the charm. |
Also see #49625 |
All good (amd64/Linux) |
This is a Bug Report
Problem:
Running
make container-serve
inkubernetes/website:main
(to run the website locally in a container) leads to an error:It happens on Linux/amd64. This behaviour is confirmed by a few people.
Proposed Solution:
Following the #49444 discussion, it should be fixed not by prior executing
make container-image
(to build images locally), but by the availability of Hugo images that can be pulled from GCR instead. As @sftim noted in Slack, they might be absent due to a recent Docsy upgrade. We need to have them back.The text was updated successfully, but these errors were encountered: