mirror of https://github.com/wasmCloud/wadm.git
chore: update READMEs
Signed-off-by: Brooks Townsend <brooksmtownsend@gmail.com>
This commit is contained in:
parent
39a0857a4b
commit
66f54eed4c
21
README.md
21
README.md
|
|
@ -23,7 +23,7 @@ Wadm is a Wasm-native orchestrator for managing and scaling declarative wasmClou
|
|||
|
||||
You can easily run **wadm** by downloading the [`wash`](https://wasmcloud.com/docs/installation) CLI, which automatically launches wadm alongside NATS and a wasmCloud host when you run `wash up`. You can use `wash` to query, create, and deploy applications.
|
||||
|
||||
```
|
||||
```bash
|
||||
wash up -d # Start NATS, wasmCloud, and wadm in the background
|
||||
```
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ Follow the [wasmCloud quickstart](https://wasmcloud.com/docs/tour/hello-world) t
|
|||
|
||||
If you prefer to run **wadm** separately and/or connect to running wasmCloud hosts, you can instead opt for using the latest GitHub release artifact and executing the binary. Simply replace the latest version, your operating system, and architecture below. Please note that wadm requires a wasmCloud host version >=0.63.0
|
||||
|
||||
```
|
||||
```bash
|
||||
# Install wadm
|
||||
curl -fLO https://github.com/wasmCloud/wadm/releases/download/<version>/wadm-<version>-<os>-<arch>.tar.gz
|
||||
tar -xvf wadm-<version>-<os>-<arch>.tar.gz
|
||||
|
|
@ -68,7 +68,7 @@ spec:
|
|||
- name: httpserver
|
||||
type: capability
|
||||
properties:
|
||||
image: ghcr.io/wasmcloud/http-server:0.21.0
|
||||
image: ghcr.io/wasmcloud/http-server:0.22.0
|
||||
traits:
|
||||
# Link the HTTP server and set it to listen on the local machine's port 8080
|
||||
- type: link
|
||||
|
|
@ -77,15 +77,16 @@ spec:
|
|||
namespace: wasi
|
||||
package: http
|
||||
interfaces: [incoming-handler]
|
||||
source_config:
|
||||
- name: default-http
|
||||
properties:
|
||||
ADDRESS: 127.0.0.1:8080
|
||||
source:
|
||||
config:
|
||||
- name: default-http
|
||||
properties:
|
||||
ADDRESS: 127.0.0.1:8080
|
||||
```
|
||||
|
||||
Then use `wash` to deploy the manifest:
|
||||
|
||||
```
|
||||
```bash
|
||||
wash app deploy hello.yaml
|
||||
```
|
||||
|
||||
|
|
@ -93,7 +94,7 @@ wash app deploy hello.yaml
|
|||
|
||||
When you're done, you can use `wash` to undeploy the application:
|
||||
|
||||
```
|
||||
```bash
|
||||
wash app undeploy hello-world
|
||||
```
|
||||
|
||||
|
|
@ -122,7 +123,7 @@ spec:
|
|||
|
||||
Then simply deploy the new manifest:
|
||||
|
||||
```
|
||||
```bash
|
||||
wash app deploy hello.yaml
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -16,9 +16,13 @@ The following is a list of the `traits` wasmCloud has added via customization to
|
|||
- `spreadscaler` - Defines the spread of instances of a particular entity across multiple hosts with affinity requirements
|
||||
- `link` - A link definition that describes a link between a component and a capability provider or a component and another component
|
||||
|
||||
## JSON Schema
|
||||
|
||||
A JSON schema is automatically generated from our Rust structures and is at the root of the repository: [oam.schema.json](../oam.schema.json).
|
||||
|
||||
## Example Application YAML
|
||||
|
||||
The following is an example YAML file describing an ALC application
|
||||
The following is an example YAML file describing an application
|
||||
|
||||
```yaml
|
||||
apiVersion: core.oam.dev/v1beta1
|
||||
|
|
@ -26,8 +30,7 @@ kind: Application
|
|||
metadata:
|
||||
name: my-example-app
|
||||
annotations:
|
||||
version: v0.0.1
|
||||
description: 'This is my app'
|
||||
description: 'This is my app revision 2'
|
||||
spec:
|
||||
components:
|
||||
- name: userinfo
|
||||
|
|
@ -47,25 +50,28 @@ spec:
|
|||
requirements:
|
||||
zone: us-west-1
|
||||
weight: 20
|
||||
- type: linkdef
|
||||
properties:
|
||||
target: webcap
|
||||
values:
|
||||
port: '8080'
|
||||
|
||||
- name: webcap
|
||||
type: capability
|
||||
properties:
|
||||
contract: wasmcloud:httpserver
|
||||
image: wasmcloud.azurecr.io/httpserver:0.13.1
|
||||
link_name: default
|
||||
traits:
|
||||
- type: link
|
||||
properties:
|
||||
target:
|
||||
name: userinfo
|
||||
config: []
|
||||
namespace: wasi
|
||||
package: http
|
||||
interfaces:
|
||||
- incoming-handler
|
||||
source:
|
||||
config: []
|
||||
|
||||
- name: ledblinky
|
||||
type: capability
|
||||
properties:
|
||||
image: wasmcloud.azurecr.io/ledblinky:0.0.1
|
||||
contract: wasmcloud:blinkenlights
|
||||
# default link name is "default"
|
||||
traits:
|
||||
- type: spreadscaler
|
||||
properties:
|
||||
|
|
@ -74,5 +80,5 @@ spec:
|
|||
- name: haslights
|
||||
requirements:
|
||||
ledenabled: 'true'
|
||||
# default weight is 100
|
||||
# default weight is 100
|
||||
```
|
||||
|
|
|
|||
|
|
@ -1,411 +0,0 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "http://oam.dev/v1/oam.application_configuration.schema.json",
|
||||
"title": "Manifest",
|
||||
"description": "A JSON Schema to validate wasmCloud Application Deployment Manager (WADM) manifests",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"description": "The specific version of the Open Application Model specification in use"
|
||||
},
|
||||
"kind": {
|
||||
"type": "string",
|
||||
"description": "The entity type being described in the manifest"
|
||||
},
|
||||
"metadata": {
|
||||
"type": "object",
|
||||
"description": "Application configuration metadata.",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"annotations": {
|
||||
"type": "object",
|
||||
"description": "A set of string key/value pairs used as arbitrary annotations on this application configuration.",
|
||||
"properties": {
|
||||
"description": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"type": "object",
|
||||
"description": "Configuration attributes for various items in the lattice",
|
||||
"$ref": "#/definitions/manifestSpec"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"apiVersion",
|
||||
"kind",
|
||||
"metadata",
|
||||
"spec"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"definitions": {
|
||||
"manifestSpec": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"components": {
|
||||
"type": "array",
|
||||
"description": "Component instance definitions.",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/wasmComponent"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/providerComponent"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"components"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"opconfigVariable": {
|
||||
"type": "object",
|
||||
"description": "The Variables section defines variables that may be used elsewhere in the application configuration. The variable section provides a way for an application operator to specify common values that can be substituted into multiple other locations in this configuration (using the [fromVariable(VARNAME)] syntax).",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The parameter's name. Must be unique per configuration.",
|
||||
"$comment": "Some systems have upper bounds for name length. Do we limit here?",
|
||||
"maxLength": 128
|
||||
},
|
||||
"value": {
|
||||
"type": "string",
|
||||
"description": "The scalar value."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"value"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"applicationScope": {
|
||||
"type": "object",
|
||||
"description": "The scope section defines application scopes that will be created with this application configuration.",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the application scope. Must be unique to the deployment environment."
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "The fully-qualified GROUP/VERSION.KIND name of the application scope."
|
||||
},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
"description": "The properties attached to this scope.",
|
||||
"$ref": "#/definitions/propertiesObject"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"wasmComponent": {
|
||||
"type": "object",
|
||||
"description": "This section defines the instances of components to create with this application configuration.",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the component to create an instance of."
|
||||
},
|
||||
"type": {
|
||||
"description": "The type of instance : component.",
|
||||
"anyOf": [
|
||||
{
|
||||
"const": "component"
|
||||
},
|
||||
{
|
||||
"const": "actor",
|
||||
"$comment": "Deprecated: use 'component' instead"
|
||||
}
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
"description": "Overrides of parameters that are exposed by the application scope type defined in 'type'.",
|
||||
"$ref": "#/definitions/componentProperties"
|
||||
},
|
||||
"traits": {
|
||||
"type": "array",
|
||||
"description": "Specifies the traits to attach to this component instance.",
|
||||
"items": {
|
||||
"$ref": "#/definitions/trait"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"properties"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"providerComponent": {
|
||||
"type": "object",
|
||||
"description": "This section defines the instances of providers to create with this application configuration.",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the provider to create an instance of."
|
||||
},
|
||||
"type": {
|
||||
"description": "The type of instance: capability.",
|
||||
"const": "capability"
|
||||
},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
"description": "Overrides of parameters that are exposed by the application scope type defined in 'type'.",
|
||||
"$ref": "#/definitions/providerProperties"
|
||||
},
|
||||
"traits": {
|
||||
"type": "array",
|
||||
"description": "Specifies the traits to attach to this component instance.",
|
||||
"items": {
|
||||
"$ref": "#/definitions/trait"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"type",
|
||||
"properties"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"componentProperties": {
|
||||
"type": "object",
|
||||
"description": "Values supplied to parameters that are used to override the parameters exposed by other types.",
|
||||
"properties": {
|
||||
"image": {
|
||||
"type": "string",
|
||||
"description": "The image reference to use for the component.",
|
||||
"$comment": "Some systems have upper bounds for name length. Do we limit here?",
|
||||
"maxLength": 512
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": "The component identifier to use for the component. Will be autogenerated if not supplied.",
|
||||
"maxLength": 64
|
||||
},
|
||||
"config": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/configProperty"
|
||||
},
|
||||
"default": [],
|
||||
"description": "Configuration properties for the provider"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"providerProperties": {
|
||||
"type": "object",
|
||||
"description": "Values supplied to parameters that are used to override the parameters exposed by other types.",
|
||||
"properties": {
|
||||
"image": {
|
||||
"type": "string",
|
||||
"description": "The image reference to use for the provider.",
|
||||
"$comment": "Some systems have upper bounds for name length. Do we limit here?",
|
||||
"maxLength": 512
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": "The component identifier to use for the provider.",
|
||||
"maxLength": 64
|
||||
},
|
||||
"config": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/configProperty"
|
||||
},
|
||||
"default": [],
|
||||
"description": "Configuration properties for the provider"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"trait": {
|
||||
"type": "object",
|
||||
"description": "The trait section defines traits that will be used in a component instance.",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "The trait type for the instance, whether spreadscaler or link"
|
||||
},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
"description": "Overrides of parameters that are exposed by the trait type defined in 'type'.",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/linkProperties"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/spreadscalerProperties"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"properties"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"configProperty": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"linkProperties": {
|
||||
"target": {
|
||||
"type": "string",
|
||||
"description": "The target this link applies to. This should be the name of a component in the manifest"
|
||||
},
|
||||
"namespace": {
|
||||
"type": "string",
|
||||
"description": "WIT namespace for the link"
|
||||
},
|
||||
"package": {
|
||||
"type": "string",
|
||||
"description": "WIT package for the link"
|
||||
},
|
||||
"interfaces": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "WIT interfaces for the link"
|
||||
},
|
||||
"source_config": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/configProperty"
|
||||
},
|
||||
"default": [],
|
||||
"description": "Configuration properties for the source of the link"
|
||||
},
|
||||
"target_config": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/configProperty"
|
||||
},
|
||||
"default": [],
|
||||
"description": "Configuration properties for the target of the link"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of this link",
|
||||
"default": null
|
||||
},
|
||||
"required": [
|
||||
"target",
|
||||
"namespace",
|
||||
"package",
|
||||
"interfaces"
|
||||
]
|
||||
},
|
||||
"spreadscalerProperties": {
|
||||
"type": "object",
|
||||
"description": "A properties object (for spreadscaler configuration) is an object whose structure is determined by the spreadscaler property schema. It may be a simple value, or it may be a complex object.",
|
||||
"properties": {
|
||||
"instances": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "integer",
|
||||
"title": "instances"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"title": "replicas"
|
||||
}
|
||||
]
|
||||
},
|
||||
"spread": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"description": "A spread object for spreading instances.",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"requirements": {
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"weight": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"requirements"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"oneOf": [
|
||||
{
|
||||
"required": [
|
||||
"instances"
|
||||
]
|
||||
},
|
||||
{
|
||||
"required": [
|
||||
"replicas"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"propertiesObject": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"description": "A properties object (for trait and scope configuration) is an object whose structure is determined by the trait or scope property schema. It may be a simple value, or it may be a complex object.",
|
||||
"additionalProperties": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "A properties object (for trait and scope configuration) is an object whose structure is determined by the trait or scope property schema. It may be a simple value, or it may be a complex object."
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue