You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/v3/cli-reference.md
+8-14Lines changed: 8 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,9 +49,9 @@ The Spin CLI
49
49
50
50
*`add` — Scaffold a new component into an existing application
51
51
*`build` — Build the Spin application
52
-
*`deploy` — Package and upload an application to the Fermyon Cloud.
52
+
*`deploy` — Package and upload an application to a deployment environment.
53
53
*`doctor` — Detect and fix problems with Spin applications
54
-
*`login` — Log into the Fermyon Cloud.
54
+
*`login` — Log into a deployment environment.
55
55
*`new` — Scaffold a new application based on a template
56
56
*`plugins` — Install/uninstall Spin plugins
57
57
*`registry` — Commands for working with OCI registries to distribute applications
@@ -100,7 +100,7 @@ Scaffold a new component into an existing application
100
100
Build the Spin application
101
101
102
102
**Usage:** `spin USAGE:
103
-
build [OPTIONS][--][UP_ARGS]...`
103
+
build [OPTIONS][UP_ARGS]...`
104
104
105
105
###### **Arguments:**
106
106
@@ -111,14 +111,15 @@ Build the Spin application
111
111
*`-c`, `--component-id <COMPONENT_ID>` — Component ID to build. This can be specified multiple times. The default is all components
112
112
*`-f`, `--from <APP_MANIFEST_FILE>` — The application to build. This may be a manifest (spin.toml) file, or a directory containing a spin.toml file. If omitted, it defaults to "spin.toml"
113
113
*`--help <HELP>` — Print help information
114
+
*`--skip-target-checks <SKIP-TARGET-CHECKS>` — By default, if the application manifest specifies one or more deployment targets, Spin checks that all components are compatible with those deployment targets. Specify this option to bypass those target checks
114
115
*`-u`, `--up <UP>` — Run the application after building
115
116
*`--version <VERSION>` — Print version information
116
117
117
118
118
119
119
120
## `spin deploy`
120
121
121
-
Package and upload an application to the Fermyon Cloud.
122
+
Package and upload an application to a deployment environment.
122
123
123
124
**Usage:** `spin USAGE:
124
125
deploy`
@@ -151,7 +152,7 @@ Detect and fix problems with Spin applications
151
152
152
153
## `spin login`
153
154
154
-
Log into the Fermyon Cloud.
155
+
Log into a deployment environment.
155
156
156
157
**Usage:** `spin USAGE:
157
158
login`
@@ -259,9 +260,6 @@ List available or installed plugins
259
260
*`--format <FORMAT>` — The format in which to list the templates
260
261
261
262
Default value: `plain`
262
-
263
-
Possible values: `plain`, `json`
264
-
265
263
*`--help <HELP>` — Print help information
266
264
*`--installed <INSTALLED>` — List only installed plugins
267
265
*`--summary <SUMMARY>` — List latest and installed versions of plugins
@@ -285,9 +283,6 @@ Search for plugins by name
285
283
*`--format <FORMAT>` — The format in which to list the plugins
286
284
287
285
Default value: `plain`
288
-
289
-
Possible values: `plain`, `json`
290
-
291
286
*`--help <HELP>` — Print help information
292
287
*`--version <VERSION>` — Print version information
293
288
@@ -444,7 +439,7 @@ Push a Spin application to a registry
444
439
###### **Options:**
445
440
446
441
*`--annotation <ANNOTATIONS>` — Specifies the OCI image manifest annotations (in key=value format). Any existing value will be overwritten. Can be used multiple times
447
-
*`--build <BUILD>` — Specifies to perform `spin build` before pushing the application
442
+
*`--build <BUILD>` — Specifies to perform `spin build`(with the default options) before pushing the application
448
443
*`--cache-dir <CACHE_DIR>` — Cache directory for downloaded registry data
449
444
*`--compose <COMPOSE>` — Compose component dependencies before pushing the application.
450
445
@@ -566,7 +561,7 @@ Start the Spin application
566
561
567
562
###### **Options:**
568
563
569
-
*`--build <BUILD>` — For local apps, specifies to perform `spin build` before running the application.
564
+
*`--build <BUILD>` — For local apps, specifies to perform `spin build`(with the default options) before running the application.
570
565
571
566
This is ignored on remote applications, as they are already built.
572
567
*`-c`, `--component-id <COMPONENTS>` — [Experimental] Component ID to run. This can be specified multiple times. The default is all components
@@ -614,4 +609,3 @@ Build and run the Spin application, rebuilding and restarting it when files chan
You can change the configuration for Spin application features such as [application variables](./variables),
28
30
[key value storage](./kv-store-api-guide), [SQL storage](./sqlite-api-guide)
@@ -389,10 +391,19 @@ The following is an example of how an application's `runtime-config.toml` file c
389
391
type = "remote_http"
390
392
url = "http://example.com"
391
393
auth_token = "<auth_token>"
394
+
api_type = "default"
392
395
```
393
396
394
-
Currently, the remote compute option requires an user to deploy their own LLM proxy service. You can find a reference implementation of a proxy service in the [`spin-cloud-gpu plugin repository`](https://github.com/fermyon/spin-cloud-gpu/blob/main/fermyon-cloud-gpu/src/index.ts).
397
+
By default, components will not have access to the LLM models unless granted explicit access through the `component.ai_models` entry in the component manifest within `spin.toml`. See [Serverless AI](./serverless-ai-api-guide) for more details.
398
+
399
+
Remote compute supports two APIs, selected using the `api_type` field.
400
+
401
+
#### `default` API
402
+
403
+
If the `api_type` is `default`, Spin uses its own "Cloud GPU" API. This requires you to deploy your own LLM proxy service. You can find a reference implementation of a proxy service in the [`spin-cloud-gpu plugin repository`](https://github.com/fermyon/spin-cloud-gpu/blob/main/fermyon-cloud-gpu/src/index.ts).
395
404
396
405
> If you have a Fermyon Cloud account, you can deploy a proxy service there using the [`cloud-gpu` plugin](https://github.com/fermyon/spin-cloud-gpu).
397
406
398
-
By default, components will not have access to the LLM models unless granted explicit access through the `component.ai_models` entry in the component manifest within `spin.toml`. See [Serverless AI](./serverless-ai-api-guide) for more details.
407
+
#### `open_ai` API
408
+
409
+
If the `api_type` is `open_ai`, Spin uses the [OpenAI API](https://github.com/openai/openai-openapi). This API is offered by some commercial LLM providers.
-[Request Handling in Wagi](#request-handling-in-wagi)
@@ -393,6 +394,24 @@ But if you wish, and if your language supports it, you can implement the `incomi
393
394
394
395
> The WASI family of specifications, and tool support for some component model features that WASI depends on, are not yet fully stabilized. If you implement `wasi-http` directly, you may need to do some trialing to find tool versions which work together and with Spin.
395
396
397
+
## Static Responses with the HTML Trigger
398
+
399
+
You can write short, static responses within the HTTP trigger by setting `static_response` (instead of `component`):
Copy file name to clipboardExpand all lines: content/v3/manifest-reference.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,6 +151,7 @@ Each array entry contains a mix of common fields and trigger-specific fields.
151
151
|`executor`| Optional | Table | How Spin should invoke the component. If present, this is a table. The `type` key is required and may have the values `"spin"` or `"wagi"`. If omitted. the default is `{ type = "spin"}`. See [the HTTP trigger documentation](http-trigger) for details. |`{ type = "wagi" }`|
152
152
|||| If `type = "spin"` there are no other keys defined. In this case, Spin calls the component using a standard Wasm component interface. Components built using Spin SDKs or Spin interface files use this convention. |`{ type = "spin" }`|
153
153
|||| If `type = "wagi"`, Spin calls the component's "main" (`_start`) function using [a CGI-like interface](https://github.com/deislabs/wagi). Components built using languages or toolchains that do not support Wasm interfaces will need to be called in this way. In this case, the following additional keys may be set:<br/><br/>*`argv` (optional): The string representation of the `argv` list that should be passed into the handler. `${SCRIPT_NAME}` will be replaced with the script name, and `${ARGS}` will be replaced with the query parameters of the request, formatted as arguments. The default is to follow the CGI specification, and pass `${SCRIPT_NAME} ${ARGS}`<br/><br/>*`entrypoint` (optional): The name of the function to call as the entry point to this handler. By default, it is `_start` (which in most languages translates to `main` in the source code).<br/><br/>See [the HTTP trigger documentation](http-trigger) for details. |`{ type = "wagi" }`|
154
+
|`static_response`| Optional | Table | The response Spin should give to requests on this route. A route may not specify both `static_response` and `component`. The response may contain the following fields, all optional:<br/><br/>*`status_code`: The HTTP status code. Default is 200.<br/><br/>*`headers`: Table of header names and values. Default is no headers.<br/><br/>*`body`: The response body. Default is no response body. | { status_code = 404, body = "not found" } |
@@ -454,7 +455,7 @@ During loading, Spin will download the package from the registry, locate its `se
454
455
455
456
### Specifying Dependencies
456
457
457
-
Spin supports three sources for dependencies.
458
+
Spin supports four sources for dependencies.
458
459
459
460
#### Dependencies from a Registry
460
461
@@ -483,6 +484,17 @@ To use a dependency from a component on your file system, specify the following
483
484
|`path`| Required | The path to the Wasm file containing the component. |`"../validation/request-checker.wasm"`|
484
485
|`export`| Optional | The name of the export in the package. If omitted, this defaults to the name of the import. |`"more-secure:checking-it-out/web"`|
485
486
487
+
#### Dependencies from a Component in the Application
488
+
489
+
You can use a component in your application as a dependency by specifying the following fields:
|`component`| Required | The name (ID) of the component. |`"request-checker"`|
494
+
|`export`| Optional | The name of the export in the package. If omitted, this defaults to the name of the import. |`"more-secure:checking-it-out/web"`|
495
+
496
+
Components referenced as dependencies may not have any Spin runtime configuration, such as `files`, `allowed_outbound_hosts`, `variables`, etc., because these are determined by the 'main' component. They may have `build` sections.
497
+
486
498
#### Dependencies from a URL
487
499
488
500
To use a dependency from an HTTP URL, such as a GitHub release, specify the following fields:
0 commit comments