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

CI: Introduce goyacc and other required tools into cmd/loki/Dockerfile #5323

Closed
wants to merge 4 commits into from

Conversation

SasSwart
Copy link
Contributor

@SasSwart SasSwart commented Feb 4, 2022

What this PR does / why we need it:
cmd/loki/Dockerfile currently uses golang:1.17.2
The latter does not contain the goyacc command.
This means that the Dockerfile's entrypoint will fail if any yacc files need to be regenerated.
Example: https://drone.grafana.net/grafana/loki/8367/3/3

cmd/loki/Dockerfile.debug, however, uses grafana/loki-build-image instead of golang:1.17.2.
grafana/loki-build-image is based on golang:1.17.6, but with goyacc and other tools added.

Rather than add those tools to cmd/loki/Dockerfile, causing duplication, I'd like to change the Dockerfile to use loki-build-image instead.
Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Checklist

  • Documentation added
  • Tests updated
  • Add an entry in the CHANGELOG.md about the changes.

@SasSwart SasSwart requested a review from a team as a code owner February 4, 2022 20:23
@SasSwart SasSwart changed the title Use loki-build-image to build loki instead of golang image CI: Use loki-build-image to build loki instead of golang image Feb 4, 2022
@SasSwart
Copy link
Contributor Author

SasSwart commented Feb 4, 2022

loki-build-image doesn't seem to support arm or arm64.
Going to see if I can make that happen.
If not, I'll go back to using the golang image but adding goyacc, etc to the image

@SasSwart
Copy link
Contributor Author

SasSwart commented Feb 4, 2022

From what I can gather, I may be able to build loki-build-image on arm and arm64 using QEMU, but I won't be able to push it anywhere that CI will be able to use it. I'm going to need some guidance.

Would you prefer that I send a feature request for multi architecture support for loki-build-image, or duplicate the go toolset in the cmd/loki/Dockerfile* images?

This is currently blocking my other PR: #5306

@pull-request-size pull-request-size bot added size/S and removed size/XS labels Feb 5, 2022
@SasSwart SasSwart changed the title CI: Use loki-build-image to build loki instead of golang image CI: Introduce goyacc and other required tools into cmd/loki/Dockerfile Feb 5, 2022
@SasSwart SasSwart marked this pull request as draft February 5, 2022 05:35
@SasSwart SasSwart marked this pull request as ready for review February 8, 2022 06:28
# because these dependencies are required by the Makefile in certain
# circumstances. This should be removed and the base image above changed
# from golang to loki-build-image once the latter becomes available for arm.
RUN GO111MODULE=on go install \
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess you want to add this to the build-image not the actual Loki image no ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you're referring to the loki-build-image, its already part of that.

The reason that I want to add it here, is because make BUILD_IN_CONTAINER=false loki below in this same file uses it. And given that BUILD_IN_CONTAINER=false here, goyacc is not found.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As shown here:

loki/Makefile

Line 317 in da9b4c9

goyacc -p $(basename $(notdir $<)) -o $@ $<

goyacc is used directly because of BUILD_IN_CONTAINER=false

@SasSwart
Copy link
Contributor Author

SasSwart commented Feb 13, 2022

@cyriltovena, according to @owen-d, y'all don't actually want to build these files in CI:
#5306 (comment)

@SasSwart SasSwart closed this Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants