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

chore(ci): build fips binary w/glibc 2.26 #1257

Merged
merged 5 commits into from
Sep 27, 2023
Merged

chore(ci): build fips binary w/glibc 2.26 #1257

merged 5 commits into from
Sep 27, 2023

Conversation

amdprophet
Copy link
Contributor

The linux/amd64 FIPS binary is currently built using GLIBC 2.28. Some supported Linux distributions use an older version of GLIBC and the binary we produce is incompatible as a result. This change updates CI to build the binary using the amazonlinux:2 container image which has GLIBC 2.26.

@amdprophet amdprophet requested a review from a team as a code owner September 22, 2023 03:04
@github-actions github-actions bot added the github_actions Pull requests that update Github_actions code label Sep 22, 2023
@sumo-drosiek
Copy link
Contributor

Could we add only Dockerfile like for other builds and add makefile target. W have makefile to be independent on the CI provider and to be able to easily run everything locally

Comment on lines 5 to 9
# Install Go
url="https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz"
echo "Downloading ${url}"
curl -Lo go.tar.gz "$url"
tar -zxvf go.tar.gz -C /usr/local
export PATH="/usr/local/go/bin:${PATH}"

# Install builder
cd otelcolbuilder || exit 1
mkdir "${HOME}/bin"
export PATH="${HOME}/bin:${PATH}"
make install-builder

Choose a reason for hiding this comment

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

These install commands seem like they'd be more at home in the Dockerfile.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't find a way of passing the Go version into the Dockerfile itself from GitHub Actions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved the Go installation steps to the Dockerfile and hardcoded the Go version for now. I was hoping to minimize the amount of places where we need to bump the Go version but it does cut down on runtimes.

I don't think it's possible to use anything except the ci/build-fips-action directory as the context when GitHub Actions builds the Docker image. I've left the builder installation in entrypoint.sh as a result.

@amdprophet
Copy link
Contributor Author

Could we add only Dockerfile like for other builds and add makefile target. W have makefile to be independent on the CI provider and to be able to easily run everything locally

I can try adding a makefile target to run this locally.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Sep 25, 2023
Co-authored-by: Dominik Rosiek <[email protected]>
@portertech portertech self-requested a review September 27, 2023 20:25

RUN yum groupinstall -y "Development Tools" && yum install -y curl git

RUN curl -Lo go.tar.gz https://go.dev/dl/go1.20.5.linux-$TARGETARCH.tar.gz
Copy link
Contributor

Choose a reason for hiding this comment

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

Not happy about the hard-coded go version here, but I understand why it is. Going to be a bit of a pain when we update go.

@@ -134,6 +134,11 @@ build-debug: ensure-correct-builder-version
@$(MAKE) generate-sources
@$(MAKE) _gobuild_debug

.PHONY: build-fips
Copy link
Contributor

Choose a reason for hiding this comment

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

I was able to successfully build locally.

Signed-off-by: Justin Kolberg <[email protected]>
@portertech
Copy link
Contributor

@portertech portertech merged commit 5934049 into main Sep 27, 2023
43 checks passed
@portertech portertech deleted the chore/glibc-2.26 branch September 27, 2023 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation github_actions Pull requests that update Github_actions code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants