Skip to content

Commit

Permalink
Use SLSA to build system image and generate provenance.
Browse files Browse the repository at this point in the history
This is now working, without hanging, thanks to the amazing bug-hunting skills
of julsh@.

Fixes: 335277885

Change-Id: If4be76878a6668995e40ab137403226df7bbdb7d
  • Loading branch information
jblebrun committed Apr 17, 2024
1 parent 3a40942 commit 8263919
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/provenance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- buildconfigs/key_xor_test_app.toml
- buildconfigs/oak_containers_kernel.toml
- buildconfigs/oak_containers_stage1.toml
- buildconfigs/oak_containers_system_image.toml
- buildconfigs/oak_echo_enclave_app.toml
- buildconfigs/oak_echo_raw_enclave_app.toml
- buildconfigs/oak_functions_enclave_app.toml
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/reusable_provenance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ jobs:
actions: read
id-token: write
contents: write # For uploading provenances.
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_container-based_slsa3.yml@v1.10.0
# We are using a patched version that emits stdout and stderr as the build progresses, rather than waiting until the very end to
# read everything in. This works around some issues we encountered when the
# output is very large. If our patch is eventually accepted upstream (or any other fix), we can switch back to using the main
# repository.
# See: https://github.com/slsa-framework/slsa-github-generator/issues/3571
uses: jul-sh/slsa-github-generator/.github/workflows/builder_container-based_slsa3.yml@oak
with:
builder-image: 'europe-west2-docker.pkg.dev/oak-ci/oak-development/oak-development'
builder-digest: ${{ needs.get_inputs.outputs.builder-digest }}
Expand Down
12 changes: 12 additions & 0 deletions buildconfigs/oak_containers_system_image.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This is the static build configuration that we use with the docker-based SLSA3 generator for
# building the `stage1` binary, and its provenance.
# See https://github.com/slsa-framework/slsa-github-generator/tree/main/internal/builders/docker.
command = [
"nix",
"develop",
".#systemImageProvenance",
"--command",
"just",
"oak_containers_system_image",
]
artifact_path = "./oak_containers_system_image/target/image.tar.xz"
9 changes: 9 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,15 @@
strip-nondeterminism
];
};
systemImageProvenance = with pkgs; mkShell {
inputsFrom = [
bazel
bazel-buildtools
jdk11_headless
rust
];
packages = [ ];
};
# Shell for most CI steps (i.e. without contaniners support).
ci = pkgs.mkShell {
inputsFrom = [
Expand Down

0 comments on commit 8263919

Please sign in to comment.