Skip to content

Commit

Permalink
Move naming information
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel committed Nov 4, 2023
1 parent 371e26f commit a181566
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 23 deletions.
1 change: 0 additions & 1 deletion docs/registry/examples/csi.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ tags:
aliases:
- "/extend/registry/examples/csi/"
- "/modular-resources/examples/csi/"

# SMEs: Sean
---

Expand Down
63 changes: 41 additions & 22 deletions docs/registry/upload/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,6 @@ Once you have [created a custom module](/registry/create/), use the [Viam CLI](/

Once uploaded, you can also [update your modules](/registry/upload/#update-an-existing-module).

#### Naming your model: namespace:repo-name:name

If you are [creating a custom module](/registry/create/) and want to [upload that module](/registry/upload/) to the Viam registry, ensure your model name meets the following requirements:

- The namespace of your model **must** match the [namespace of your organization](/manage/fleet/organizations/#create-a-namespace-for-your-organization).
For example, if your organization uses the `acme` namespace, your models must all begin with `acme`, like `acme:demo:mybase`.
- Your model triplet must be all-lowercase.
- Your model triplet may only use alphanumeric (`a-z` and `0-9`), hyphen (`-`), and underscore (`_`) characters.

For the middle segment of your model triplet `repo-name`, use the name of the git repository where you store your module's code.
The `repo-name` should describe the common functionality provided across the model or models of that module.

For example:

- The `rand:yahboom:arm` model and the `rand:yahboom:gripper` model uses the repository name [yahboom](https://github.com/viam-labs/yahboom).
The models implement the `rdk:component:arm` and the `rdk:component:gripper` API to support the Yahboom DOFBOT arm and gripper, respectively.
- The `viam-labs:audioout:pygame` model uses the repository name [audioout](https://github.com/viam-labs/audioout)
It implements the custom API `viam-labs:service:audioout`.

The `viam` namespace is reserved for models provided by Viam.

## Upload a custom module

To upload your custom module to the [Viam registry](https://app.viam.com/registry), either as a public or private module, use the Viam CLI commands `create`, `upload`, and `update` following these instructions:
Expand Down Expand Up @@ -133,7 +112,7 @@ If you mark your module as public, you cannot change it back to private.
<td><code>models</code></td>
<td>object</td>
<td><strong>Required</strong></td>
<td>A list of one or more <a href="/registry/key-concepts/#models">models</a> provided by your custom module. You must provide at least one model, which consists of an <code>api</code> and <code>model</code> key pair. If you are publishing a public module (<code>"visibility": "public"</code>), the <a href="/registry/key-concepts/#naming-your-model-namespacerepo-namename">namespace of your model</a> must match the <a href="/manage/fleet/organizations/#create-a-namespace-for-your-organization">namespace of your organization</a>.</td>
<td><p>A list of one or more {{< glossary_tooltip term_id="model" text="models" >}} provided by your custom module. You must provide at least one model, which consists of an <code>api</code> and <code>model</code> key pair. If you are publishing a public module (<code>"visibility": "public"</code>), the <a href="#naming-your-model-namespacerepo-namename">namespace of your model</a> must match the <a href="/manage/fleet/organizations/#create-a-namespace-for-your-organization">namespace of your organization</a>.</p><p>For more information, see <a href="#naming-your-model-namespacerepo-namename">naming your model</a>.</p></td>
</tr>
<tr>
<td><code>entrypoint</code></td>
Expand Down Expand Up @@ -372,6 +351,46 @@ For more details, see the [`upload-module` GitHub Action documentation](https://
- [Golang](https://github.com/viam-labs/wifi-sensor)
- [C++](https://github.com/viamrobotics/module-example-cpp)

## Naming your model: namespace:repo-name:name

If you are [creating a custom module](/registry/create/) and want to [upload that module](/registry/upload/) to the Viam registry, ensure your model name meets the following requirements:

- The namespace of your model **must** match the [namespace of your organization](/manage/fleet/organizations/#create-a-namespace-for-your-organization).
For example, if your organization uses the `acme` namespace, your models must all begin with `acme`, like `acme:demo:mybase`.
- Your model triplet must be all-lowercase.
- Your model triplet may only use alphanumeric (`a-z` and `0-9`), hyphen (`-`), and underscore (`_`) characters.

For the middle segment of your model triplet `repo-name`, use the name of the git repository where you store your module's code.
The `repo-name` should describe the common functionality provided across the model or models of that module.
For example:
- The `rand:yahboom:arm` model and the `rand:yahboom:gripper` model uses the repository name [yahboom](https://github.com/viam-labs/yahboom).
The models implement the `rdk:component:arm` and the `rdk:component:gripper` API to support the Yahboom DOFBOT arm and gripper, respectively:
```json
{
"api": "rdk:component:arm",
"model": "rand:yahboom:arm"
},
{
"api": "rdk:component:gripper",
"model": "rand:yahboom:gripper"
}
```
- The `viam-labs:audioout:pygame` model uses the repository name [audioout](https://github.com/viam-labs/audioout)
It implements the custom API `viam-labs:service:audioout`:
```json
{
"api": "viam-labs:service:audioout",
"model": "viam-labs:audioout:pygame"
}
```
The `viam` namespace is reserved for models provided by Viam.
## Next Steps
{{< cards >}}
Expand Down

0 comments on commit a181566

Please sign in to comment.