Skip to content

Commit

Permalink
chore: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
saibatizoku committed Jan 29, 2024
1 parent d22b8d8 commit 7b95375
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

## HDF5 file structure

TODO

```kroki-d2
@from_file:architecture/08_concepts/hermes_packaging_requirements/images/application_metadata.dot
```
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
# Hermes Application Packaging Requirements
# Packaging Overview

## Overview
Applications in Hermes are packaged and distributed using [HDF5](https://docs.hdfgroup.org/hdf5/develop/) (Hierarchical Data Format Version 5) files.

## Hermes HDF5 File Metadata

## Hermes HDF5 File Structure

```kroki-d2
@from_file:architecture/08_concepts/hermes_packaging_requirements/images/hdf5_file_structure.dot
```

TODO

** SJ Notes **

Each package needs metadata which can be associated with it.
So we may want to define that in its own file.
Example metadata are similar to a webasm module.
1. App Author
2. Version
3. Repo
4. License
5. Description
6. Json Schema for its configuration, so a user can configure it.
1. This is the only config a user actually sets, it will embed (and can have references to that config) from individual wasm modules.
2. We need to work out how this will work and define it.
7. other stuff

1. App Author
2. Version
3. Repo
4. License
5. Description
6. Json Schema for its configuration, so a user can configure it.

1. This is the only config a user actually sets, it will embed (and can have references to that config) from individual wasm modules.
2. We need to work out how this will work and define it.

7. other stuff

We also need to sign the package, and it needs to be able to support multisig, so it can be signed by the Author and then countersigned by a publisher.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
# Packaging WebAssembly (WASM) modules in a Hermes Application

TODO
```kroki-d2
@from_file:architecture/08_concepts/hermes_packaging_requirements/images/wasm_module_metadata.dot
```

** SJ Notes **
Wasm modules need the following data:

1. The compiled WASM code
2. Metadata about the wasm module
1. Name
2. Author
3. Repo
4. License
5. etc.

1. Name
2. Author
3. Repo
4. License
5. etc.

4. Configuration data (Json or CBOR) that parameterises the module.

1. Json schema for "Preset" parameters. These are not changeable by the user.
2. Json schema for "Configurable" parameters. These can be set by the user before the app runs.
3. The actual "preset" parameters themselves (which must be valid according to the "preset" parameter schema.

5. All of the above should be encoded using CBOR (Needs to be defined with a valid CDDL schema).
5. A Signature of the Module Author and/or publisher validating its the code they "released".

1. For this we should wrap all the above in COSE (See: RFC-9052, RFC-9053, RFC-0338)
2. All CBOR is to be specified as needing to be encoded following the deterministic CBOR Rules. See https://developer.blockchaincommons.com/dcbor/ and https://datatracker.ietf.org/doc/draft-mcnally-deterministic-cbor/
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,33 @@ bundled in [hdf5](https://www.hdfgroup.org/solutions/hdf5/) package.
Each WASM component it is the event handlers implementation of `export` functions from the [WIT] file,
specified by the [*Hermes runtime extension*].

Package structure
## Package structure

```bash
β”œβ”€β”€ module1.wasm
β”œβ”€β”€ module2.wasm
β”œβ”€β”€ config.json
└── METADATA
/ root
β”œβ”€β”€ static
β”‚ β”œβ”€β”€ data
β”‚ β”‚ └── default
β”‚ β”‚ β”œβ”€β”€ config.json
β”‚ β”‚ └── ...
β”‚ └── www
β”‚ β”œβ”€β”€ site1
β”‚ β”‚ β”œβ”€β”€ html
β”‚ β”‚ └── ...
β”‚ └── site2
β”‚ β”œβ”€β”€ html
β”‚ └── ...
β”œβ”€β”€ data
β”‚ β”œβ”€β”€ module1_dataset
β”‚ β”œβ”€β”€ module2_dataset
β”‚ └── ...
└── module
β”œβ”€β”€ module1.wasm
β”œβ”€β”€ module2.wasm
└── ...
```


[WIT]: https://component-model.bytecodealliance.org/design/wit.html
[*Hermes runtime extension*]: ./../../05_building_block_view/hermes_core.md#hermes-runtime-extension-hre
[*Hermes application*]: ./../../05_building_block_view//hermes_core.md#hermes-application

0 comments on commit 7b95375

Please sign in to comment.