Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big Compute docs clarification blitz #155

Merged
merged 25 commits into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b6d9362
fix: simplify wording, add relative links
LauraLangdon Jul 13, 2022
34f5736
fix: partial draft of updates
LauraLangdon Jul 22, 2022
90a813f
fix: next draft of updates
LauraLangdon Jul 23, 2022
280c81f
more draft
LauraLangdon Jul 28, 2022
4fdc1a1
more draft
LauraLangdon Jul 29, 2022
27e9a38
fix links, change wording
LauraLangdon Aug 2, 2022
452b1f6
more link fixes and wording changes
LauraLangdon Aug 2, 2022
cc4a1b5
make penultimate changes to some compute pages, fix pagination
LauraLangdon Aug 3, 2022
46264c0
link fixes
LauraLangdon Aug 4, 2022
bcaf34f
add deployment category
LauraLangdon Aug 4, 2022
cf9cdfe
fix: typo
Aug 11, 2022
dcd191f
specify greater Node version
LauraLangdon Aug 11, 2022
2661447
remove npm upgrade since npm upgrades with Node
LauraLangdon Aug 11, 2022
f10bd82
clarify instructions
LauraLangdon Aug 15, 2022
d9848d5
Update website/docs/compute/get-started.md
LauraLangdon Aug 11, 2022
9c1a1ea
Update website/docs/compute/customizing-functions/code-editor.md
LauraLangdon Aug 18, 2022
02f1204
Update website/docs/compute/using-api.md
LauraLangdon Aug 18, 2022
4f6e7af
Apply suggestions from code review
LauraLangdon Aug 18, 2022
aed1eff
fix whitespace, typos
LauraLangdon Aug 18, 2022
7730c66
add .idea to .gitignore
LauraLangdon Aug 18, 2022
8b3c40a
delete .idea
LauraLangdon Aug 18, 2022
dcada02
add back hook points section
LauraLangdon Aug 18, 2022
7b1100d
Apply suggestions from code review
LauraLangdon Aug 18, 2022
f154e07
add words to dictionary
LauraLangdon Aug 18, 2022
2f6c137
make editor screen image smaller
LauraLangdon Aug 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '14'
- name: Upgrade NPM
node-version: '>=16.14'
LauraLangdon marked this conversation as resolved.
Show resolved Hide resolved
run: npm install -g npm
# see https://github.com/bahmutov/npm-install/issues/103#issuecomment-931226602
LauraLangdon marked this conversation as resolved.
Show resolved Hide resolved
- name: Test Build
Expand Down
8 changes: 8 additions & 0 deletions website/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions website/.idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions website/.idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions website/.idea/markdown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions website/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions website/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions website/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions website/.idea/website.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified website/docs/assets/editor-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions website/docs/atmo/concepts/static-directory.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
pagination_next: null
---

# Static Directory

An Atmo project can optionally contain a `static` directory. When present,
Expand Down
4 changes: 4 additions & 0 deletions website/docs/atmo/runnable-api/file.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
pagination_next: null
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import { MultiLanguageCodeBlock } from '@site/extensions/mlc.jsx'
Expand Down
4 changes: 4 additions & 0 deletions website/docs/atmo/runnable-api/introduction.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
pagination_prev: null
---

# Introduction to the Runnable API

import { MultiLanguageCodeBlock } from '@site/extensions/mlc.jsx'
Expand Down
4 changes: 4 additions & 0 deletions website/docs/atmo/usage/connections.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
pagination_next: null
---

# Connections

In order to build a useful application, Atmo needs to be able to connect to external resources. Currently, Atmo can connect to [NATS](https://nats.io/), [Redis](https://redis.io/), [Kafka](https://kafka.apache.org/), [MySQL](https://www.mysql.com/), and [PostgreSQL](https://www.postgresql.org/). Upcoming releases will include additional data sources as well.
Expand Down
4 changes: 4 additions & 0 deletions website/docs/atmo/usage/creating-runnables.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
pagination_prev: null
---

# Creating Runnables

:::note
Expand Down
15 changes: 0 additions & 15 deletions website/docs/compute/api-reference/api-reference.md

This file was deleted.

4 changes: 0 additions & 4 deletions website/docs/compute/building-functions/github-integration.md

This file was deleted.

12 changes: 7 additions & 5 deletions website/docs/compute/compute.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ pagination_prev: null
---
# Suborbital Compute

### The SaaS extensibility platform
![Suborbital logo](/img/suborbital-logo-wide.svg)
LauraLangdon marked this conversation as resolved.
Show resolved Hide resolved

![](/img/suborbital-logo-wide.svg)
Suborbital Compute is a platform that allows your users to write and deploy
functions and workflows that integrate into your app. Our WebAssembly-based
compute
core lets you run user code within your infrastructure while being sure you're protected from malicious code.

Suborbital Compute is a platform that allows your users to write and deploy serverless extensions for your app so they can develop custom integrations, customizations, and workflows. Our WebAssembly-based compute core lets you run user code within your infrastructure while being sure that you're protected from malicious code.

Compute is now in public beta! We are excited for you to [give it a try](https://suborbital.network) and send us your feedback.
Compute is now in public beta! We are excited for you to [give it a try](/get-started)
and send us your feedback.

Compute gives you everything you need to run your users' functions in a secure sandbox and integrate them into your product in whatever way makes sense for you. This includes a code editor, builder service, and an easy-to-use API.

Expand Down
26 changes: 0 additions & 26 deletions website/docs/compute/concepts/data-plane-vs-control-plane.md

This file was deleted.

72 changes: 72 additions & 0 deletions website/docs/compute/customizing-functions/code-editor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
pagination_prev: null
---

# Function editor

The Compute code editor is available for you to embed in your application,
so your users can build their functions quickly and easily:

![Compute editor containing a 'Hello' function](../../assets/editor-screen.png)

The editor is hosted at `https://editor.suborbital.network`, and uses URL parameters to configure its connection to your builder service.

You will host the Compute builder service in your cloud infrastructure with a configured DNS name. In order to use the editor, an HTTPS connection to the builder is required.

To launch the editor, you can either [embed the editor in a frame](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe) within your own webpage, or launch it in a new tab.

## Editor token

To authenticate the editor for a specific user to edit their own functions,
[Compute's Administrative API provides an API to create an `editor token` ](https://suborbital-compute.readme.io/reference/gettoken)
for a
given function.
LauraLangdon marked this conversation as resolved.
Show resolved Hide resolved

## Configuration

The editor is configured with URL parameters. Here's an example:

`https://editor.suborbital.network?builder=https://builder.acmeco.com&token=K78as0aslwi30l8h5lbF4lS7&ident=com.suborbital.customer&fn=add-record`

Let's break it down:

**Builder**: `?builder=https://builder.acmeco.com`

* This is the URL of your builder service
LauraLangdon marked this conversation as resolved.
Show resolved Hide resolved

**Token**: `&token=K78as0aslwi30l8h5lbF4lS7`

* The editor token retrieved from the control-plane service

**Ident**: `&ident=com.suborbital.customer`

* The identifier used when addressing your specific user, see
[Fully-qualified function names](./fully-qualified-function-names.md) for
more details

**Fn**: `&fn=add-record`

* The specific function name that the editor should load

**Namespace** (optional): `&namespace=default`

* The function namespace (if not included, the `default` namespace is used, see [Namespaces](docs/compute/customizing-functions/namespaces.md) for more details)

**Template** (optional): `&template=assemblyscript`

* The language template used for new functions. Check out our [supported
languages](../../reactr/language-support.md)!

If the `fn` in question does not exist, the editor will automatically create a new function.

## Building and deploying

Once the user has edited their function, the `build` button in the top right
will allow them to check to ensure the function builds. The builder service will build the function and then return the results to the console area.

Assuming the build succeeds, the user can choose to deploy the latest
version with the `deploy` button. If they choose not to deploy, the draft will be available to them later.

Until the user deploys the function, it will remain at the previous
version.
The [API Reference](https://suborbital-compute.readme.io/reference/api-reference) gives you details about the draft and active versions of any function.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ To create a custom function template, create a fork of the `runnable-templates`

Once the repo has been forked into your company or personal account, you can begin editing the `templates` directory to fit your needs.

For now, you are limited to one template per language, but in the future you will be able to create a set of templates for your users to choose from.
For now, you are limited to one template per language, but in the future
you'll be able to create a set of templates for your users to choose from.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a public tracking bug we can link here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing public. Private tracking issue: https://github.com/suborbital/scn/issues/556


### AssemblyScript

Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
---
pagination_next: null
---

# Fully-qualified function names

Each function uploaded by your users has a unique name called a fully-qualified function name, or FQFN. The string representation of an FQFN is as follows:

```bash
com.awesomeco.nawronuq98hqwekj198fkljbeco#default::[email protected]
|____________|___________________________|________|____________|______|
com.example.nawronuq98hqwekj198fkljbeco#default::[email protected]
|_____________|___________________________|________|____________|______|
Environment User ID Namespace Function Version
```

Here's a breakdown:

* **Environment**: your company's reverse domain; `com.awesomeco`
* **Environment**: your company's reverse domain; `com.example`
* **User ID**: The unique value that your application uses to identify your users within your system; `nawronuq98hqwekj198fkljbeco`
* **Namespace**: The namespace this function belongs to; allows for separated groups of functions based on product needs \(see [Namespaces](namespaces.md) \); `default`
* **Namespace**: The namespace this function belongs to; allows for separated groups of functions based on product needs (see [Namespaces](docs/compute/customizing-functions/namespaces.md) \); `default`
LauraLangdon marked this conversation as resolved.
Show resolved Hide resolved
* **Function**: The name of the function as chosen by the user; `record-event`
* **Version**: The version of this function \(incremented each time a user updates this function\); `v1.0.0`

## Environment name

The domain of your email address should match the `environment` you configure for Compute, i.e. if your email is `[email protected]`, your Compute environment would be called `com.awesomeco`.
The domain of your email address should match the `environment` you
configure for Compute, i.e. if your email is `[email protected]`, your
Compute environment would be called `com.example`.

## FQFN URLs

Expand All @@ -28,7 +34,7 @@ To execute a function in Compute you will use a URL representation of FQFN. To r
/{environment}.{userid}/{namespace}/{function}/{version}

Example:
/com.awesomeco.nawronuq98hqwekj198fkljbeco/default/record-event/v1.0.0
/dev.suborbital.nawronuq98hqwekj198fkljbeco/default/record-event/v1.0.0
LauraLangdon marked this conversation as resolved.
Show resolved Hide resolved
```


Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
pagination_next: null
---

# Namespaces

Within Compute, your users' functions can be organized into `namespaces` at your discretion \(you control them, not your users\). Namespaces can be used to organize groups of functions designed for different use-cases within your product.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
---
pagination_prev: null
---

# Configure capabilities

Compute functions can access a number of capabilities:

* Logger
* Logging
* HTTP requests
* GraphQL requests
* Key/value store (cache)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Configure Storage
# Configure storage

By default, Compute will store compiled functions and function source code on the local storage in your Kubernetes cluster. For greater scalability, Compute can be configured to store artifacts in cloud-based object storage like Amazon S3 or Google Cloud Storage.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Configure Webhooks
# Configure webhooks

Certain actions in Compute can trigger webhooks to notify other services of the event. The receivers of webhooks get contextually relevant information about the request Compute receiver. By default, no webhooks are configured.

Expand Down Expand Up @@ -42,8 +42,8 @@ webhooks:
headers: *commonHeaders
```

## Hook points
### `builder.function.promoted`
## Hook point
`builder.function.promoted`
LauraLangdon marked this conversation as resolved.
Show resolved Hide resolved
**Description**: Runs when an end user successfully deploys a function.

**Sample response** (JSON):
Expand Down
Loading