Skip to content

Commit c04da21

Browse files
author
Joseph Palermo
committed
Bosh Templating Language RFC
1 parent 411475b commit c04da21

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Meta
2+
[meta]: #meta
3+
- Name: Bosh Templating Language
4+
- Start Date: 2024-10-21
5+
- Author(s): jpalermo
6+
- Status: Draft
7+
- RFC Pull Request: (fill in with PR link after you submit it)
8+
9+
10+
## Summary
11+
12+
Introduce new custom templating language that can be used by bosh releases. Ideally gather feedback from release
13+
authors as part of the RFC process to define the MVP of the language.
14+
15+
## Problem
16+
17+
Currently all bosh release templates are rendered using ERB using the Bosh Director's Ruby process, or whatever
18+
Ruby process is available when a `bosh create-env` is being run.
19+
20+
We've had multiple release breakages over the years as we upgrade the Bosh Director Ruby version and the Ruby
21+
language changes in a way that release templates were not expecting.
22+
23+
A secondary problem is that template rendering can be slow when rendering templates for large CF deployments.
24+
25+
## Proposal
26+
27+
Write a library/cli that defines a strict grammar suitable for basic template rendering within Bosh releases.
28+
29+
A proof of concept can be found [here](https://github.com/jpalermo/bosh-template-renderer).
30+
31+
We would NOT be removing ERB rendering as an option anytime in the near future. We would update many of the Bosh
32+
Releases in the Foundational Infrastructure Working Group to use the new templates and then target releases
33+
that are on Diego Cells as large CF deployments render those same templates a large number of times.
34+
35+
Having a grammar under our control means we can ensure it does not change or break through golang and dependency
36+
upgrades.
37+
38+
The Bosh Director is written in Ruby, so it will be able to shell out to the CLI to render templates. While
39+
the Bosh CLI is written in golang so it will be able to import the library and use it directly.
40+
41+
The grammar would be kept relatively small. We will not be providing a direct replacement for ERB. Many validations
42+
and data transformations are happening within ERB templates right now that should be happening at different layers
43+
of the deployment process.
44+
45+
Data transformation should be happening within the release runtimes or pre-start scripts. Validation can also happen
46+
there, although it's possible we want to expand the Bosh Release `spec` files to provide some level of validation so
47+
errors can be caught early in the deploy process (that work is NOT part of this RFC).

0 commit comments

Comments
 (0)