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

Source binaries for linux artifacts from docker images #4491

Merged
merged 5 commits into from
Sep 13, 2023

Conversation

azdagron
Copy link
Member

This gives us static binaries linked against musl for our release artifacts, unifying our libc dependency for both docker and non-docker and simplifying our build tooling.

Since artifact building is now fairly complicated and really only part of the CI/CD pipeline, got rid of the Makefile target for it.

Fixes: #4346

@azdagron azdagron added this to the 1.8.0 milestone Sep 13, 2023
@azdagron azdagron force-pushed the build-artifacts-from-docker branch from c2467f9 to 33eb9b1 Compare September 13, 2023 05:45
This gives us static binaries linked against musl for our release
artifacts, unifying our libc dependency for both docker and non-docker
and simplifying our build tooling.

Since artifact building is now fairly complicated and really only part
of the CI/CD pipeline, got rid of the Makefile target for it.

Fixes: spiffe#4346

Signed-off-by: Andrew Harding <[email protected]>
@azdagron azdagron force-pushed the build-artifacts-from-docker branch from 33eb9b1 to 62586ba Compare September 13, 2023 05:55
rturner3
rturner3 previously approved these changes Sep 13, 2023
Copy link
Collaborator

@rturner3 rturner3 left a comment

Choose a reason for hiding this comment

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

Thanks for this @azdagron! No blocking feedback from me, but offered some suggestions for later cleanup/simplification.

- name: Load cached build tools
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
- name: Install regctl
uses: regclient/actions/regctl-installer@b6614f5f56245066b533343a85f4109bdc38c8cc # main
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we pin to a versioned commit? Looks like the latest version is v1.2.8. I see we are pinning to main in other places too, so not something we would need to handle in this PR.

I suspect we will also run into problems with dependabot with this dependency because it isn't generating GitHub releases. Perhaps we can create an issue in that project similar to msys2/setup-msys2#327.

Copy link
Member Author

Choose a reason for hiding this comment

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

We tried to move the regctl stuff forward at some point but ran into some breaking changes. I think this is worth exploring at another time.

OUTDIR=${OUTDIR:-"${REPODIR}/artifacts"}

TARCMD=tar
if [[ $(uname -s) == "Darwin" ]]; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Since this script is only invoked for Linux artifact builds, I think this can be removed. Otherwise if this is meant to handle macOS builds too, we should rename this file and fix the invocation in build_artifacts.sh to handle both macOS and Linux.

Copy link
Member Author

Choose a reason for hiding this comment

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

This was mostly for test convenience. As a developer it was convenient to build the linux artifacts from my box instead of spinning up yet-another-container. I'm ok removing it 🤷

Copy link
Member

Choose a reason for hiding this comment

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

I'm inclined to keep it as is to make the developer experience easier.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In that case, it makes sense to keep, but since it's just for dev purposes, I would suggest adding a comment to clarify that.

command -v regctl >/dev/null 2>&1 || { echo -e "The regctl cli is required to run this script." >&2 ; exit 1; }
command -v "${TARCMD}" >/dev/null 2>&1 || { echo -e "The ${TARCMD} command is required to run this script." >&2 ; exit 1; }

build_artifact amd64
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: just for readability, could define a supported_archs array at the top of the script and loop through it here

Copy link
Member Author

Choose a reason for hiding this comment

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

that's what the old code did and i found it less readable putting in all the looping stuff and array declaration to handle two elements :)

.github/workflows/scripts/build_linux_artifacts.sh Outdated Show resolved Hide resolved
.github/workflows/scripts/build_linux_artifacts.sh Outdated Show resolved Hide resolved
copy_binary_from_multiarch_tar "$ARCH" "spire-agent" "${STAGING}/bin"
copy_binary_from_multiarch_tar "$ARCH" "oidc-discovery-provider" "${EXTRAS_STAGING}/bin"

mkdir -p "${OUTDIR}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: can we consolidate some of these mkdir -p commands into a single command?

rturner3
rturner3 previously approved these changes Sep 13, 2023
Signed-off-by: Andrew Harding <[email protected]>
Signed-off-by: Andrew Harding <[email protected]>
@azdagron azdagron force-pushed the build-artifacts-from-docker branch from d42dd22 to 2653584 Compare September 13, 2023 21:54
Copy link
Member

@amartinezfayo amartinezfayo left a comment

Choose a reason for hiding this comment

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

LGTM!

@rturner3 rturner3 merged commit 3ba6756 into spiffe:main Sep 13, 2023
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spire 1.6.4 and 1.7.0 releases for Linux/arm64 fail down with sqlite3 settings in config
3 participants