-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
How to cross-compile #327
Comments
The gulp task suffixes are use case oriented. Basically, :prod is for CI and nothing is for development. So, please do not use suffixes like 'no-frontend' or 'cross'. It would get very confusing. Cross compilation will be done only in CI so simply give the task the suffix :prod The docker tasks are currently not integrated in the build process. In general, it would be nice to build the container deploy it to the cluster and then run the integration tests. I am wondering about the cross-compilation...how do we want to test the cross-compiled containers... About gulp: I would not try to implement a loop. The number or architectures is limited. I would do the following: I would create a task for each platform like docker-build-arm, then copy & paste code to all tasks, and finally remove code duplication through refactoring. As last step I would create a dependency from docker-build:prod -> [ docker-build-arm,....]. This way all image builds are executed in parallel. |
I dont agree. There's no need to run cross compilation on CI. Theres no benefit from this. The CI can potentailly cross compile, but cannot run the cross compiled code, as it is single architecture. The cross compilation would be used when releasing new version. I.e., when calling Am I correct? |
@cheld @luxas |
First off, cross-compilation should not be run on CI. Of course, the downside is that one might introduce only-working-on-amd64 I have one idea that might work. If every (or at least some) module exported their functions, then another module This would result in some refactoring though, so I'm not sure if we should do it right now (before the initial release). What has to be done though, is rename the default image from And now in the beginning, I am sure everyone is happy if you push the BTW, I have already added |
Can you give me the bash script that would iterate over all archs and call gulp docker-image? |
#!/bin/bash
# The set of platforms to cross-compile dashboard for
KUBE_CROSS_PLATFORMS=(
"amd64"
"arm"
"arm64"
"ppc64le"
)
# The image dashboard is pushed to. The same value exists in build/conf.js
KUBE_DASHBOARD_IMAGE="gcr.io/google_containers/kubernetes-dashboard"
# Loop all platforms, build the docker image and tag them right
for arch in ${KUBE_CROSS_PLATFORMS[@]}; do
GOARCH=${arch} gulp docker-image:canary
docker tag ${KUBE_DASHBOARD_IMAGE}:canary ${KUBE_DASHBOARD_IMAGE}-${arch}:canary
docker rmi ${KUBE_DASHBOARD_IMAGE}:canary
done That will produce images for all platforms. You just have to push them after that. |
I've got the following errors when cross-compiling. Do you know what they are?
|
Thanks for pushing an If you like I can send a PR with this temporary |
I'll try to run this in the docker image next time. Maybe by base system misses some libraries. |
No need to rush on this. Let's do the proper way, i.e., fragment the build artifacts into separate directories for each arch and make gulp take care of this :) |
…t demos for the dashboard.
[Feature][Fixes kubernetes#327] Added a user guide and FAQs with short demos for the dashboard.
Now with docker based setup it's very easy to cross-compile:
This produces the image, but it's tagged as normal
amd64
ones.I tried to modify the
gulp
code, but I just don't get it working.We want a
docker-image:cross
task, that depends onbuild-frontend
anddocker-file
. Then it should call a function that builds the backend for the right arch. It's possible to refactorbackend:prod
into an exported function, but we can't call the tasksbackend:prod
is depending on (package-backend-source
andclean-dist
).So because gulp doesn't support calling tasks directly (I would like to loop arches in
docker-image:cross
and for each callbackend:prod
with an argument and then build the docker image) I have no idea how to do this ingulp
code.It gets even worse when it should handle
push-to-gcr
too.I can easily solve this with a
bash
script, though@cheld @bryk What do you think about this?
It's easily done by hand, but it's obviously better if it's in code
Example bash script:
Where the
docker-image:no-frontend
just depends onbackend:prod
. If we choose this solution, we could wrap this script in abuild-image:cross-{canary,release}
taskPS: About the naming, I suppose we're gonna have
gcr.io/google_containers/kubernetes-dashboard-ARCH:VERSION
and maybe have twoamd64
versions:kubernetes-dashboard
andkubernetes-dashboard-amd64
The text was updated successfully, but these errors were encountered: