dapr / dapr/dapr

Autogenerate component imports at build time.

Open
#3,271 6 comments 0 reactions 1 assignee Claimed by @wcs1only View on GitHub
area/configuration documentation required kind/feature P1 size/S triaged/resolved
Dominant language
Go
Stars
26.1k
Forks
2.1k
Avg merge
1d 21h
Merged PRs (30d)
95

Description

Splitting this off of #3168. This is a step towards #3168 that adds value to several different scenarios, whether or not we decide to build #3168 or not.

## In what area(s)?

/area runtime

## Describe the feature
I propose that we implement the following:

Our build system should take a configuration file as an input with a list of components to include in the build. Based on this input, we should generate a component loader that is used by cmd/daprd/main.go. The output would be a daprd binary that only contains the desired modules, and nothing else. This gives us two short term benefits:
- Ease of adding new components to dapr/dapr code.
- Anyone that wants can show up with their own input file and have their own flavor.

In the long term, if we want to maintain flavors as in the long term as this proposal suggests, doing so becomes as easy as maintaining a yaml file.

I took a first pass at this, and I propose the following format for the component list yaml file:
```

root_package: "github.com/dapr/components-contrib/"
component_typenames:
secretstores:
- runtime_callback: WithSecretStores
components:
- path: "aws/secretmanager"
- path: "azure/keyvault"
...
bindings:
- runtime_callback: WithInputBindings
components:
- path: "aws/kinesis"
- path: "zeebe/jobworker"
...
- runtime_callback: WithOutputBindings
components:
- path: "alicloud/oss"
- path: "apns"
...

```

With that data, and some minor changes to some component initialization conventions, the code generation piece of this would be relatively straightforward. We could be building daprd instances with arbitrary components in no time.

## Release Note

RELEASE NOTE: Imported components are now configurable.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.