-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'staging' into jm/ext-ts-guest-new
Signed-off-by: Daniel Phillips <[email protected]>
- Loading branch information
Showing
14 changed files
with
111 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,25 +31,25 @@ the guides for your Guest Language below to install the toolchain. | |
## Create a New Function | ||
|
||
Once you have the Scale CLI and the toolchain for your Guest Language installed, you can create a new function by | ||
running the following command: | ||
running the following command, passing a `<name>:<tag>` pair to the `new` command: | ||
|
||
```bash | ||
scale new hello-world | ||
scale new hello:1.0 | ||
``` | ||
|
||
This will create a new scale function in the current directory. You can also specify a different directory by passing the | ||
`--directory` or `-d` flag: | ||
|
||
```bash | ||
scale new hello-world -d /path/to/directory | ||
scale new hello:1.0 -d /path/to/directory | ||
``` | ||
|
||
<Note> | ||
By default, the CLI will create a new function using Golang as the Guest Language. If you want to use Rust instead, | ||
you can pass the `--language` or `-l` flag: | ||
|
||
```bash | ||
scale new hello-world -l rust | ||
scale new hello:1.0 -l rust | ||
``` | ||
</Note> | ||
|
||
|
@@ -60,8 +60,8 @@ The following files will be created in the directory depending on the language y | |
<CodeGroup> | ||
```yaml scalefile | ||
version: v1alpha | ||
name: hello-world | ||
tag: latest | ||
name: hello | ||
tag: 1.0 | ||
signature: [email protected] | ||
language: go | ||
dependencies: | ||
|
@@ -104,8 +104,8 @@ The following files will be created in the directory depending on the language y | |
<CodeGroup> | ||
```yaml scalefile | ||
version: v1alpha | ||
name: hello-world | ||
tag: latest | ||
name: hello | ||
tag: 1.0 | ||
signature: [email protected] | ||
language: rust | ||
dependencies: | ||
|
@@ -176,14 +176,14 @@ interfaces it provides, you can check out the [HTTP Signature Reference](/signat | |
Once you've created a new function, you can build it by running the following command: | ||
|
||
```bash | ||
scale build | ||
scale function build | ||
``` | ||
|
||
This will build the function and save it to the `Cache Directory` (which defaults to `~/.config/scale/functions` on Linux and macOS). | ||
You can also specify a different directory by passing the `--cache-directory` flag: | ||
|
||
```bash | ||
scale build --cache-directory /path/to/directory | ||
scale function build --cache-directory /path/to/directory | ||
``` | ||
|
||
<Info> | ||
|
@@ -200,22 +200,22 @@ scale function list | |
``` | ||
NAME (1) TAG ORG LANGUAGE SIGNATURE HASH VERSION | ||
------------------- -------- ------------- ---------- ------------- ------------------------------------------------------------------ --------- | ||
hello-world latest rust [email protected] 8dad03b701cd124b55ff5caf7a36a9af5d19759fc73a9e8299bea4816f929777 v1alpha | ||
hello 1.0 local rust [email protected] 8dad03b701cd124b55ff5caf7a36a9af5d19759fc73a9e8299bea4816f929777 v1alpha | ||
``` | ||
|
||
## Run the Function | ||
|
||
Once you've built the function, you can run it by running the following command: | ||
|
||
```bash | ||
scale run hello-world:latest | ||
scale run local/hello:1.0 | ||
``` | ||
|
||
This will start a local HTTP server on port `8080` and will run the function whenever you make a request to it. You can | ||
also specify a different port by passing the `--listen` or `-l` flag: | ||
|
||
```bash | ||
scale run hello-world:latest -l :3000 | ||
scale run local/hello:1.0 -l :3000 | ||
``` | ||
|
||
<Note> | ||
|
@@ -270,14 +270,14 @@ scale auth status | |
Once you've authenticated with the Scale API, you can push your function to the Scale Registry by running the following command: | ||
|
||
```bash | ||
scale push hello-world:latest | ||
scale function push hello:1.0 | ||
``` | ||
|
||
This will push the function to the Scale Registry and make it available for use in your existing services. By default | ||
the function will be private, but you can make it public by passing the `--public` flag: | ||
|
||
```bash | ||
scale push hello-world:latest --public | ||
scale function push hello:1.0 --public | ||
``` | ||
|
||
<Note> | ||
|
@@ -292,7 +292,7 @@ Once you've pushed a function to the Scale Registry, you can pull it and use it | |
you can run the following command: | ||
|
||
```bash | ||
scale pull <your organization>/hello-world:latest | ||
scale function pull <your organization>/hello:1.0 | ||
``` | ||
|
||
<Note> | ||
|
@@ -306,7 +306,7 @@ This will pull the function from the Scale Registry and save it to the `Cache Di | |
You can also specify a different directory by passing the `--cache-directory` flag: | ||
|
||
```bash | ||
scale pull <your organization>/hello-world:latest --cache-directory /path/to/directory | ||
scale function pull <your organization>/hello:1.0 --cache-directory /path/to/directory | ||
``` | ||
|
||
<Note> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.