-
-
Notifications
You must be signed in to change notification settings - Fork 1
Task/vessel channel api #142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f88a4bf to
827ac2e
Compare
4 tasks
Member
|
Converting this to draft until the design outline has been added to the PR description. |
6b8e969 to
7ae4fff
Compare
jplatte
reviewed
Dec 4, 2025
jplatte
reviewed
Dec 4, 2025
jplatte
reviewed
Dec 4, 2025
7ae4fff to
7a17e57
Compare
7a17e57 to
ff2fac6
Compare
Member
|
@tarkah reports that this is running very well locally, so merging now. |
ermo
approved these changes
Dec 5, 2025
Member
ermo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Channel API
This PR adds a new
channelAPI which enables us to record a "history" of package index "versions" and human readable links to those "versions" in the way of "tags" and "streams". The following will describe these concepts and touch on some implementation details from this PR.Channel
A
channeldefines a single git recipe repo and its respectivemoss-formatrepo.vesselhandles themoss-formatside of thechanneland is what this PR implements.vesselcan work with many channels, which will eventually be included on requests tovesselfromsummit. But for now we hard-code a singlechannelcalled "main" for all operations to keepvesselbackwards compatible w/summit.Each
channelhas its own isolatedpool/directory (containing package .stone files) and "version" directories (containing package index files).Channel version
A
channel"version" describes a single package index file whichmosscan use as a repository. There are currently 3 different types ofversions- history, tags & streams.historyversions are "recorded" for every new change made. For now, each change occurs when we build a task and upload its packages tovessel. Each upload of packages records a newhistoryversionstreamversions are links tohistorythat intend to move along w/ history. We currently definevolatileandunstable:volatileis automatically updated to link to the latesthistoryversionunstableis manually updated to link to somehistoryversion after it is deemed worthy of "promotion"tagversions are links tohistorythat are intended to be immutable / never changeNote how
streamandtagversions are simply links to ahistoryversion. This means that package index files only ever live within ahistoryversion and these other types simply symlink to ahistoryversion.An example of how this looks on disk:
Pruning
Disk space can be reclaimed by ensuring that old packages can be pruned. The only packages that can be pruned are those no longer referenced by any
version, meaning not in anyhistoryversion. We therefore need a way to prune stalehistoryversions. Once "stale"historyversions are removed, the orphaned packages from those can then be cleaned up as well.A
historyversion is considered "stale" when it is not linked to by anytagorstreamversions and it is older than X time. Currently we hardcode the retention policy time to 14 days, but we intend to make this configurable either based on a retention time "rolling window" policy or some available disk space policy.Backwards compatibility
Backwards compatibility is important at this stage and we wanted to ensure 0 code changes were needed anywhere except
vessel.mainchannel is currently hardcoded, sincesummitisn't ready to deal w/ the newchannelconcept yet. It is fine to simply work with our singlemainchannel for now.historyis simply recorded on eachtaskbeing completed and published. In the future we will have a different mechanism of recording history, but for now this will work just fine.volatile/x86_64/stone.indexnow lives atstream/volatile/x86_64/stone.indexwhich is technically a breaking change, but we can useCaddyto resolvevolatile/x86_64/stone.indexasstream/volatile/x86_64/stone.index.volatile/x86_64/stone.indexURI defined will receive the redirected index file which technically has an incompatible relative path depth of../../../instead of../../but this saturates at the root/path and we can setup similar path rewrites inCaddyto resolve/pooland/volatileto the correct locationsWith the above, we can deploy this change transparently and immediately benefit from recording history / creating long lived streams & tags.
Admin CLI
New commands are added to admin CLI to
update-stream,add-tagandremove-tagupdate-streamallows one to update the link of astreamto any otherversionwhich will link it to that underlyinghistoryversion. Even thoughvolatileautomatically updates, it might be useful to roll backvolatileto older history in case a bad package is delivered & needs to be dropped, and then subsequently fixed in a newer build. Re.unstable, we can "promote" older history or tag versions to theunstablestream w/ this mechanism.add-tagallows us to manually create a newtagfrom somehistoryremove-tagallows us to manually delete old tags. This likely shouldn't ever happen but might be reasonable after some period of time to ensure very old packages can be pruned