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

cli: separate nix rule for cli release build #135

Merged
merged 2 commits into from
Feb 9, 2024

Conversation

burgerdev
Copy link
Contributor

We would like to include a standard coordinator policy hash into cli
releases, so that the coordinator can be deployed separately and is
still verified by the cli.

We cannot embed a default coordinator policy into the existing build
rule:

  • To generate a policy hash, we need to build the coordinator, publish
    it as an OCI image and run genpolicy on it.
  • To embed the hash in the binary, it needs to go into the build inputs.
  • If it's in the build inputs, the output store location changes.
  • If the output store location changes, the OCI layer (and thus the
    required policy) changes.

On the other hand, we would like to keep the multi-binary build rule for
development, so we introduce a new build rule exclusively for cli
releases, and only that rule consumes the coordinator policy hash as
input.

@burgerdev burgerdev requested a review from katexochen as a code owner February 8, 2024 08:13
@burgerdev burgerdev marked this pull request as draft February 8, 2024 08:38
packages/default.nix Outdated Show resolved Hide resolved
@burgerdev burgerdev force-pushed the burgerdev/generate-policy-hash branch 2 times, most recently from f5f2142 to 4549f47 Compare February 8, 2024 13:39
@burgerdev burgerdev requested a review from katexochen February 8, 2024 13:39
@burgerdev burgerdev marked this pull request as ready for review February 8, 2024 13:39
@burgerdev burgerdev force-pushed the burgerdev/generate-policy-hash branch from 4549f47 to 43c006d Compare February 8, 2024 13:40
packages/default.nix Outdated Show resolved Hide resolved
@burgerdev burgerdev force-pushed the burgerdev/generate-policy-hash branch 2 times, most recently from e7dcac0 to 5a96e7c Compare February 8, 2024 16:59
cli/policies.go Outdated Show resolved Hide resolved
@burgerdev burgerdev force-pushed the burgerdev/generate-policy-hash branch 2 times, most recently from 492e11d to 1f91296 Compare February 9, 2024 12:23
Copy link
Member

@katexochen katexochen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remember to rebase before merge.

burgerdev and others added 2 commits February 9, 2024 18:03
We would like to include a standard coordinator policy hash into cli
releases, so that the coordinator can be deployed separately and is
still verified by the cli.

We cannot embed a default coordinator policy into the existing build
rule:

* To generate a policy hash, we need to build the coordinator, publish
  it as an OCI image and run genpolicy on it.
* To embed the hash in the binary, it needs to go into  the build inputs.
* If it's in the build inputs, the output store location changes.
* If the output store location changes, the OCI layer (and thus the
  required policy) changes.

On the other hand, we would like to keep the multi-binary build rule for
development, so we introduce a new build rule exclusively for cli
releases, and only that rule consumes the coordinator policy hash as
input.

Co-authored-by: Paul Meyer <[email protected]>
@burgerdev burgerdev force-pushed the burgerdev/generate-policy-hash branch from 1f91296 to dc0c76c Compare February 9, 2024 17:03
@burgerdev burgerdev merged commit f412e82 into main Feb 9, 2024
5 checks passed
@burgerdev burgerdev deleted the burgerdev/generate-policy-hash branch February 9, 2024 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants