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

Multiarch build server docker images #635

Closed
wants to merge 22 commits into from

Conversation

6543
Copy link
Member

@6543 6543 commented Dec 21, 2021

No description provided.

@6543 6543 added build CI pipeline related feature add new functionality server labels Dec 21, 2021
@6543 6543 added this to the 0.15.0 milestone Dec 21, 2021
@anbraten anbraten mentioned this pull request Jan 12, 2022
5 tasks
@6543 6543 mentioned this pull request Jan 17, 2022
2 tasks
.woodpecker/docker.yml Outdated Show resolved Hide resolved
@6543 6543 added the wip label Jan 20, 2022
@6543
Copy link
Member Author

6543 commented Jan 20, 2022

tldr: it works localy but not with CI as xgo do not store files into workspace ?!?

-> need to figure out where they get stored!!!

@6543 6543 modified the milestones: 0.15.0, 0.16.0 Jan 20, 2022
@anbraten anbraten mentioned this pull request Feb 22, 2022
3 tasks
fi

cross-compile-server: cross-compile-server-build-loop
tree dist
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, could you just run tree to see if the binaries are placed outside of the dist/ folder?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Binaries are placed in /build/

$(foreach platform,$(subst ;, ,$(PLATFORMS)),TARGETOS=$(firstword $(subst |, ,$(platform))) TARGETARCH=$(word 2,$(subst |, ,$(platform))) make release-server-xgo || exit 1;)

normalize-server-artifacts:
mv dist/server/$(TARGETOS)/$(TARGETARCH)/$(shell ls dist/server/$(TARGETOS)/$(TARGETARCH)/) dist/server/$(TARGETOS)/$(TARGETARCH)/woodpecker-server
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me it only works when I run the following here:

mv dist/server/$(TARGETOS)/$(TARGETARCH)/woodpecker-server-$(TARGETOS)-$(TARGETARCH) dist/server/$(TARGETOS)/$(TARGETARCH)/woodpecker-server

@relnod
Copy link
Contributor

relnod commented Feb 23, 2022

Hi @6543,
thanks for working on this!

tldr: it works localy but not with CI as xgo do not store files into workspace ?!?

-> need to figure out where they get stored!!!

I also can't reproduce this locally using make cross-compile-server. I can however reproduce it using the following Dockerfile:

FROM techknowlogick/xgo:go-1.17.x

WORKDIR /src
COPY . .

RUN apt update
RUN apt install -y tree
RUN PLATFORMS="linux|amd64;linux|arm64" TAGS="bindata sqlite sqlite_unlock_notify" make cross-compile-server

Edit:
I found the output from xgo. For some reason the binaries are put in /build/.

Edit2:
It seems like the /build/ directory is hardcoded in the build.sh in the xgo docker image.

Edi3:

When changing the make target normalize-server-artifacts to the following, it works!

normalize-server-artifacts:
	mv /build/woodpecker-server-$(TARGETOS)-$(TARGETARCH) dist/server/$(TARGETOS)/$(TARGETARCH)/woodpecker-server

Edit4:
After taking some weirdness from xgo into account, the normalize-server-artifacts should be the following:

normalize-server-artifacts:
       mv /build/woodpecker-server-$(TARGETOS)-$(subst arm64/v8,arm64,$(subst arm/v,arm-,$(TARGETARCH))) dist/server/$(TARGETOS)/$(TARGETARCH)/woodpecker-server

@6543
Copy link
Member Author

6543 commented Mar 1, 2022

-> #821

@6543 6543 closed this Mar 1, 2022
@6543 6543 deleted the multiarch-build-server branch March 1, 2022 15:53
@6543 6543 removed this from the 1.0.0 milestone Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build CI pipeline related feature add new functionality server wip
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants