Commit Graph

10 Commits

Author SHA1 Message Date
Radu Matei b63e513fc9
Add prototype for distributing Spin applications using OCI
This commit adds experimental support for distributing Spin applications
using OCI registries.

Specifically, it uses the OCI Artifacts specification
(https://github.com/opencontainers/artifacts) to package and distribute Spin
applications.

This PR implements `spin oci push`, `spin oci pull`, and `spin oci run`
to interact with a supporting container registry - for example:

```bash
$ spin oci push ghcr.io/<username>/my-spin-application:v1
INFO spin_publish::oci::client: Pushed "https://ghcr.io/v2/<username>/my-spin-application/manifests/sha256:9f4e7eebb27c0174fe6654ef5e0f908f1edc8f625324a9f49967ccde44a6516b"
$ spin oci pull ghcr.io/<username>/my-spin-application:v1
INFO spin_publish::oci::client: Pulled ghcr.io/<username>/my-spin-application:v1@sha256:9f4e7eebb27c0174fe6654ef5e0f908f1edc8f625324a9f49967ccde44a6516b
$ spin oci run ghcr.io/<username>/my-spin-application:v1
INFO spin_publish::oci::client: Pulled ghcr.io/<username>/my-spin-application:v1@sha256:9f4e7eebb27c0174fe6654ef5e0f908f1edc8f625324a9f49967ccde44a6516b
```

Following the SIP (https://github.com/fermyon/spin/pull/1033), this PR
defines a new `config.mediaType` for a Spin application,
`application/vnd.fermyon.spin.application.v1+config`, and two media
types for the potential content that can be found in such an artifact:
`application/vnd.wasm.content.layer.v1+wasm` for a Wasm module, and
`application/vnd.wasm.content.layer.v1+data` for a static file.
(Note that the media types *can* change in a future iteration of this
experimental work if a community consensus on the media type used to
represent Wasm is reached.)
Following the SIP, this PR distributes the Spin lockfile for a given
application as the OCI configuration object.

This PR also introduces a global cache for layers and
manifests pulled from the registry. This is a content addressable cache,
and its use will be extended in the future for Wasm modules pulled from
HTTP sources.

Currently, `spin oci pull` (or `spin oci run`) will always make at least
an initial request to the registry to fetch the manifest from the
registry. After the manifest is fetched, already pulled layers will not
be pulled again.
In a future commit, the behavior of the initial manifest fetch
regardless of its existence in the cache will be controllable by a flag.

Signed-off-by: Radu Matei <radu.matei@fermyon.com>
2023-01-31 10:43:40 +00:00
Mike Tang 470b98fd39
add Cargo.lock file to .gitignore.
Signed-off-by: Mike Tang <daogangtang@gmail.com>
2022-07-17 11:20:01 +08:00
Michelle Dhanani bea23ab867
ref(.gitignore): ignore .vscode log files
Signed-off-by: Michelle Dhanani <michelle@fermyon.com>
2022-05-18 18:06:17 -04:00
Radu Matei 127907b313
docs: update documentation website
This commit updates the documentation website with more sections,
language guides for Rust and Go, as well as example for embedding.

Signed-off-by: Radu Matei <radu.matei@fermyon.com>
2022-03-22 01:24:09 +02:00
Radu Matei d0f0f13a82
feat: initial add for (Tiny)Go SDK
Signed-off-by: Radu Matei <radu.matei@fermyon.com>
2022-03-09 16:52:58 +02:00
Radu Matei 9869be2045
docs: add package.json file to watch for changes in docs website
Signed-off-by: Radu Matei <radu.matei@fermyon.com>
2022-03-09 04:39:05 +02:00
Radu Matei 9c6cde1707
chore: update the Spin CLI to work with new HTTP engine
This commit updates the Spin CLI to handle the new HTTP engine.
In this process, it temporarily removes all support for pulling a remote
bindle, which will be re-introduced in a future commit.

Signed-off-by: Radu Matei <radu.matei@fermyon.com>
2022-02-06 00:29:58 +02:00
Radu Matei 1d2d07060d
chore: update wai-bindgen to latest revision
Signed-off-by: Radu Matei <radu.matei@fermyon.com>
2021-11-09 12:29:45 -08:00
Radu Matei f5bf355965
Add a very simple Engine
This commit adds a very simple engine implementation that can be used
to generate an execution context based on a WITX definition, and run
WebAssembly components that implement the WITX.

The implementation uses Wasmtime and `witx-bindgen`, and the test is
an echo implementation written in Rust.

Currently, the implementation does not test additional features, such as
custom linker imports.

Signed-off-by: Radu Matei <radu.matei@fermyon.com>
2021-11-02 01:40:52 -07:00
Radu Matei 308c266925
Initial commit
Signed-off-by: Radu Matei <radu.matei@fermyon.com>
2021-11-01 19:13:46 -07:00