You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A thunk addr is a lot like a thunk path except it represents to a TCP address instead of a filesystem path.
When using a thunk addr you don't need to worry about managing the lifecycle of the service that the thunk represents. The service will be run lazily, de-duplicated across multiple Bass runs, and stopped when all clients go away.
The advantage of this approach over traditional service lifecycle management parallels the advantages of using thunk paths instead of managing state in a local filesystem. It allows thunks that depend on services provided by other thunks to remain reproducible, just like thunks that depend on files created by other thunks.
bridge networking & DNS
To prevent port collisions, thunks no longer run in the host network. Instead they run in a bridge network where each thunk has its own IP and reaches other thunks using DNS.
Using DNS is important because IPs are not reproducible. If thunks reached each other using direct container IPs then caches would be busted every time a service runs.
Now that thunks run in their own network, you can't use Bass to run and expose services to the host machine. This may be added in a future release via port forwarding. Alternatively you could take the path-name (a bit of a misnomer) of the thunk and reverse-proxy to its container port using the same DNS server that thunks use.
automatic TLS
Thunks may also use TLS. A unique "bass" certificate authority is generated by the runtime and automaticaly trusted by all thunks that it runs.
To generate a certificate for a thunk, use with-tls:
Generating TLS certs is a necessary part of the puzzle because thunks use their own hash as their hostname and DNS entry. It would be impossible to generate a cert ahead of time and pass it to the thunk because doing so would change the hash!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This is a big release that overhauls the networking stack and adds a new kind of value: a thunk addr.
thunk ports & addrs
Thunks can now provide TCP ports using
with-port
which can be referenced withaddr
to construct a thunk addr:A thunk addr is a lot like a thunk path except it represents to a TCP address instead of a filesystem path.
When using a thunk addr you don't need to worry about managing the lifecycle of the service that the thunk represents. The service will be run lazily, de-duplicated across multiple Bass runs, and stopped when all clients go away.
The advantage of this approach over traditional service lifecycle management parallels the advantages of using thunk paths instead of managing state in a local filesystem. It allows thunks that depend on services provided by other thunks to remain reproducible, just like thunks that depend on files created by other thunks.
bridge networking & DNS
To prevent port collisions, thunks no longer run in the host network. Instead they run in a bridge network where each thunk has its own IP and reaches other thunks using DNS.
Using DNS is important because IPs are not reproducible. If thunks reached each other using direct container IPs then caches would be busted every time a service runs.
Now that thunks run in their own network, you can't use Bass to run and expose services to the host machine. This may be added in a future release via port forwarding. Alternatively you could take the
path-name
(a bit of a misnomer) of the thunk and reverse-proxy to its container port using the same DNS server that thunks use.automatic TLS
Thunks may also use TLS. A unique "bass" certificate authority is generated by the runtime and automaticaly trusted by all thunks that it runs.
To generate a certificate for a thunk, use
with-tls
:Generating TLS certs is a necessary part of the puzzle because thunks use their own hash as their hostname and DNS entry. It would be impossible to generate a cert ahead of time and pass it to the thunk because doing so would change the hash!
What's Changed
Breaking Changes⚠️
(with-env)
is additive,null
values act as tombstones by @vito in(with-env)
is additive,null
values act as tombstones #228New Features ✨
bass --bump
, + backwards compat. fixes by @vito in support multiple .locks inbass --bump
, + backwards compat. fixes #226Fixed Bugs 🐛
Other Changes
New Contributors
Full Changelog: v0.9.0...v0.10.0
This discussion was created from the release v0.10.0.
Beta Was this translation helpful? Give feedback.
All reactions