Skip to content

DOCS-3962: Tweak local module instructions #4330

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

Merged
merged 3 commits into from
May 23, 2025
Merged
Changes from 1 commit
Commits
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
12 changes: 4 additions & 8 deletions docs/operate/get-started/other-hardware/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ On your machine's **CONFIGURE** tab in the [Viam app](https://app.viam.com), cli
Select **Local module**, then **Local module**.

Enter the absolute path to the <file>run.sh</file> script, for example `/home/jessamy/my-module/run.sh` on Linux, or `/Users/jessamy/my-python-sensor-module/run.sh` on macOS.
For modules configured this way, `viam-server` uses this path instead of the `entrypoint` field in your <file>meta.json</file> file.

Click **Create**.

Expand All @@ -788,6 +789,7 @@ On your machine's **CONFIGURE** tab in the [Viam app](https://app.viam.com), cli
Select **Local module**, then **Local module**.

Enter the absolute path to the <file>/bin/&#60;module-name&#62;</file> executable, for example `/home/jessamy/my-go-module/bin/mymodule` on Linux, or `/Users/jessamy/my-go-module/bin/mymodule` on macOS.
For modules configured this way, `viam-server` uses this path instead of the `entrypoint` field in your <file>meta.json</file> file.

Click **Create**.

Expand Down Expand Up @@ -828,7 +830,7 @@ For example, if you created a sensor component, check whether readings are displ
If your component works, you're almost ready to share your module by uploading it to the registry.
If not, you have some debugging to do.

Each time you make changes to your local module, you need to rebuild the module and then restart its instance on your machine.
Each time you make changes to your local module code, you need to update its instance on your machine:

{{< tabs >}}

Expand All @@ -843,13 +845,7 @@ viam module reload <insert relevant named args>
{{% /tab %}}
{{% tab name="Python: venv" %}}

Run the following command to rebuild your module:

```sh {id="terminal-prompt" class="command-line" data-prompt="$"}
viam module build local
```

Then restart it in your machine's **CONFIGURE** tab in the Viam app.
Restart the module in your machine's **CONFIGURE** tab in the Viam app.
Copy link
Collaborator

Choose a reason for hiding this comment

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

so for pyinstaller I need to run the CLI command but for venv I need to do it in the UI? What happens if I use the restart option in the UI for pyinstaller and the cli command for venv?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So they're not actually the same--reload rebuilds AND restarts, whereas the UI just restarts. So, reload is unnecessarily time consuming if using run.sh as the entrypoint, because nothing needs to be built.

If you use the restart button for pyinstaller, you won't have a newly-built executable--you'll just be restarting the same executable you used previously.

Copy link
Collaborator Author

@JessamyT JessamyT May 21, 2025

Choose a reason for hiding this comment

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

Do you think I should make this more explicit? Didn't want to over-explain and make it too verbose, but rather just tell them what they need to do.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah I think it may just be a bit of a tripwire where people see viam module build local on the first tab and expect to be able to do the same on venv. I think a sentence about "Because you're using pyinstaller it is enough to rebuild the module with: ..." and soemthing similar on venv would avoid any stumbling

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay added something to the venv tab but I think the first tab is okay as-is now that the venv tab addresses why it's different.

In upper right corner of the module's card, click **...** menu, then click **Restart**.

{{<imgproc src="/registry/restart-module.png" resize="x600" declaredimensions=true alt="Module menu." style="width:300px" class="shadow" >}}
Expand Down
Loading