Now that we can build with CGO_ENABLED=0 we do not have to use a base
image that provides libc. Remove distroless for the normal and
rootless images and use scratch instead.
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
Shared library loading was removed in v0.14.0. This commit removes the
deprecated code and moves the test coverage for plugin registration
via the runtime package global into the runtime package.
Fixes#2049
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
Any release tag with a `rc` string in the the semver
will be ignored for the docs on the website and will _not_ update the
"latest" docker image tag, or "latest" downloads url.
Signed-off-by: Patrick East <east.patrick@gmail.com>
This adds in a new CLI sub command `opa bench` which will load
and evaluate similar to `opa eval` but will perform benchmark testing
of the query.
There is also a new `--bench` option for `opa test` which will
similarly perform benchmarking, except on the unit tests.
Both use the golang testing frameworks benchmark tooling, and the
output format is compliant with the go benchmark standard when using
the newly added `gobench` output format option.
They both support specifying a `--count` to run the benchmark a
number of times and a `--benchmem` option to report memory statistics.
To help enable using the `opa test` command better with the benchmark
option there is now a `--run`/`-r` option that can be provided to
specify a regex for what test cases should be run. The regex supports
anything that is supported by re2:
https://github.com/google/re2/wiki/Syntax
These changes required updating to Go 1.13 to get the ability to
report custom metrics with the benchmark results
https://golang.org/pkg/testing/#B.ReportMetric To get Netlify on board
we needed to add a `.go-version` file to the root of the repo. This is
now the single source of truth for the OPA golang version.
Fixes: #1424
Signed-off-by: Patrick East <east.patrick@gmail.com>
This was added accidentally during the last release cut. This only
affects the dev build so it's not a big deal.
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
Fuzzit targets are failing as the libFuzzer is running into out-of-memory errors. This is causing the CI to fail on master.
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
This commit combines a few changes to the build. Namely:
1. The travis build no longer works off a dirty working copy. The
.dockerignore file was excluding the docs directory which caused the
working copy to become dirty during the build process. While this
isn't a huge issue it does make it harder to be confident about the
state of the source that Travis binaries are built from. As part of
this change, we remove the builder image in favour of running the
golang image and volume mounting the working copy. This is avoids the
copy that is quite expensive in the OPA repo.
2. In the recent build refactoring, the wasm development workflow was
broken. Changes to the wasm library were not getting picked up
automatically when running the wasm/rego tests. This commit fixes the
makefile so that the wasm libary is rebuilt and the wasm blob is
copied and regenerated each time the wasm/rego tests are run.
Finally, this commit leans into modules a bit more removing the
scheduler test dependency on GOPATH.
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
This switches to use goimports configured for the opa directory to
do the formatting checks (which now includes ordering of imports).
It will _not_ change imports, only the order of them.
Signed-off-by: Patrick East <east.patrick@gmail.com>
Without this, if someone has opa checked out in their gosrc path
it would _not_ default to using modules. This will force the build
commands to treat the repo as a module at all times.
Signed-off-by: Patrick East <east.patrick@gmail.com>
This will keep us honest with having the vendor directory up to date
with the go.mod/go.sum configuration. The vendor directory will always
be an archive of the dependencies used to build the project.
Signed-off-by: Patrick East <east.patrick@gmail.com>
The build was broken becasue the fuzzer artifacts were showing up in
the working copy and were owned by root once they got built inside of
a Docker image. This change updates the build to create an image for
the fuzzer to run inside of. The image can be shared across both
fuzzer runs and the artifacts are contained inside the image and don't
pollute the working copy.
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
Remove dependencies on build server host, relying on Docker execution
for everything. These changes reorganize the wasm development
targets. The wasm-build/test/clean targets operate on the C code in
the wasm/ directory. The wasm-rego-test target runs the wasm
integration test cases from the asset files under the test/
directory. The wasm-rego-test asset generation step has been
refactored to use proper Makefile dependencies. This _should_ allow us
to share the same wasm-rego-target in development and on Travis.
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
As discussed in #1639.
Note that .dockerignore had to be changed as to *not* skip what's needed
for the build: vendor, obviously, and .git for the compiled-in version
information.
parts:
- .travis.yml: don't bother about golang anymore
- docs/devel/DEVELOPMENT.md: update
- Makefile: update hint
Signed-off-by: Stephan Renatus <srenatus@chef.io>