|
| 1 | +--- |
| 2 | +title: split-sdk-into-multiple-projects |
| 3 | +authors: |
| 4 | + - "@jesusr" |
| 5 | +reviewers: |
| 6 | + - "@estroz" |
| 7 | + - "@hasbro17" |
| 8 | + - "@joelanford" |
| 9 | + - "@fabianvf" |
| 10 | + - "@shawn-hurley" |
| 11 | +approvers: |
| 12 | + - "@estroz" |
| 13 | + - "@hasbro17" |
| 14 | + - "@joelanford" |
| 15 | + - "@fabianvf" |
| 16 | + - "@shawn-hurley" |
| 17 | +creation-date: 2020-05-18 |
| 18 | +last-updated: 2020-05-27 |
| 19 | +status: implementable |
| 20 | +see-also: |
| 21 | +replaces: |
| 22 | +superseded-by: |
| 23 | +--- |
| 24 | + |
| 25 | +# Split SDK into multiple projects |
| 26 | + |
| 27 | +## Release Signoff Checklist |
| 28 | + |
| 29 | +- [X] Enhancement is `implementable` |
| 30 | +- [X] Design details are appropriately documented from clear requirements |
| 31 | +- [X] Test plan is defined |
| 32 | +- [X] Graduation criteria for dev preview, tech preview, GA |
| 33 | + |
| 34 | +## Open Questions [optional] |
| 35 | + |
| 36 | +1. What do we do with other shared tooling, CI, test helpers, etc. (e.g. |
| 37 | + changelog generator)? Do we need a separate repo for that? |
| 38 | + * Answer: We should visit these on a case by case basis as we see what is needed |
| 39 | + during the splitting. |
| 40 | + |
| 41 | +## Summary |
| 42 | + |
| 43 | +This is the overarching enhancement that will plan how to split functionality |
| 44 | +out of the current operator-sdk project into separate projects. The initial |
| 45 | +thought on component breakdown mirrors the kubebuilder and controller-runtime |
| 46 | +projects: |
| 47 | + |
| 48 | +1. Common libraries and operator building blocks |
| 49 | +1. Go scaffolding plugin and the main SDK CLI |
| 50 | +1. Helm operator library and scaffolding plugin |
| 51 | +1. Ansible operator library and scaffolding plugin |
| 52 | + |
| 53 | +## Motivation |
| 54 | + |
| 55 | +The motivation is to avoid a breaking change in one component causing a major |
| 56 | +version bump for all other unrelated components. Another motivation is to make |
| 57 | +the projects consumable by other projects as libraries. A benefit would be |
| 58 | +better testing and easier to contribute to the smaller projects. |
| 59 | + |
| 60 | +While there are a few complexities with having separate repos, like PR |
| 61 | +coordination between repos, or just the working complexity of having to point |
| 62 | +at different repos to pick up your dep changes, these are obstacles we can |
| 63 | +overcome. They also aren’t that much different from other dependencies we |
| 64 | +work with. |
| 65 | + |
| 66 | +### Goals |
| 67 | + |
| 68 | +Split the operator-sdk repo into 4 separate repos: |
| 69 | + |
| 70 | +1. CLI and Go Operator |
| 71 | +1. SDK library |
| 72 | +1. Helm operator |
| 73 | +1. Ansible operator |
| 74 | + |
| 75 | +This SDK library split would be a requirement for a 1.0 release. The Ansible |
| 76 | +and Helm operators could go afterwards if need be. |
| 77 | + |
| 78 | +### Non-Goals |
| 79 | + |
| 80 | +* We will not solve the downstream SDK in this enhancement. |
| 81 | +* We will not solve all of the items required for a 1.0 release. |
| 82 | +* Defining when version bumps occur in each repo. |
| 83 | + |
| 84 | +## Proposal |
| 85 | + |
| 86 | +Split the operator-sdk repo into 4 separate repos as outlined in the Goals |
| 87 | +section above. |
| 88 | + |
| 89 | +1. CLI and Go Operator |
| 90 | + * contains the Go operator code |
| 91 | + * contains the CLI code |
| 92 | + * related plugin and scaffolding |
| 93 | + * lives in operator-framework/operator-sdk |
| 94 | + * the split of the CLI/Go Operator repo is dependent on Kubebuilder Phase 2 |
| 95 | + to avoid creating a moving target. |
| 96 | +1. SDK library |
| 97 | + * contains utility code like package status, status condition, annotated |
| 98 | + watcher, etc. |
| 99 | + * this is something that operator projects (including Helm and Ansible |
| 100 | + operators) would import |
| 101 | + * depends on controller-runtime |
| 102 | + * lives in operator-framework/operator-lib (or some other name TBD) |
| 103 | + * this library should probably *not* be 1.0; it's most likely to change often |
| 104 | + * use Go apidiff tool to determine major version bumps |
| 105 | +1. Helm operator |
| 106 | + * contains Helm operator code |
| 107 | + * related plugin and scaffolding |
| 108 | + * lives in operator-framework/helm-operator |
| 109 | + * the Helm plugin is dependent on Kubebuilder Phase 1. |
| 110 | +1. Ansible operator |
| 111 | + * contains Ansible operator code |
| 112 | + * related plugin and scaffolding |
| 113 | + * lives in operator-framework/ansible-operator |
| 114 | + * the Ansible plugin is dependent on Kubebuilder Phase 1. |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | +### Tasks |
| 119 | + |
| 120 | +1. Triage pkg directory to determine what goes to which repo |
| 121 | +1. Use git commands to extract directories or files with history into these |
| 122 | + new repos. Exact commands will be TBD. |
| 123 | +1. Evaluate if making a separate repo for the hack directory is necessary or |
| 124 | + if we just copy it to each of the 4 repos. |
| 125 | +1. CLI and Go Operator |
| 126 | + * keep operator-framework/operator-sdk |
| 127 | + * cmd, internal directories remain here |
| 128 | + * prior to 1.0 release, review entire CLI; axe all legacy support for |
| 129 | + existing project layout |
| 130 | + * consider making `generate csv` separate like `controller-gen` to support |
| 131 | + OLM's plan for CSVless bundles (could be done later) |
| 132 | +1. SDK library |
| 133 | + * create new repo operator-framework/operator-lib |
| 134 | + * export the directories / files based on task 1 triage. |
| 135 | +1. Helm operator and plugin |
| 136 | + * create new repo operator-framework/helm-operator |
| 137 | + * export the pkg/helm tree to the new repo at the top level maintaining |
| 138 | + history |
| 139 | + * There is a plan to deprecate pkg/helm and replace with |
| 140 | + [Joe's helm repo](https://github.com/joelanford/helm-operator) this |
| 141 | + will be covered in a separate proposal to explicitly explain why and |
| 142 | + how this will occur. |
| 143 | +1. Ansible operator and plugin |
| 144 | + * create new repo operator-framework/ansible-operator |
| 145 | + * export the pkg/ansible tree to the new repo at the top level |
| 146 | + maintaining history |
| 147 | + |
| 148 | +### Affect on docs website |
| 149 | + |
| 150 | +Today the docs are stored in a website directory in the operator-sdk repo. The |
| 151 | +following illustrates how the docs can be split to follow the repos: |
| 152 | + |
| 153 | +1. CLI and Go Operator |
| 154 | + * maintains a website directory that contains the SDK docs, hosted at |
| 155 | + sdk.operatorframework.io |
| 156 | +1. SDK library |
| 157 | + * will contain Godocs for the library |
| 158 | +1. Helm operator |
| 159 | + * will contain Godocs for the library portion |
| 160 | + * would contain a website directory that contains the Helm docs, hosted at |
| 161 | + helm.operatorframework.io |
| 162 | + * having its own domain means we can version the docs with the releases of |
| 163 | + the Helm operator |
| 164 | +1. Ansible operator |
| 165 | + * will contain Godocs for the library portion |
| 166 | + * would contain a website directory that contains the Helm docs, hosted at |
| 167 | + ansible.operatorframework.io |
| 168 | + * having its own domain means we can version the docs with the releases of |
| 169 | + the Ansible operator |
| 170 | + |
| 171 | + |
| 172 | +### Implementation Details/Notes/Constraints [optional] |
| 173 | + |
| 174 | +See above |
| 175 | + |
| 176 | +### Risks and Mitigations |
| 177 | + |
| 178 | +The biggest risk is the instability that will occur while the projects are |
| 179 | +split apart. Once all the projects are in place things will come back together. |
| 180 | + |
| 181 | +## Design Details |
| 182 | + |
| 183 | +### Test Plan |
| 184 | + |
| 185 | +The ultimate test is that e2e tests and manual testing of the SDK binary will |
| 186 | +be used to determine it remains functional. Each repo will contain their own |
| 187 | +unit test suites and where appropriate e2e tests. |
| 188 | + |
| 189 | +### Graduation Criteria |
| 190 | + |
| 191 | +N/A |
| 192 | + |
| 193 | +### Upgrade / Downgrade Strategy |
| 194 | + |
| 195 | +N/A |
| 196 | + |
| 197 | +### Version Skew Strategy |
| 198 | + |
| 199 | +N/A |
| 200 | + |
| 201 | +## Implementation History |
| 202 | + |
| 203 | +20200603 - Answer the helm-operator question. |
| 204 | +20200603 - Address questions from the review. |
| 205 | +20200602 - Answered the docs question. |
| 206 | +20200601 - Added versioning as a non-goal; Added KB phase 2 note to CLI repo. |
| 207 | +20200527 - This document is created. |
| 208 | +20200518 - Initial Google Document created to do initial set of review. |
| 209 | + |
| 210 | +## Drawbacks |
| 211 | + |
| 212 | +N/A |
| 213 | + |
| 214 | +## Alternatives |
| 215 | + |
| 216 | +### Docs |
| 217 | + |
| 218 | +An alternative to splitting up the docs would be to build a mechanism to add |
| 219 | +docs from Ansible/Helm repos into the main SDK site at build time. This would |
| 220 | +keep the top level site as it is now. A drawback would be that the documentation |
| 221 | +versioning would be for the entire SDK which negates the individual versioning |
| 222 | +we are attempting with splitting the repos. |
| 223 | + |
| 224 | +There are disussions about whether to version the Operator Framework as a whole, |
| 225 | +which could affect docs in a major way. It could also affect the underlying |
| 226 | +repos as well. This is not something we can solve in this proposal nor should |
| 227 | +we. |
0 commit comments