diff --git a/docs/dev/reference/changelog.md b/docs/dev/reference/changelog.md index 478a8374ad..8abf62e313 100644 --- a/docs/dev/reference/changelog.md +++ b/docs/dev/reference/changelog.md @@ -30,6 +30,9 @@ aliases: - "/components/sensor/bme280/" - "/components/sensor/ds18b20/" - "/components/sensor/sensirion-sht3xd/" + - /build/configure/processes/ + - /configure/processes/ + - /manage/reference/processes - /appendix/changelog/ layout: "changelog" outputs: @@ -41,6 +44,13 @@ date: "2024-09-18" +{{% changelog color="removed" title="Processes" date="2025-05-06" %}} + +Processes were removed in `viam-server` v0.74.0. +Instead [use modules for control logic](/manage/software/control-logic/#add-control-logic-to-your-module). + +{{% /changelog %}} + {{% changelog color="changed" title="Viam provisioning" date="2025-03-24" %}} You can now set any `viam-agent` configuration values to customized defaults. @@ -154,7 +164,7 @@ Backward compatibility is maintained for existing configurations. {{% changelog color="removed" title="Managed Processes" date="2025-02-01" %}} -[Managed Processes](/manage/reference/processes/) are now deprecated and will be removed in a future version of `viam-server`. +Managed Processes are now deprecated and will be removed in a future version of `viam-server`. Instead [use modules for control logic](/manage/software/control-logic/#add-control-logic-to-your-module). {{% /changelog %}} diff --git a/docs/manage/reference/processes.md b/docs/manage/reference/processes.md deleted file mode 100644 index 92064c12fe..0000000000 --- a/docs/manage/reference/processes.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: "Configure a managed process" -linkTitle: "Managed processes" -weight: 50 -type: "docs" -description: "Configure a process to run a program when your machine is online." -tags: ["processes"] -aliases: - - /build/configure/processes/ - - /configure/processes/ -date: "2022-01-01" -updated: "2024-11-01" -no_list: true -toc_hide: true ---- - -To run a program or control code when your machine is online, configure a _process_. -The process is managed by `viam-server`. -You can configure processes to run once upon startup or indefinitely. - -{{% alert title="Support Notice" color="warn" %}} - -Processes are deprecated and will be removed in a future version of `viam-server`. -Instead [use modules for control logic](/manage/software/control-logic/#add-control-logic-to-your-module). - -{{% /alert %}} - -## Configure a process - -Navigate to the **CONFIGURE** tab of your machine's page in the [Viam app](https://app.viam.com). -Click the **+** icon next to your machine part in the left-hand menu and select **Process**. - -In the process configuration panel, configure the attributes for your process: - - -| Attribute | Type | Required? | Description | -| --------- | ---- | --------- | ----------- | -| Executable (`name`) | string | **Required** | The command you want to execute when your machine connects to the server. On many operating systems, you can find the executable path of commands by running `which `. | -| Arguments (`args`) | string[] | Optional | Arguments to follow the command. | -| Working directory (`cwd`) | string | Optional | Where you want the process to execute. Defaults to the directory where `viam-server` executes. | -| `username` (not available in builder mode) | string | Optional | Run this process as a different user. Example: `"username": "ubuntu"`. | -| `env` (not available in builder mode) | Map | Optional | Environment variables for the process. Environment variables are encrypted in transit but are stored in plain text in the configuration file that resides on the machine. Example: `"environment": { "SVC_API_KEY":"VALUE" }`. | -| Logging (`log`) | boolean | Optional | Toggle logging of errors and other messages on or off.
Default: `false`. | -| Execute once (`one_shot`) | boolean | Optional | Toggle whether to execute the command just once or keep running the process indefinitely. Default: `false`. | - -Click **Save** in the upper right corner of the screen. - -### Example - -The following example executes the command `python3 my_cool_script.py` in your /home/myName/project/ directory every time a machine boots, and restarts the process if it stops running. - -{{< tabs >}} -{{% tab name="Builder mode" %}} - -![The CONFIGURE tab with a process called run-my-code configured. The executable is python3, the argument is my_cool_script.py, and the working directory is /home/myName/project. Logging is turned on and execute once is turned off.](/build/configure/process-fancy.png) - -{{% /tab %}} -{{% tab name="JSON" %}} - -```json -"processes": [ - { - "id": "run-my-code", - "log": true, - "name": "python3", - "args": [ - "my_cool_script.py" - ], - "cwd": "/home/myName/project/" - } - ] -``` - -{{% /tab %}} -{{< /tabs >}} - -## Set up dependencies - -If you are configuring a process that requires dependencies, such as the Viam SDKs, you must install those dependencies so `viam-server` has access to them. - -For Python scripts, we recommend you install dependencies into the folder that contains the code you want to execute: - -```sh {class="command-line" data-prompt="$"} -sudo apt install -y python3-pip -pip3 install --target=machine viam-sdk -``` diff --git a/docs/operate/reference/advanced-modules/custom-components-remotes.md b/docs/operate/reference/advanced-modules/custom-components-remotes.md index 561eff6f69..118a6e6d7f 100644 --- a/docs/operate/reference/advanced-modules/custom-components-remotes.md +++ b/docs/operate/reference/advanced-modules/custom-components-remotes.md @@ -36,7 +36,7 @@ To add a custom resource as a [remote part](/operate/reference/architecture/part The new model must implement any functions of the built-in resource type marked as required in its [RDK API definition](/dev/reference/apis/). 2. Register the custom component on a new gRPC server instance and start the server. 3. Add the server as a [remote part](/operate/reference/architecture/parts/) of your machine. -4. (Optional) [Configure a process](/manage/reference/processes/) to launch this remote server to ensure the remote server is always running alongside the rest of your machine. +4. (Optional) Ensure the remote server automatically starts when the machine boots. Each remote server can host one or many custom components. @@ -53,7 +53,7 @@ For more detailed instructions, see the full example in the [Python SDK document 1. Register the custom component on a new gRPC server instance and start the server. You can do this with the [`viam.rpc` library](https://python.viam.dev/autoapi/viam/rpc/index.html) by creating a new `rpc.server.Server` instance. 1. Add the server as a [remote part](/operate/reference/architecture/parts/) of your machine. -1. (Optional) [Configure a process](/manage/reference/processes/) to launch this remote server to ensure the remote server is always running alongside the rest of your machine. +1. (Optional) Ensure the remote server automatically starts when the machine boots. Each remote server can host one or many custom components. diff --git a/docs/tutorials/custom/custom-base-dog.md b/docs/tutorials/custom/custom-base-dog.md index 62137c2583..4b2110ee55 100644 --- a/docs/tutorials/custom/custom-base-dog.md +++ b/docs/tutorials/custom/custom-base-dog.md @@ -423,59 +423,17 @@ Your local component configuration should look similar to the following: ## Start the Freenove server To operate the dog, you need to start the Freenove robot dog server (which you saved as /home/fido/Freenove_Robot_Dog_Kit_for_Raspberry_Pi/Code/Server/main.py). +You can do this manually by SSHing into the Pi and running the following command from the home/fido/Freenove_Robot_Dog_Kit_for_Raspberry_Pi/Code/Server/ directory: -Configure a [_process_](/manage/reference/processes/) to automatically start the server on boot so it is ready to receive commands from `viam-server`. - -Click the **+** (Create) button next to your main part in the left-hand menu and select **Process**. - -In the process configuration panel that appears, click on the name in the top left corner and rename it to `freenove`. -Fill out the configuration panel as follows: - -- **Executable**: The path to Python on your Pi, for example `/usr/bin/python`. - If you're not sure what this path should be, run `which python` on your Pi command line to find it. -- **Arguments**: Type in `main.py` and click **Add argument**. - Then type `-tn` and click **Add argument** again. - This flag starts the Freenove server without launching Freenove's GUI (which you don't need for this use case). -- **Working directory**: `/home/fido/Freenove_Robot_Dog_Kit_for_Raspberry_Pi/Code/Server` (changing "/home/fido" to the name of your home directory where you downloaded the Freenove code). -- **Logging**: Toggle to the **on** position so you can view logs for this server process. -- **Execute once**: Leave this **off** so that the Freenove server will continue to run, and will restart if it crashes. - -Click **Save**. - -{{}} -
- -{{% expand "Click to see what the processes config looks like in JSON mode." %}} - -```json - "processes": [ - { - "log": true, - "name": "/usr/bin/python", - "cwd": "/home/fido/Freenove_Robot_Dog_Kit_for_Raspberry_Pi/Code/Server", - "args": [ - "main.py", - "-tn" - ], - "one_shot": false, - "id": "freenove" - } - ] +```sh {class="command-line" data-prompt="$"} +sudo python main.py -tn ``` -{{% /expand %}} +Alternatively you can add this command to your module's `run.sh` file. +That way the Freenove robot dog server will start running when the module starts. {{% alert title="Tip" color="tip" %}} -If you prefer not to start the Freenove server every time the machine boots, you can instead start it manually from your command line. - -SSH into the Pi. -From the home/fido/Freenove_Robot_Dog_Kit_for_Raspberry_Pi/Code/Server/ directory, start the Freenove robot dog server: - -```sh {class="command-line" data-prompt="$"} -sudo python main.py -tn -``` - {{% /alert %}} ## Driving the robot from the Viam app diff --git a/netlify.toml b/netlify.toml index 05457e396f..731a04e3d0 100644 --- a/netlify.toml +++ b/netlify.toml @@ -57,7 +57,7 @@ [plugins.inputs] # change this key to a new one any time you need to restart from scratch - cacheKey = ["Apr242025"] + cacheKey = ["May022025"] # either "warn" or "error" failBuildOnError = true