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

Publish arm64 binaries and container images #2233

Closed
povilasv opened this issue Mar 28, 2020 · 15 comments · Fixed by #4254
Closed

Publish arm64 binaries and container images #2233

povilasv opened this issue Mar 28, 2020 · 15 comments · Fixed by #4254
Labels
feature-request help wanted inactive packaging Issues related to OPA release artifacts, pipelines etc.

Comments

@povilasv
Copy link

Expected Behavior

It would be great if it was possible to run open-policy-agent on arm64 architecture, via multi arch container images (https://docs.docker.com/engine/reference/commandline/manifest/#create-and-push-a-manifest-list)

Muliarch images show on dockerhub:

image

Those images seamlessly run on supported architectures

@patrick-east
Copy link
Contributor

This should already be supported by just specifying the GOARCH option and building OPA from source.

Ex:

$ make build GOARCH=arm64 GOOS=linux
make: '_obj/opa.wasm' is up to date.
cp wasm/_obj/opa.wasm internal/compiler/wasm/opa/opa.wasm
GO111MODULE=on GOFLAGS=-mod=vendor go generate
GO111MODULE=on GOFLAGS=-mod=vendor go build -o opa_linux_arm64 -ldflags "-X github.com/open-policy-agent/opa/version.Version=0.19.0-dev -X github.com/open-policy-agent/opa/version.Vcs=88d6ca32 -X github.com/open-policy-agent/opa/version.Timestamp=2020-03-29T02:25:25Z -X github.com/open-policy-agent/opa/version.Hostname=Patricks-MacBook-Pro.local"
$ file opa_linux_arm64
opa_linux_arm64: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=j_yyDbC8Pu-fQJ7oq9VH/6aqO2bg5NvfQoXMp8jgo/8bT9gva510YbDWZxDm3j/q9AxXn6FTP1ORmwqT4AC, not stripped

To make the container image for this you'd just need to grab the OPA source and use the golang base image (similar to what OPA does https://github.com/open-policy-agent/opa/blob/master/Makefile#L170) then copy the binary into the base image you want to use (see https://github.com/open-policy-agent/opa/blob/master/Dockerfile for reference, it doesn't need to do a whole lot).

@patrick-east patrick-east added feature-request help wanted packaging Issues related to OPA release artifacts, pipelines etc. labels Mar 29, 2020
@patrick-east patrick-east changed the title arm64 builds Publish arm64 binaries and container images Mar 29, 2020
@patrick-east
Copy link
Contributor

I think there are a few things we'd want to do to add support:

  • Add arm binaries to be part of the "release" Makefile target(s)
  • Add support for publishing multi-arch images
  • Update travis to build/push the arm binaries with the others

@pieterv-icloud-com
Copy link

I tried deploying opa using helm on a Rancher k3s cluster running on a number of Raspberry Pis.

The deployment fails with an "exec format error" message

opa only supports the amd64 architecture, not the arm/v6 architecture.

@anagarjunr
Copy link

anagarjunr commented Sep 25, 2020

would love to have this as we use arm64 ec2 instances

@srenatus
Copy link
Contributor

ℹ️ We cannot support wasm on that architecture yet, so if you're reading this try setting WASM_ENABLED=0 in your custom builds.

I've brought this to the attention of the fine folks working on wasmtime-go: bytecodealliance/wasmtime-go#79

@srenatus
Copy link
Contributor

srenatus commented Aug 6, 2021

Times have changed, aarch64 and wasmtime-go should work now.

So, what remains to be done for this is building and testing. There's ways to do that on github actions using either docker buildx or some multi-arch qemu thing, with prior art in github.com/bytecodealliance/wasmtime, for example.

@manelpb
Copy link

manelpb commented Aug 30, 2021

+1

@srenatus
Copy link
Contributor

@manelpb I'm afraid without outside help, this isn't going to happen soon. If anyone is interested in helping out here, happy to help guide you through it.

@stale
Copy link

stale bot commented Nov 22, 2021

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.

@stale stale bot added the inactive label Nov 22, 2021
@srenatus
Copy link
Contributor

srenatus commented Nov 23, 2021

Related: #4044 -- but that doesn't mean were publishing these images (yet), so this issue is still relevant.

@stale
Copy link

stale bot commented Dec 23, 2021

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.

@stale stale bot added the inactive label Dec 23, 2021
@manelpb
Copy link

manelpb commented Dec 23, 2021

bump

@stale stale bot removed the inactive label Dec 23, 2021
@anderseknert
Copy link
Member

@manelpb If you want to endorse the issue, just "vote" on it by liking (i.e. thumbs up emoji) the original description. Saying "bump" or "+1" just adds noise, and as such tend to have the opposite effect on maintainers ;)

@stale
Copy link

stale bot commented Jan 22, 2022

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.

@stale stale bot added the inactive label Jan 22, 2022
ngraef added a commit to ngraef/opa that referenced this issue Jan 24, 2022
This change adds linux/arm64 binaries to the release. It also publishes an arm64
container image for all variants (standard, debug, rootless, static) and releases
(dev, edge, latest).

The build and push process uses buildx in order to push the individual
images by digest (i.e. untagged) and reference them in a single, tagged manifest
list. This avoids cluttering Docker Hub's tag list with `<tag>-<arch>` tags.

Fixes open-policy-agent#2233

Signed-off-by: Nick Graef <[email protected]>
srenatus pushed a commit that referenced this issue Jan 24, 2022
This change adds linux/arm64 binaries to the release. It also publishes an arm64
container image for all variants (standard, debug, rootless, static) and releases
(dev, edge, latest).

The build and push process uses buildx in order to push the individual
images by digest (i.e. untagged) and reference them in a single, tagged manifest
list. This avoids cluttering Docker Hub's tag list with `<tag>-<arch>` tags.

Fixes #2233

Signed-off-by: Nick Graef <[email protected]>
@srenatus
Copy link
Contributor

Take that, stalebot. Thanks again @ngraef

msorens pushed a commit to msorens/opa that referenced this issue Jan 30, 2022
This change adds linux/arm64 binaries to the release. It also publishes an arm64
container image for all variants (standard, debug, rootless, static) and releases
(dev, edge, latest).

The build and push process uses buildx in order to push the individual
images by digest (i.e. untagged) and reference them in a single, tagged manifest
list. This avoids cluttering Docker Hub's tag list with `<tag>-<arch>` tags.

Fixes open-policy-agent#2233

Signed-off-by: Nick Graef <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request help wanted inactive packaging Issues related to OPA release artifacts, pipelines etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants