Skip to content

Commit 4badd2d

Browse files
committed
Add Go upload instructions
1 parent 1ce250e commit 4badd2d

File tree

3 files changed

+28
-13
lines changed

3 files changed

+28
-13
lines changed

docs/cli.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ This includes:
628628
- Building your module for different architectures using cloud runners
629629
- Building a module locally and running it on a target device. Rebuilding & restarting if already running.
630630

631-
See [Upload a custom module](/how-tos/upload-module/) and [Update an existing module](/how-tos/manage-modules/#update-an-existing-module) for more information.
631+
See [Upload a module](/how-tos/upload-module/) and [Update an existing module](/how-tos/manage-modules/#update-an-existing-module) for more information.
632632

633633
If you update and release your module as part of a continuous integration (CI) workflow, you can also
634634
[automatically upload new versions of your module on release](/how-tos/manage-modules/#update-an-existing-module-using-a-github-action) using a GitHub Action.
@@ -718,7 +718,7 @@ viam module upload --version=1.0.0 --platform=darwin/arm64 packaged-module.tar.g
718718
| `--org-id` | The organization ID to associate the module to. See [Using the `--org-id` argument](#using-the---org-id-and---public-namespace-arguments) | `create`, `upload` | **Required** |
719719
| `--public-namespace` | The [namespace](/cloud/organizations/#create-a-namespace-for-your-organization) to associate the module to. See [Using the `--public-namespace` argument](#using-the---org-id-and---public-namespace-arguments) | `create`, `upload` | **Required** |
720720
| `--platform` | The architecture of your module binary. See [Using the `--platform` argument](#using-the---platform-argument) | `upload`, `build logs` | **Required** |
721-
| `--tags` | Comma-separated list of platform tags that determine to which this binary can be deployed. Examples: `distro:debian,distro:ubuntu, os_version:22.04,os_codename:jammy`. For a machine to use an uploaded binary, all tags must be satisfied as well as the `--platform` field. <ul><li>`distro`: Distribution. You can find this in `/etc/os-release`. `"debian"` or `"ubuntu"`.</li><li>`os_version`: Operating System version. On Linux, you can find this in `/etc/os-release`. Example for linux: `22.04`. On Mac, run `sw_vers --productVersion` and use the major version only. Example for mac: `14`.</li><li>`codename`: The operating system codename. Find this in `/etc/os-release`. For example: `"bullseye"`, `"bookworm"`, or `"jammy"`.</li><li>`cuda`: Whether using CUDA compiler. Run `nvcc --version`. For example: `"true"`.</li><li>`cuda_version`: The CUDA compiler version. Run `nvcc --version`. For example: `"11"` or `"12"`.</li><li>`jetpack`: Version of the NVIDIA JetPack SDK. Run `apt-cache show nvidia-jetpack`. For example: `"5"`.</li><li>`pi`: Version of the raspberry pi: `"4"` or `"5"`.</li><li>`pifull`: Compute module or model number, for example `cm5p` or `5B`.</li></ul> | `upload` | Optional |
721+
| `--tags` | Comma-separated list of platform tags that determine to which platforms this binary can be deployed. Examples: `distro:debian,distro:ubuntu, os_version:22.04,os_codename:jammy`. For a machine to use an uploaded binary, all tags must be satisfied as well as the `--platform` field. <ul><li>`distro`: Distribution. You can find this in `/etc/os-release`. `"debian"` or `"ubuntu"`.</li><li>`os_version`: Operating System version. On Linux, you can find this in `/etc/os-release`. Example for linux: `22.04`. On Mac, run `sw_vers --productVersion` and use the major version only. Example for mac: `14`.</li><li>`codename`: The operating system codename. Find this in `/etc/os-release`. For example: `"bullseye"`, `"bookworm"`, or `"jammy"`.</li><li>`cuda`: Whether using CUDA compiler. Run `nvcc --version`. For example: `"true"`.</li><li>`cuda_version`: The CUDA compiler version. Run `nvcc --version`. For example: `"11"` or `"12"`.</li><li>`jetpack`: Version of the NVIDIA JetPack SDK. Run `apt-cache show nvidia-jetpack`. For example: `"5"`.</li><li>`pi`: Version of the raspberry pi: `"4"` or `"5"`.</li><li>`pifull`: Compute module or model number, for example `cm5p` or `5B`.</li></ul> | `upload` | Optional |
722722
| `--version` | The version of your module to set for this upload. See [Using the `--version` argument](#using-the---version-argument) | `upload` | **Required** |
723723
| `--wait` | Wait for the build to finish before outputting any logs | `build logs` | Optional |
724724

@@ -863,7 +863,7 @@ In the example above, the model namespace is set to `acme` to match the owning o
863863
If the two namespaces do not match, the command will return an error.
864864
{{% /alert %}}
865865

866-
See [Upload a custom module](/how-tos/upload-module/) and [Update an existing module](/how-tos/manage-modules/#update-an-existing-module) for a detailed walkthrough of the `viam module` commands.
866+
See [Upload a module](/how-tos/upload-module/) and [Update an existing module](/how-tos/manage-modules/#update-an-existing-module) for a detailed walkthrough of the `viam module` commands.
867867

868868
See [Modular resources](/registry/) for a conceptual overview of modules and the modular resource system at Viam.
869869

docs/how-tos/hello-world-module.md

+20-5
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ First let's generate the camera component files, and we'll add the sensor code l
205205
We will add the sensor later.
206206
- Model name: `hello-camera`
207207
- Enable cloud build: `No`
208-
- Register module: `No`
208+
- Register module: `Yes`
209209

210210
1. Hit your Enter key and the generator will generate a folder called <file>hello-world</file> containing stub files for your modular camera component.
211211

@@ -764,7 +764,10 @@ The hello world module you created is for learning purposes, not to provide any
764764
765765
{{< /expand >}}
766766
767-
To package and upload your module and make it available to configure on machines in your organization:
767+
To package (for Python) and upload your module and make it available to configure on machines in your organization:
768+
769+
{{< tabs >}}
770+
{{% tab name="Python" %}}
768771
769772
1. Package the module as an archive, run the following command from inside the <file>hello-world</file> directory:
770773
@@ -780,10 +783,22 @@ To package and upload your module and make it available to configure on machines
780783
viam module upload --version 1.0.0 --platform any module.tar.gz
781784
```
782785
783-
1. Now, if you look at the [Viam Registry page](https://app.viam.com/registry) while logged into your account, you'll be able to find your private module listed.
784-
You can configure the hello-sensor and hello-camera on your machines just as you would configure other components and services; there's no more need for local module configuration.
786+
{{% /tab %}}
787+
{{% tab name="Go" %}}
788+
789+
From within your <file>hello-world</file> directory, run the `viam module upload` CLI command to upload the module to the registry:
790+
791+
```sh {id="terminal-prompt" class="command-line" data-prompt="$"}
792+
viam module upload --version 1.0.0 --platform any .
793+
```
794+
795+
{{% /tab %}}
796+
{{< /tabs >}}
797+
798+
Now, if you look at the [Viam Registry page](https://app.viam.com/registry) while logged into your account, you'll be able to find your private module listed.
799+
You can configure the hello-sensor and hello-camera on your machines just as you would configure other components and services; there's no more need for local module configuration.
785800
786-
![The create a component menu open, searching for hello. The hello-camera and hello-sensor components are shown in the search results.](/how-tos/hello-config.png)
801+
![The create a component menu open, searching for hello. The hello-camera and hello-sensor components are shown in the search results.](/how-tos/hello-config.png)
787802
788803
For more information about uploading modules, see [Upload a module](/how-tos/upload-module/).
789804

docs/how-tos/upload-module.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Edit the newly-created `meta.json` file, and provide the required configuration
111111
<td><code>module_id</code></td>
112112
<td>string</td>
113113
<td><strong>Required</strong></td>
114-
<td>The module ID, which includes either the module <a href="/cloud/organizations/#create-a-namespace-for-your-organization">namespace</a> or <a href="/cloud/organizations/">organization-id</a>, followed by its name (pre-populated using the <code>--name</code> you provided in the <code>viam module create</code> command).
114+
<td>The module ID, which includes either the module <a href="/cloud/organizations/#create-a-namespace-for-your-organization">namespace</a> or <a href="/cloud/organizations/">organization ID</a>, followed by its name (pre-populated using the <code>--name</code> you provided in the <code>viam module create</code> command).
115115
<div class="alert alert-caution" role="alert">
116116
<h4 class="alert-heading">Caution</h4>
117117

@@ -264,7 +264,7 @@ where:
264264
You can only provide one `platform` argument at a time to the `viam module upload` command.
265265
See [Using the `--platform` argument](/cli/#using-the---platform-argument) for the full list of supported architectures.
266266
- `module-path`: provide the path to the file, directory, or compressed archive (with `.tar.gz` or `.tgz` extension) that contains your custom module code.
267-
- `tags`: provide a comma-separated list of platform tags that determine to which this binary can be deployed. See [`viam module upload`](/cli/#module).
267+
- `tags`: provide a comma-separated list of platform tags that determine to which platforms this binary can be deployed. See [`viam module upload`](/cli/#module).
268268

269269
{{% alert title="Important" color="note" %}}
270270
The `viam module upload` command only supports one `platform` argument at a time.
@@ -275,19 +275,19 @@ The Viam Registry page for your module displays the platforms your module suppor
275275

276276
For example:
277277

278-
- To upload a custom module that is defined in a single file named `my-module-file` in a local `bin` directory:
278+
- To upload a module that is defined in a single file named `my-module-file` in a local `bin` directory:
279279

280280
```sh {id="terminal-prompt" class="command-line" data-prompt="$"}
281281
viam module upload --version 1.0.0 --platform linux/amd64 ./bin/my-module-file
282282
```
283283

284-
- To upload a custom module that includes multiple files, as well as a separate entry point file, all contained with a local `bin` directory:
284+
- To upload a module that includes multiple files, as well as a separate entry point file, all contained with a local `bin` directory:
285285

286286
```sh {id="terminal-prompt" class="command-line" data-prompt="$"}
287287
viam module upload --version 1.0.0 --platform linux/amd64 ./bin
288288
```
289289

290-
- To upload a custom module that has been compressed as an archive named `packaged-module.tar.gz`:
290+
- To upload a module that has been compressed as an archive named `packaged-module.tar.gz`:
291291

292292
```sh {id="terminal-prompt" class="command-line" data-prompt="$"}
293293
viam module upload --version 1.0.0 --platform linux/amd64 packaged-module.tar.gz

0 commit comments

Comments
 (0)