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

Build loki-build-image for multiple architectures. #11130

Merged
merged 53 commits into from
Nov 6, 2023

Conversation

jeschkies
Copy link
Contributor

@jeschkies jeschkies commented Nov 3, 2023

What this PR does / why we need it:
The current loki-build-image is for amd64 only. However, many are developing Loki on Apple Silicon. That's why we should publish build images for arm64 as well.

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • CHANGELOG.md updated
    • If the change is worth mentioning in the release notes, add add-to-release-notes label
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • For Helm chart changes bump the Helm chart version in production/helm/loki/Chart.yaml and update production/helm/loki/CHANGELOG.md and production/helm/loki/README.md. Example PR
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@jeschkies jeschkies enabled auto-merge (squash) November 3, 2023 19:38
Copy link
Contributor

@kavirajk kavirajk left a comment

Choose a reason for hiding this comment

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

Overall looks good 👍 left few comments.

Also I think we need make sure this change reflects on two of our docs pages.

  1. Building loki-build-image
  2. Patching Go version on loki-build-image (when we need to patch release)

COPY --from=helm /usr/bin/helm /usr/bin/helm
COPY --from=helm /go/bin/helm-docs /usr/bin/helm-docs
COPY --from=helm /usr/local/bin/helm /usr/bin/helm
COPY --from=helm /usr/local/bin/helm-docs /usr/bin/helm-docs
Copy link
Contributor

Choose a reason for hiding this comment

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

why we need this change? curious how was it working before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See line 13 and 16. I had to download the proper release. I guess for helm-docs it could have still worked with go modules.

PUSH_OCI=img push
TAG_OCI=img tag
OCI_PLATFORMS=--platform=linux/amd64,linux/arm64
BUILD_OCI=docker buildx build $(OCI_PLATFORMS) --build-arg $(BUILD_IMAGE)
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like we are just building and not pushing now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Look at line 106. PUSH_OCI is still defined. This is just for defining variables. There's no make target here.

@jeschkies
Copy link
Contributor Author

Also I think we need make sure this change reflects on two of our docs pages.

Luckily there's no change. The CI will still publish the build image. However, I've just looked at the Go version patch docs. They are wrong.

@github-actions github-actions bot added the type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories label Nov 6, 2023
Copy link
Contributor

@kavirajk kavirajk left a comment

Choose a reason for hiding this comment

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

LGTM

@jeschkies jeschkies merged commit 3086a3b into main Nov 6, 2023
8 checks passed
@jeschkies jeschkies deleted the karsten/multi-arch-build-image branch November 6, 2023 09:12
ashwanthgoli pushed a commit that referenced this pull request Nov 6, 2023
**What this PR does / why we need it**:
The current `loki-build-image` is for `amd64` only. However, many are
developing Loki on Apple Silicon. That's why we should publish build
images for `arm64` as well.

**Checklist**
- [ ] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [ ] Tests updated
- [ ] `CHANGELOG.md` updated
- [ ] If the change is worth mentioning in the release notes, add
`add-to-release-notes` label
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/setup/upgrade/_index.md`
- [ ] For Helm chart changes bump the Helm chart version in
`production/helm/loki/Chart.yaml` and update
`production/helm/loki/CHANGELOG.md` and
`production/helm/loki/README.md`. [Example
PR](d10549e)
- [ ] If the change is deprecating or removing a configuration option,
update the `deprecated-config.yaml` and `deleted-config.yaml` files
respectively in the `tools/deprecated-config-checker` directory.
[Example
PR](0d4416a)
trevorwhitney added a commit that referenced this pull request Nov 8, 2023
**What this PR does / why we need it**:

The changes in #11130 broke `make
build-image` and `make build-image-push`. This defaults the target arch
added in #11130 so those make targets still work.
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
**What this PR does / why we need it**:
The current `loki-build-image` is for `amd64` only. However, many are
developing Loki on Apple Silicon. That's why we should publish build
images for `arm64` as well.

**Checklist**
- [ ] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [ ] Tests updated
- [ ] `CHANGELOG.md` updated
- [ ] If the change is worth mentioning in the release notes, add
`add-to-release-notes` label
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/setup/upgrade/_index.md`
- [ ] For Helm chart changes bump the Helm chart version in
`production/helm/loki/Chart.yaml` and update
`production/helm/loki/CHANGELOG.md` and
`production/helm/loki/README.md`. [Example
PR](grafana@d10549e)
- [ ] If the change is deprecating or removing a configuration option,
update the `deprecated-config.yaml` and `deleted-config.yaml` files
respectively in the `tools/deprecated-config-checker` directory.
[Example
PR](grafana@0d4416a)
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
**What this PR does / why we need it**:

The changes in grafana#11130 broke `make
build-image` and `make build-image-push`. This defaults the target arch
added in grafana#11130 so those make targets still work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants