Skip to content

Commit

Permalink
review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
khieta committed Sep 17, 2024
1 parent b0bea49 commit 6acd0c0
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
10 changes: 5 additions & 5 deletions oopsla2024-benchmarks/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ COPY Cargo.toml plot.py README.md cedar-benchmarks/
COPY generators cedar-benchmarks/generators/
COPY benches cedar-benchmarks/benches/
COPY src cedar-benchmarks/src/
COPY opa-harness cedar-benchmarks/opa-harness/
COPY rego-harness cedar-benchmarks/rego-harness/
COPY validate_all_benchmarks.sh cedar-benchmarks

## Check that the Cedar policies validate with the provided schemas
RUN cedar-benchmarks/validate_all_benchmarks.sh
RUN BENCHES=cedar-benchmarks/benches cedar-benchmarks/validate_all_benchmarks.sh

## Build Rego version of TinyTodo
RUN cd cedar-benchmarks/opa-harness && \
go mod init opa-harness && \
## Build Rego harness
RUN cd cedar-benchmarks/rego-harness && \
go mod init rego-harness && \
go get github.com/open-policy-agent/opa/rego && \
mkdir -p build/bin && \
go build -o build/bin/main cmd/harness/main.go
Expand Down
4 changes: 2 additions & 2 deletions oopsla2024-benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ can build Cedar and our benchmarking harness.

* `benches/`: Cedar, OpenFGA, and Rego policies used for benchmarking. See the README in that folder for more details.
* `generators/`: Python scripts that generate entity data for benchmarking.
* `opa-harness/`: Go wrapper to run OPA.
* `src/`: Rust code that performs the benchmarking. `src/main.rs` is what runs when you run `cargo run`.
* `rego-harness/`: Go wrapper to run Rego.
* `src/`: Rust code that performs the benchmarking. `src/main.rs` is what runs when you run `cargo run --release`.
* `Dockerfile`: Builds the test environment (see instructions above).
* `openfga-timing.patch`: OpenFGA patch to apply to the version used in our experiments.
* `plot.py`: Python script to plot results.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"opa-harness/harness"
"rego-harness/harness"
)


Expand Down
2 changes: 1 addition & 1 deletion oopsla2024-benchmarks/src/rego_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use log::warn;
use serde::Deserialize;
use serde_json::Value;

static GO_BINARY_PATH: &str = "opa-harness/build/bin/main";
static GO_BINARY_PATH: &str = "rego-harness/build/bin/main";

pub struct RegoEngine<'a, T>
where
Expand Down
12 changes: 7 additions & 5 deletions oopsla2024-benchmarks/validate_all_benchmarks.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
BENCHES="${BENCHES:-benches}"

# gdrive benchmark (static policies)
cedar validate --policies cedar-benchmarks/benches/gdrive/cedar/policies.cedar --schema cedar-benchmarks/benches/gdrive/cedar/gdrive.cedarschema.json
cedar validate --policies $BENCHES/gdrive/cedar/policies.cedar --schema $BENCHES/gdrive/cedar/gdrive.cedarschema.json

# gdrive benchmark (templates)
cedar validate --policies cedar-benchmarks/benches/gdrive-templates/cedar/policies.cedar --schema cedar-benchmarks/benches/gdrive-templates/cedar/gdrive-templates.cedarschema.json
cedar validate --policies $BENCHES/gdrive-templates/cedar/policies.cedar --schema $BENCHES/gdrive-templates/cedar/gdrive-templates.cedarschema.json

# gdrive benchmark (static policies)
cedar validate --policies cedar-benchmarks/benches/github/cedar/policies.cedar --schema cedar-benchmarks/benches/github/cedar/github.cedarschema.json
cedar validate --policies $BENCHES/github/cedar/policies.cedar --schema $BENCHES/github/cedar/github.cedarschema.json

# gdrive benchmark (templates)
cedar validate --policies cedar-benchmarks/benches/github-templates/cedar/policies.cedar --schema cedar-benchmarks/benches/github-templates/cedar/github-templates.cedarschema.json
cedar validate --policies $BENCHES/github-templates/cedar/policies.cedar --schema $BENCHES/github-templates/cedar/github-templates.cedarschema.json

# tinytodo benchmark
cedar validate --policies cedar-benchmarks/benches/tinytodo/cedar/tinytodo.cedar --schema cedar-benchmarks/benches/tinytodo/cedar/tinytodo.cedarschema.json
cedar validate --policies $BENCHES/tinytodo/cedar/tinytodo.cedar --schema $BENCHES/tinytodo/cedar/tinytodo.cedarschema.json

0 comments on commit 6acd0c0

Please sign in to comment.