Skip to content

Commit

Permalink
1862 adr (#1900)
Browse files Browse the repository at this point in the history
## Description

ADR for decoupling the transform library from go code and allowing it to
be used in TypeScript with Pepr.

## Related Issue

Fixes #
<!-- or -->
Relates to #1632

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Other (security config, docs update, etc)

## Checklist before merging

- [ ] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed

---------

Signed-off-by: Case Wylie <[email protected]>
Co-authored-by: Wayne Starr <[email protected]>
  • Loading branch information
cmwylie19 and Racer159 authored Jul 20, 2023
1 parent 7b57df1 commit 02150cf
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions adr/0019-decouple-transformation-library-from-zarf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# 19. Decouple Transformation Library from Zarf

Date: 2023-05-28

## Status

Pending

## Context

We need a way to decouple transformations from Zarf. We know the Zarf transformation library is battle tested, hardened, and reliable. As Pepr takes admission responsibilities from the Zarf Agent, we need a way to synchronize the TypeScript with the Go code instead of maintaining two disparate libraries which will be expected to grow.

We considered:
- WASM
- gRPC
- REST
- Rewrite the code in TypeScript

#### WASM

**PROS**
- Shared codebase between TypeScript and Go
- Fast
- API Contract
- No network overhead
**CONS**
- New technology
- Requires new features in Pepr

#### gRPC

**PROS**
- Shared codebase between TypeScript and Go
- Fast
- API Contract
**CONS**
- Network overhead
- Pepr is considering adding a sidecar and we did not want potentially 3 containers in the Pepr Pod.

#### REST

**PROS**
- Shared codebase between TypeScript and Go
- Proven
- API Contract
**CONS**
- Network overhead
- Pepr is considering adding a sidecar and we did not want potentially 3 containers in the Pepr Pod.

#### Rewrite in TypeScript

**PROS**
- Low hanging fruit
**CONS**
- Two codebases to maintain
- TypeScript is not as battle tested as Go



## Decision

We conformed around using WASM because we can leverage the battle tested transform library from Zarf without incurring network overhead cost from pod to pod or container to container communications.

## Consequences

- Requires an Update to Pepr Core to package the WASM file because it is too large to fit in a ConfigMap
- This will require standardization around the objects that are passed from Pepr to the WASM functions to testability and maintainability.

0 comments on commit 02150cf

Please sign in to comment.