Skip to content

Commit

Permalink
Merge pull request #10 from Mossaka/refresh-worlds
Browse files Browse the repository at this point in the history
feat(*): removes the distributed locking and adds http & messaging worlds
  • Loading branch information
Mossaka authored Feb 15, 2024
2 parents 39da062 + e4446ac commit 7206147
Show file tree
Hide file tree
Showing 76 changed files with 13,849 additions and 2,298 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: WebAssembly/wit-abi-up-to-date@v12
- name: ensure `./wit/deps` are in sync
run: |
curl -Lo 'wit-deps' https://github.com/bytecodealliance/wit-deps/releases/download/v0.3.2/wit-deps-x86_64-unknown-linux-musl
chmod +x ./wit-deps
./wit-deps lock --check
- uses: WebAssembly/wit-abi-up-to-date@v17
with:
wit-abi-tag: wit-abi-0.10.0
wit-bindgen: '0.17.0'
worlds: 'imports messaging-service http-service service'
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ A proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) A
- [wasi-messaging](https://github.com/WebAssembly/wasi-messaging)
- [wasi-http](https://github.com/WebAssembly/wasi-http)
- [wasi-runtime-config](https://github.com/WebAssembly/wasi-runtime-config)
- [wasi-distributed-lock-service](https://github.com/WebAssembly/wasi-distributed-lock-service)
- [wasi-sql](https://github.com/WebAssembly/wasi-sql)
- [wasi-blob-store](https://github.com/WebAssembly/wasi-blob-store)

Expand Down
2,708 changes: 2,708 additions & 0 deletions http-service.md

Large diffs are not rendered by default.

2,676 changes: 2,676 additions & 0 deletions imports.md

Large diffs are not rendered by default.

2,714 changes: 2,714 additions & 0 deletions messaging-service.md

Large diffs are not rendered by default.

2,740 changes: 2,740 additions & 0 deletions service.md

Large diffs are not rendered by default.

62 changes: 26 additions & 36 deletions wit/deps.lock
Original file line number Diff line number Diff line change
@@ -1,65 +1,55 @@
[blob-store]
url = "https://github.com/WebAssembly/wasi-blob-store/archive/main.tar.gz"
sha256 = "3add2269c3e1b167a121c3f922e2e88f4cb802f623021869c52378f235fcb3cd"
sha512 = "eb83906c982c734f11aa65e15946451c0a482a07953b673a8b1bcb2041912ec54ce85e619c17ee40b53fde7e91b88e912c3c113bbe063b19fb3ee56cf05c26e9"
[blobstore]
url = "https://github.com/WebAssembly/wasi-blobstore/archive/main.tar.gz"
sha256 = "f1829eeab5bf721b5e922b894de30d91ac6badeb1b64d6ce239353fe39c21556"
sha512 = "e34daf3ea4fbc3d9b7a6ba4399fdbf384254b309f0eacf39a7b685ef7e77ac0e26934f911c713089a9d19a2b6bd93f6eb95ca09239dc18becba7bba3fb794fd7"

[cli]
sha256 = "ce53bedad0aa34bbcde6ffd8f98348e03fa170e191aaf6bb6ca57b4915ade435"
sha512 = "489ed4e04603df4763e75d4d2d056cf363922c4865052348993febfd2c9bd10ab864fb4b72090df58dcb60d5676148a7a1e7de3a8513073afd37b4d9027ca7e7"
sha256 = "285865a31d777181b075f39e92bcfe59c89cd6bacce660be1b9a627646956258"
sha512 = "da2622210a9e3eea82b99f1a5b8a44ce5443d009cb943f7bca0bf9cf4360829b289913d7ee727c011f0f72994ea7dc8e661ebcc0a6b34b587297d80cd9b3f7e8"

[clocks]
sha256 = "1ed7e35b3f9738663854f0dd92a95bfadc410ea07170501f5c2fec0cc24e3d57"
sha512 = "ef1e23704a8a8436fd3718593d4c4d8b6d1c64dad3595b7496c0888ca14b725046f2900109800faca1bc8c14f237cdcaca791dba8284e1ad50105ab2d036825b"

[distributed-locking]
url = "https://github.com/WebAssembly/wasi-distributed-lock-service/archive/main.tar.gz"
sha256 = "5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef"
sha512 = "8efb4f73c5655351c444eb109230c556d39e2c7624e9c11abc9e3fb4b9b9254218cc5085b454a9698d085cfa92198491f07a723be4574adc70617b73eb0b6461"
sha256 = "468b4d12892fe926b8eb5d398dbf579d566c93231fa44f415440572c695b7613"
sha512 = "e6b53a07221f1413953c9797c68f08b815fdaebf66419bbc1ea3e8b7dece73731062693634731f311a03957b268cf9cc509c518bd15e513c318aa04a8459b93a"

[filesystem]
sha256 = "a19dbd57208ef649980bb4088b96606fe3549e580574dc88dafed6f8a8537b01"
sha512 = "49a798126feeb1a714162a20d282e554c70d36cbfa827dfb54685577b13d584fa15e02fd653fbb940a4fa52cece6c0ca4d7cd85f27c041a5cc99a98392d03e50"
sha256 = "498c465cfd04587db40f970fff2185daa597d074c20b68a8bcbae558f261499b"
sha512 = "ead452f9b7bfb88593a502ec00d76d4228003d51c40fd0408aebc32d35c94673551b00230d730873361567cc209ec218c41fb4e95bad194268592c49e7964347"

[http]
url = "https://github.com/WebAssembly/wasi-http/archive/main.tar.gz"
sha256 = "3d41ce13364177bdf7eea92d78d9ab302ccd5d9462cfdf074677d50244c565b1"
sha512 = "1e37c5ae0b93dfa11f722e23cf9b5589976ba1e9a6e63feed930c2ebb15289d8ca7e8fcc5213aa39e0a7e2d852ecb6885dde88f21a99f70aced5c17ef381ff72"
sha256 = "6a477cde7b058689bdef06c3e2114c9c422a55ff55b8c9e2f875d3e30df42418"
sha512 = "5c3291b050488c496f7dbe5e98983d62b22648546515774d44e3ab153772825c19c0220afaec389f423bb9dc5ec0cadc2257872e292ac102e1ffc7f46bcff039"
deps = ["cli", "clocks", "filesystem", "random", "sockets"]

[io]
url = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz"
sha256 = "7450142aeb3f1688ee2b12853344e262caf6aee0718dc0296316f7f6b3afd91f"
sha512 = "5cc0f60d190e16d6dd52a4ca2fc862f007465e7642e98061b41c90778e1f2b00aeb2543b6fadbb6a137dd548d86e9e55edcfb30388adcc6a160b4cdc29d378ec"
sha256 = "7210e5653539a15478f894d4da24cc69d61924cbcba21d2804d69314a88e5a4c"
sha512 = "49184a1b0945a889abd52d25271172ed3dc2db6968fcdddb1bab7ee0081f4a3eeee0977ad2291126a37631c0d86eeea75d822fa8af224c422134500bf9f0f2bb"

[keyvalue]
url = "https://github.com/WebAssembly/wasi-keyvalue/archive/main.tar.gz"
sha256 = "237cc9ed4f79f329a4956587facf5caed34bd77a85485c6cd5929588423044c2"
sha512 = "2d86bc162723e7c89d43dba390dff437c649c35a35d9b43ac69b33b90f1584b99f7ed297ea4fa9301b351382cd453abd7bb679e113aafa1841e20075db535d4c"
sha256 = "4ee1524f28b599c92ff9d6fae2a265d44e4e2ab41e9ac0dc3cbff1111008a4ce"
sha512 = "bf6a6628978e56e94307ef8a67546ed381343e07992419084400ee64d351c3eedaac6cf0d9889c96f22d32076b1c070d1547161787c218fcee4ff8ae08535a13"

[messaging]
url = "https://github.com/WebAssembly/wasi-messaging/archive/main.tar.gz"
sha256 = "d1e34ec5b36e63bf91e2424702512d40e3305abcc6beb53a05f43dc38822a23c"
sha512 = "3eb09a1f48fbd1274216acff0128319ee7ae88c299b8b12e4e10d70accd5ef5c392232a891b908dfce1165797c84fd45439e571470944e6255c23d6ac2d493c6"

[poll]
url = "https://github.com/WebAssembly/wasi-poll/archive/main.tar.gz"
sha256 = "065422b0ea6ccb2a9facc6b87b902eef110c53d76fc31f341a6bc8d0b0285b6a"
sha512 = "19a55cd3072a19ae6a1774723a4962e7a155a5ce89a27175e8c76020efb4d00bc92ebb78427d92bcb8effd4f0d03ebf0a0daa747ecd981b8d31d5abc2ad86423"
sha256 = "504631f5a80ac16b489c7f1fcb0facc2120ca9e7feaadfe768076df060fcd62a"
sha512 = "32d7dcc5d95be82e9bcdd7e4a19cc162e1a6e0d1c6a8870510c3a6fecf646cfedcd39ae2c365d8ee288faaebe08c7b2175281d5d7e7dc5501fd177f8f3f3057f"

[random]
sha256 = "30731531ec3453813d08765b428f34aec34ac343cbeafd9885e4e348d187ae04"
sha512 = "6656089f9297ee56cf58c2f95c466e3a22c371925404e6eb9cb5adcb37c1b92f27aaf8c2f9e690ac53ef12f90bd31ac64a84d5f5e06d3f06e24997478275327f"
sha256 = "7371d03c037d924caba2587fb2e7c5773a0d3c5fcecbf7971e0e0ba57973c53d"
sha512 = "964c4e8925a53078e4d94ba907b54f89a0b7e154f46823a505391471466c17f53c8692682e5c85771712acd88b348686173fc07c53a3cfe3d301b8cd8ddd0de4"

[runtime-config]
url = "https://github.com/WebAssembly/wasi-runtime-config/archive/main.tar.gz"
sha256 = "5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef"
sha512 = "8efb4f73c5655351c444eb109230c556d39e2c7624e9c11abc9e3fb4b9b9254218cc5085b454a9698d085cfa92198491f07a723be4574adc70617b73eb0b6461"
sha256 = "8407060a0f7df4c24f41d20167f672388a58c775be0e91a8614ed700c12617f5"
sha512 = "04c39888fca66b0ee7f180047b6f1d2548dd16782d32684ddeb7e231660211fde9720118640269ec96ab3b2be7934dfe35cce70c6fa4d3b6e8e5030bd09fbfdb"

[sockets]
sha256 = "30c07587eda24676185f175323d5195817b5678815a3f6b64b8152a5b7532493"
sha512 = "8965e112c323e4535786361d864d3b5020791ce7e48da20a6a6b9a1fbec1f78bc10e0830c640f704bd8132fada56cd8a19b48e11e60ec6d9191c08e00550c91c"
sha256 = "622bd28bbeb43736375dc02bd003fd3a016ff8ee91e14bab488325c6b38bf966"
sha512 = "5a63c1f36de0c4548e1d2297bdbededb28721cbad94ef7825c469eae29d7451c97e00b4c1d6730ee1ec0c4a5aac922961a2795762d4a0c3bb54e30a391a84bae"

[sql]
url = "https://github.com/WebAssembly/wasi-sql/archive/main.tar.gz"
sha256 = "d4a0e9c12e668699775d44ef883dc52540f4d7915a653b3389d8e3859487b1f0"
sha512 = "284926b4fbc31bb9d1218f630af54482e0c0108ae6f76ec2dbd6e7f3b6c5ead577384503b79b7da6f8a37e44c9c601231cb2527377b0ce5cb3bafee89dc9375e"
sha256 = "79a9ecbde1b28b9452e46687bda5814dfe801f86806334aad84fdbf3be57cfed"
sha512 = "b32c2e2173c5b0f737115793afb34340350d05eb856bf30ec9a14746484689b4fdbcd26b861f790787acfeb4079fddc03815a350554ed588b73427e4aa4eccea"
6 changes: 2 additions & 4 deletions wit/deps.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
keyvalue = "https://github.com/WebAssembly/wasi-keyvalue/archive/main.tar.gz"
blob-store = "https://github.com/WebAssembly/wasi-blob-store/archive/main.tar.gz"
blobstore = "https://github.com/WebAssembly/wasi-blobstore/archive/main.tar.gz"
http = "https://github.com/WebAssembly/wasi-http/archive/main.tar.gz"
messaging = "https://github.com/WebAssembly/wasi-messaging/archive/main.tar.gz"
sql = "https://github.com/WebAssembly/wasi-sql/archive/main.tar.gz"
runtime-config = "https://github.com/WebAssembly/wasi-runtime-config/archive/main.tar.gz"
distributed-locking = "https://github.com/WebAssembly/wasi-distributed-lock-service/archive/main.tar.gz"

# transitive dependencies
io = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz"
poll = "https://github.com/WebAssembly/wasi-poll/archive/main.tar.gz"
io = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz"
73 changes: 0 additions & 73 deletions wit/deps/blob-store/container.wit

This file was deleted.

23 changes: 0 additions & 23 deletions wit/deps/blob-store/data-blob.wit

This file was deleted.

45 changes: 0 additions & 45 deletions wit/deps/blob-store/types.wit

This file was deleted.

3 changes: 0 additions & 3 deletions wit/deps/blob-store/world.wit

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
// wasi-cloud Blobstore service definition
default interface blobstore {
use pkg.container.{ container }
use pkg.types.{ Error, container-name, object-id, container }
interface blobstore {
use container.{container};
use types.{error, container-name, object-id};

// creates a new empty container
create-container: func(name: container-name) -> result<container,Error>
create-container: func(name: container-name) -> result<container, error>;

// retrieves a container by name
get-container: func(name: container-name) -> result<container, Error>
get-container: func(name: container-name) -> result<container, error>;

// deletes a container and all objects within it
delete-container: func(name: container-name) -> result<_, Error>
delete-container: func(name: container-name) -> result<_, error>;

// returns true if the container exists
container-exists: func(name: container-name) -> result<bool, Error>
container-exists: func(name: container-name) -> result<bool, error>;

// copies (duplicates) an object, to the same or a different container.
// returns an error if the target container does not exist.
// overwrites destination object if it already existed.
copy-object: func(src: object-id, dest: object-id) -> result<_, Error>
copy-object: func(src: object-id, dest: object-id) -> result<_, error>;

// moves or renames an object, to the same or a different container
// returns an error if the destination container does not exist.
// overwrites destination object if it already existed.
move-object: func(src:object-id, dest: object-id) -> result<_, Error>
}
move-object: func(src:object-id, dest: object-id) -> result<_, error>;
}
66 changes: 66 additions & 0 deletions wit/deps/blobstore/container.wit
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// a Container is a collection of objects
interface container {
use wasi:io/streams@0.2.0.{
input-stream,
output-stream,
};

use types.{
container-metadata,
error,
incoming-value,
object-metadata,
object-name,
outgoing-value,
};

// this defines the `container` resource
resource container {
// returns container name
name: func() -> result<string, error>;

// returns container metadata
info: func() -> result<container-metadata, error>;

// retrieves an object or portion of an object, as a resource.
// Start and end offsets are inclusive.
// Once a data-blob resource has been created, the underlying bytes are held by the blobstore service for the lifetime
// of the data-blob resource, even if the object they came from is later deleted.
get-data: func(name: object-name, start: u64, end: u64) -> result<incoming-value, error>;

// creates or replaces an object with the data blob.
write-data: func(name: object-name, data: borrow<outgoing-value>) -> result<_, error>;

// returns list of objects in the container. Order is undefined.
list-objects: func() -> result<stream-object-names, error>;

// deletes object.
// does not return error if object did not exist.
delete-object: func(name: object-name) -> result<_, error>;

// deletes multiple objects in the container
delete-objects: func(names: list<object-name>) -> result<_, error>;

// returns true if the object exists in this container
has-object: func(name: object-name) -> result<bool, error>;

// returns metadata for the object
object-info: func(name: object-name) -> result<object-metadata, error>;

// removes all objects within the container, leaving the container empty.
clear: func() -> result<_, error>;
}

// this defines the `stream-object-names` resource which is a representation of stream<object-name>
resource stream-object-names {
// reads the next number of objects from the stream
//
// This function returns the list of objects read, and a boolean indicating if the end of the stream was reached.
read-stream-object-names: func(len: u64) -> result<tuple<list<object-name>, bool>, error>;

// skip the next number of objects in the stream
//
// This function returns the number of objects skipped, and a boolean indicating if the end of the stream was reached.
skip-stream-object-names: func(num: u64) -> result<tuple<u64, bool>, error>;
}
}
Loading

0 comments on commit 7206147

Please sign in to comment.