-
Notifications
You must be signed in to change notification settings - Fork 5
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
Create diagrams for new processes implemented in vaults refactoring MR #3
Comments
@joshuakarp can you create the new pages/or attach to existing pages in the wiki. First an info-dump, then clean up the wiki structure in #4 and MatrixAI/Polykey#5 |
These diagrams will need to inform the standards by which future diagrams are drawn as well. |
For 2: started to generalise the This should be prefaced by providing a generic structure for the type ObjectMap = Map<ObjectId,
{
resource?: Object;
lock: MutexInterface;
}
>; And then the following diagram describes the process for constructing/retrieving an object in one of these locking maps: |
For 3: a simple start to visualising the in-memory and |
Best test to see where the docs make sense is to try to explain it to others and record questions. Schedule time to do this quickly in Monday sprint planning.
On 29 October 2021 10:43:07 am AEDT, Josh ***@***.***> wrote:
For 3: a simple start to visualising the in-memory and `EFS` state of a vault, according to the states a vault can be in:
![image](https://user-images.githubusercontent.com/49772421/139350841-4ec13396-0e23-4319-bf64-76186376fdc5.png)
http://www.plantuml.com/plantuml/uml/VP0n2uCm48Nt_8h3tJ_WK8JIGeVgKEWkvg22IIGv1v7-z-RYMIkbdNAyx-Mzuyf0ZQVHzEhHQGGq0qsWCRI-6wXpLgbe88IiSd1lnfuoQ09KpkARr0DQr1zKX5a1YELYSuF6-IdnQneNr-QfBPpEDpRmA_IfOAqvzYxiQaIOVqKmbmZU5_ByiAvMGEinVabXIaJcoLZm0SYxwGjBPVpEmu95swMxE6pqJtQ9LiVZlm00
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/MatrixAI/js-polykey/issues/258#issuecomment-954301836
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
@joshuakarp have you pushed the diagrams into the relevant pages on the wiki? If so, please link them up to this issue. |
My bad, should have linked them here.
Note that these diagrams are still mostly drafts. Will get some feedback in our sprint meeting today on how they could be improved. |
Thinking about how best to structure 5. For dependency injection specifically, we have the following resource: https://en.wikipedia.org/wiki/Dependency_injection#Structure The sequence diagram on the right very clearly shows the order in which things are created, but is a little tricky to show how one resource is injected into another. |
Following on from the above diagram, I've started to do something similar: I don't really like how the dependency injections aren't inherently obvious though (i.e. what we need to inject on |
From discussions in sprint meeting today, we can use a combination of two diagrams for 2 separate purposes:
|
The component diagram can show encapsulated (optional) deps by nesting the boxes, while arrows between boxes can be used for required dependencies (external) and therefore not managed by lifecycle functions. |
For 3. Based on feedback from sprint meeting, have changed the vault lifecycle diagram to the following: |
type ResourceMap = Map<ResourceId, {
object?: Object;
lock: MutexInterface;
}>; Second attempt at 2. with this new structure in mind: I'm a little wary whether the distinction between
And then do |
Suggest: type Resource = { object?: Object; lock: MutexInterface };
type Resources = Map<ResourceId, Resource>; That way we can refer to the Could wrap this up into a little library later... |
Easy, that makes sense to me. |
This is an updated ROUGH diagram of the vault cloning process. @joshuakarp will probably take bits and pieces from this to create his own. I think the pulling process should also have at least a partial diagram. Although the GRPC streaming process is exactly the same there are two key differences overall:
|
Here is a very similar one for pulling. The Part in the GRPC connection box is exactly the same, the only difference is the the before and after. Note that I haven't included any of the necessary setup for pulling a vault (needs to be cloned from a source first etc.) Also I'm not too sure what error you get when you try to pull from a vault that doesn't match your history which would probably be useful to include in this diagram or a similar one. |
@scottmmorris are you able to turn the above into plantuml so it can more easily edited/maintained given that parts get changed over time. |
@scottmmorris and I chatted, and he was going to do these 2 rough diagrams, and I'd convert them to polished plantuml versions. This way, I don't have to try to deduce the pull/clone process from the source code, and it gives me a starting point to work from. |
One quick question, is this the kind of granular detail you expect from the polished sequence diagrams @CMCDragonkai? e.g. looking at the current boxes of numbered steps that @scottmmorris has done, should these be converted to internal steps in the sequence diagram? Or should it be more general? |
Better, but can we bold Or is |
Note that the lifeline can be on Keynode A and Keynode B, as the stream's lifetime is shared between the 2. No need to create a separate line in the middle. |
My only issue with having the lifeline of the stream specifically on the lines of Keynode A and Keynode B is that it suggests that it's the lifeline of A and B, as opposed to the stream. |
The lifelines are whatever you actually annotate them to be. See https://sparxsystems.com/resources/tutorials/uml2/sequence-diagram.html how they use lifelines depending on the context. |
Yeah that's true, this seems fine to me too |
Yea that's alot clearer. Is there a specific type used for commit objects and commit OIDs? Do you want to do say I would want to label that the Another idea:
So you know it's part of the same Btw, You use And also just |
There is no specific type for the commit objects and OIDs, they are just buffers. Yes there is actually two responses, the metadata containing the vault name and id and then the stream of OIDs. The stream of OIDs is sent straight to iso-git whereas we use the metadata. I didn't know if there was a way to combine them into one response because one is a stream and the other isnt, just a unary response. I can't have two I added in a self call which explains that isomophic git is using http, it directly points to the lifecycle of the GET/POST requests so that might be the best way of doing it. |
You can do something like this in plantuml, so that the participants share the same name but use a different internal label when defining transitions:
|
Nice, edited the diagram above to include that so I don't clutter this thread with too many images. |
async-init changes have had an impact on the order of creation diagram. i.e. concurrent order vs a dependency order Is there a way to do this automatically with some kind of software? (e.g. like the boot dependency diagram of ordering, systemd) Would do this manually with execution of the For now, we can use the source code to do this manually (no need to do an actual diagram), just make a nested list of this for now. Use indentation for ordering of creation. |
The |
If it's easy to do, then just copy and paste for the other flows but make the change. |
@scottmmorris could you also share the raw plantuml markup to make the above diagrams? |
Vault Pulling:
|
Vault Cloning
|
Vault Cloning with invalid permissions
|
@pablo.padillo so this is an example of "reference" documentation, not tutorials, not theory, not how-to guides. And it is in fact a human written reference unlike auto-generated reference. |
Recent changes in vaults/git refactoring probably affected all of these diagrams @tegefaulkes. |
There are some residual diagramming requirements from the vaults refactoring MR.
All of these diagrams will also need to be integrated into some reference documentation for the entire vaults domain, based on the refactoring efforts.
Tasks
cloneVault
/pullVault
functionality https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/205#note_681727197 - may be a good idea to be done concurrently with the vault sharing testingNodeConnection
creation https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/205#note_704400712 and theVaultMap
(potentially may need something separate for the indexing operations for vault creation https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/205#note_700844380 - see Integrate autoindexing into thevaults
domain Polykey#257)version
allowable transitions https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/205#note_692001869 current status here and further information in this thread https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/205#note_697093105The text was updated successfully, but these errors were encountered: