harness / gitness

Gitness is an Open Source developer platform with Source Control management, Continuous Integration and Continuous Delivery.
https://gitness.com
Apache License 2.0
32.09k stars 2.8k forks source link

Build arm64 images #3394

Closed SuNNjek closed 10 months ago

SuNNjek commented 11 months ago

Right now all the Gitness images on Docker Hub are only built for amd64. It would be cool if we could get arm64 images as well so that the application can be easily deployed on other devices such as Raspberry Pis.

johannesHarness commented 11 months ago

Hey @SuNNjek, thank you for your interest in Gitness! We are working on releasing images for other architectures in the near future.

johannesHarness commented 10 months ago

Hey @SuNNjek, good news! We are now releasing Gitness images for both arm64 and amd64, starting from v3.0.0-beta.3. Head over to https://hub.docker.com/r/harness/gitness/tags to see the latest available tags.

laxtiz commented 10 months ago

Have you tested it? Gitness does cross-compiled, but the Git base image is linux/amd64 platform.

gitness: error: encountered an error while wiring the system: unable to load git version: fork/exec /usr/bin/git: exec format error, try --help

enver-bisevac commented 10 months ago

@laxtiz thanks for the feedback, we are able to reproduce the issue and will provide feedback soon.

laxtiz commented 10 months ago

the problem at latest step in Dockerfile. finally image must be target platform, should not build platform.

enver-bisevac commented 10 months ago

@laxtiz can you try image https://hub.docker.com/r/harness/gitness/tags unstable tag?

laxtiz commented 10 months ago

@enver-bisevac the unstable image is okay, I created a project, repository, and successfully ran a pipeline task.

but i have a question: If I do not specify a platform in stages, the amd64 platform is used by default.

https://github.com/harness/gitness/blob/85337b94183f36d4a79b4d3bcec3c539453a38e9/app/pipeline/triggerer/trigger.go#L273-L278

I have used gitea+drone before, and since drone supports multi-node executors, I can understand why the default platform is amd64. But with gitness being a single node executor, why not set the default platform to $GOARCH?

vistaarjuneja commented 10 months ago

@laxtiz you are correct - we will change this to use the system os and arch values by default. Although I'm curious - are you seeing any issues when you don't specify the paltform? Docker should be able to pull the right image for the clone step on its own - is it there you're facing issues or somewhere else?

laxtiz commented 10 months ago

@vistaarjuneja i mean pipeline runner platform, isn't docker image platform. You do not need to specify an image platform to obtain container images when pulled.

I am using drone on arm64 platform, if I don't specify the running platform (default amd64), drone-server will show the task as pending. But on gitness, there are no tasks, it behaves like drone-runner gets tasks from drone-server, but there are no tasks for arm64 platforms, so nothing is done

vistaarjuneja commented 10 months ago

@laxtiz we have a poller which requests builds and the trigger that you pointed out above which is submitting builds. https://github.com/harness/gitness/blob/main/app/pipeline/runner/poller.go#L54 is the filter where you can see that we don't specify an OS and an arch which means that the workers executing builds in gitness are platform agnostic. And in that scenario we should be skipping the check for the platform completely: https://github.com/harness/gitness/blob/main/app/pipeline/scheduler/queue.go#L167.

So even though we should fix the code you pointed above and just remove the setting of os/arch in the build completely (or use system os/arch) - the workers should still be able to process the builds so I'm curious where the failure is coming 🤔