workflow: use docker-env for building image (to ensure golang version)#223
Conversation
tsandall
left a comment
There was a problem hiding this comment.
One minor comment about permissions on the binary.
RE: the cert/go version issue: I think this is fine. I'm assuming this only applies to the certs in the quick_start.yaml file that are used for the admission controller (which is basically an installer for an example...)
I'm tempted to put a comment in the quick_start.yaml file that indices we don't guarantee backwards compatibility on the quick_start.yaml manifest (although that might get misinterpreted...)
Makefile
Outdated
| image: | ||
| @$(MAKE) build-linux | ||
| image: release | ||
| mv $(RELEASE_DIR)/opa_envoy_linux_$(GOARCH) . |
There was a problem hiding this comment.
make release may produce a binary owned by root since it was built inside of Docker...perhaps we could just modify the Dockerfile to copy from the release directory instead of the root directory--that would avoid the mv.
There was a problem hiding this comment.
I'll do that, the path I started on led to a mess, though. I'll clean it up tomorrow. We don't need multiple Dockerfiles, there's only one thing built here. 🤔
0a07e51 to
0946a7b
Compare
|
I'll fix e2e tomorrow, it'll be affected by #202 getting merged anyways, I suppose. |
Before, the `image` would invoke `build-linux`, and that wouldn't guarantee the
version of golang used for building.
Now, we're following the schema used by OPA to build the binary into a release dir,
and have the image build pick it up.
Also, the built image now includes everything needed to use wasm:
$ docker run -it docker.io/openpolicyagent/opa:0.25.1-envoy-2 version
Version: 0.25.1-envoy-2
Build Commit: 20832273
Build Timestamp: 2020-12-08T13:34:55Z
Build Hostname: ce578c1a1309
Go Version: go1.15.2
WebAssembly: available
$ docker run --entrypoint busybox -it docker.io/openpolicyagent/opa:0.25.1-envoy-2 sh
/ # ls /usr/lib/opa
libwasmer.so
/ #
We do this by building off of the openpolicyagent/opa package, which has the
library in place.
Fixes open-policy-agent/opa#2942.
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
0946a7b to
2b1b571
Compare
Before, the
imagewould invokebuild-linux, and that wouldn't guarantee theversion of golang used for building.
Now, the
imagetarget goes through a round ofmake releaseto ensure justthat.
As a consequence, we'll build windows and darwin binaries where we don't need
them, but let's see if the time wasted is problematic at all.
To verify that this does what it's supposed to do, I've overridden the VERSION
makefile variable, and ran
make image. The resulting container reports:Fixes open-policy-agent/opa#2942.
examples/istio/quick_start.yamlcerts have been adapted, but there hasn't been a release of opa-envoy-plugin using Go 1.15.x until we ship this change.For more details about what's going on, please refer to the release notes: