Skip to content

Update mentions of viam-provisioning.json to viam-defaults.json#4110

Merged
npentrel merged 14 commits intomainfrom
ale7714-patch-provisioning-config-file
Apr 1, 2025
Merged

Update mentions of viam-provisioning.json to viam-defaults.json#4110
npentrel merged 14 commits intomainfrom
ale7714-patch-provisioning-config-file

Conversation

@ale7714
Copy link
Copy Markdown
Member

@ale7714 ale7714 commented Mar 20, 2025

This was part of the recent config migration for the agent. I missed it when we updated the docs.

This was part of the recent config migration for the agent. I missed it when we updated the docs.
@ale7714 ale7714 requested review from Otterverse and npentrel March 20, 2025 17:31
@viambot viambot added the safe to build This pull request is marked safe to build from a trusted zone label Mar 20, 2025
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 20, 2025

Deploy Preview for viam-docs ready!

Name Link
🔨 Latest commit 710fb3e
🔍 Latest deploy log https://app.netlify.com/sites/viam-docs/deploys/67ec59ad81fa2500087e627a
😎 Deploy Preview https://deploy-preview-4110--viam-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 39 (🟢 up 6 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: 70 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Copy Markdown
Contributor

@Otterverse Otterverse left a comment

Choose a reason for hiding this comment

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

This isn't sufficient for the changes involved. viam-defaults.json uses the new syntax and field names, including sections, identical to the agent section of the cloud config (though version_control section is ignored and shouldn't be included since that can only affect cloud-side App behavior.)

Meanwhile, the old viam-provisioning.json uses the OLD field names, and only a subset of them, mostly from what is now the network_configuration section.

So simply renaming the file in the docs will break things (putting the new format in the old file name/location.)

EDIT: Also, for the preinstall.sh usage, that script itself needs to be updated. Ticketed here: https://viam.atlassian.net/browse/APP-7902

@ale7714 ale7714 force-pushed the ale7714-patch-provisioning-config-file branch from 3cfbaae to b152c5b Compare March 20, 2025 20:52
@ale7714
Copy link
Copy Markdown
Member Author

ale7714 commented Mar 20, 2025

@Otterverse good catch updated both docs here and the preinstall script

@npentrel
Copy link
Copy Markdown
Contributor

Ok, so we'll have to continue documenting both for the time being I think. @ale7714 I can take over on that front and finish this next week if you want

@ale7714
Copy link
Copy Markdown
Member Author

ale7714 commented Mar 21, 2025

I think that the PR to update the preinstall script is merged viamrobotics/agent#86. This can also be merged.

@npentrel
Copy link
Copy Markdown
Contributor

If I understand James correctly @ale7714 we may need to keep the docs for the old way as well

@npentrel
Copy link
Copy Markdown
Contributor

@Otterverse does dd62b4a address your feedback?

Copy link
Copy Markdown
Contributor

@Otterverse Otterverse left a comment

Choose a reason for hiding this comment

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

@npentrel Sorry I didn't get to this yesterday when I first got back. Still some fixes needed IMHO.

Comment thread docs/manage/fleet/provision/setup.md Outdated
"hotspot_prefix": "<PREFIX>", # machine creates a hotspot during setup
"disable_captive_portal_redirect": false, # set to true if using a mobile app
"hotspot_password": "<PASSWORD>", # password for the hotspot
"networks" : []
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The networks section isn't part of network_configuration.

Comment thread docs/manage/fleet/provision/setup.md
Comment thread docs/manage/fleet/provision/setup.md Outdated
"user_idle_minutes": "2m30s",
"retry_connection_timeout_minutes": "15m",
"turn_on_hotspot_if_wifi_has_no_internet": true,
"networks": [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There's no "networks" in network_configuration. There's a separate section for "additional_networks" and the format is now an object, not an array. Again, may be easier to just point to the main configuration page, as viam-defaults.json basically takes the exact same layout/format as the cloud config.

Comment thread docs/manage/fleet/provision/setup.md Outdated
| -------- | ----------- |
| `VIAM_JSON_PATH` | The path to the machine credentials <FILE>viam.json</FILE> file to be copied to the machine. The script will also prompt you for this file if not provided. |
| `PROVISIONING_PATH` | The path to the <FILE>viam-provisioning.json</FILE> file. The script will also prompt you for this file if not provided. |
| `PROVISIONING_PATH` | The path to the <FILE>viam-defaults.json</FILE> file. The script will also prompt you for this file if not provided. |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is called "DEFAULTS_PATH" now I believe, though I'm not sure if the changes to preinstall.sh with the new path were published publicly yet.

Comment thread docs/manage/fleet/provision/setup.md Outdated
"offline_before_starting_hotspot_minutes": "3m30s",
"user_idle_minutes": "2m30s",
"retry_connection_timeout_minutes": "15m",
"turn_on_hotspot_if_wifi_has_no_internet": true,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is mentioned as being "required" for additional_networks to work in lots of text body above/around this. That's not the case. It changes behavior, but it's not required.

Also, that other text should (most likely) be removed. We should really discourage people from adding additional_networks in the defaults file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There are a lot of references to agent-provisioning which is no longer an actual thing. There is the Agent, which has a provisioning functionality, but no longer any seperate subsystem called "agent-provisioning."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok changing

Comment thread docs/manage/fleet/provision/setup.md Outdated
1. When you power on the machine that has `viam-agent` installed and `agent-provisioning` configured, `viam-agent` creates a WiFi hotspot.

- The [`agent-provisioning` configuration](/manage/fleet/provision/setup/#configure-agent-provisioning) is at <file>/etc/viam-provisioning.json</file> on your machine.
- The [`agent-provisioning` configuration](/manage/fleet/provision/setup/#configure-agent-provisioning) is at <file>/etc/viam-defaults.json</file> on your machine.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This isn't just the "agent-provisioning" config. As noted above, there is no longer anything specifically called "agent-provisioning." The defaults file is also not JUST for provisioning. It can be used to set ANY configuration value for agent to a preferred/custom default. Not sure if documentation explaining that belongs on this page or elsewhere though.

Comment thread docs/dev/reference/changelog.md Outdated
Comment on lines +44 to +46
{{% changelog color="changed" title="Viam provisioning filename" date="2025-03-24" %}}

When provisioning devices, the configuration file for provisioning is now called <FILE>viam-defaults.json</FILE> and uses different syntax and field names. The old <FILE>viam-provisioning.json</FILE> is still required for older versions of `viam-agent`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not certain exactly how this should be phrased, but this isn't JUST a filename change. The new viam-defaults.json file allows setting ANY agent config values to customized defaults. So while it should now be used instead of the old, more limited viam-provisioning.json, it's not just a direct replacement.

@ale7714
Copy link
Copy Markdown
Member Author

ale7714 commented Mar 27, 2025

I'm gonna close this for now, my plate is pretty full. I was hoping we could fina more minimal change that would get people to stop using provisioning.json but it sounds like we maybe need a more complete update.

@ale7714 ale7714 closed this Mar 27, 2025
@npentrel
Copy link
Copy Markdown
Contributor

Hey @ale7714 that's fine - I'm going to make the changes James suggested on this branch and see how far I get. You don't need to work on this further!

@npentrel npentrel reopened this Mar 31, 2025
Comment thread docs/dev/reference/changelog.md Outdated
Comment thread docs/manage/fleet/provision/setup.md Outdated
Comment thread docs/manage/fleet/provision/setup.md Outdated
Comment thread docs/manage/fleet/provision/setup.md Outdated
@npentrel npentrel force-pushed the ale7714-patch-provisioning-config-file branch from d8b3b36 to 1a8909f Compare March 31, 2025 12:04
Comment on lines -253 to -255
{{< alert title="Important" color="note" >}}
You must enable `turn_on_hotspot_if_wifi_has_no_internet` in the [`agent-provisioning` configuration](/manage/fleet/provision/setup/#configure-agent-provisioning) of the machine to allow the machine to connect to the specified networks after provisioning.
{{< /alert >}}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Otterverse can you just reconfirm that the note about turn_on_hotspot_if_wifi_has_no_internet can be removed? I was under the impression this was crucial

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's not required, but it changes the criteria for a connection being "good enough." If the ONLY connection that works is an additional network, and it provides full internet, then it'll work without the setting. But if the "primary" network is available, (but doesn't provide internet) then it'll prefer that one, and consider it "good enough" even without internet. So it won't "try all networks until it gets internet" in that situation.

@npentrel npentrel requested a review from Otterverse March 31, 2025 12:05
Comment thread docs/manage/reference/viam-agent/_index.md Outdated
Comment thread docs/manage/fleet/provision/setup.md Outdated
"retry_connection_timeout_minutes": "15m",
"turn_on_hotspot_if_wifi_has_no_internet": true
},
"additional_networks": [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Additional_networks is an object, not an array. Networks have to have a field name/label. I can't make the actual suggested change as the lines below aren't part of the diff, but it looks something like:

    "additional_networks": {
      "testNet": {
        "priority": 30,
        "psk": "myFirstPassword",
        "ssid": "otherNetworkOne",
        "type": "wifi"
      }
    }

Comment thread docs/manage/fleet/provision/setup.md Outdated
| -------- | ----------- |
| `VIAM_JSON_PATH` | The path to the machine credentials <FILE>viam.json</FILE> file to be copied to the machine. The script will also prompt you for this file if not provided. |
| `PROVISIONING_PATH` | The path to the <FILE>viam-provisioning.json</FILE> file. The script will also prompt you for this file if not provided. |
| `DEFAULTS_PATH ` | The path to the <FILE>viam-defaults.json</FILE> file. The script will also prompt you for this file if not provided. |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As I was worried about before, the version of the preinstall script with this change made wasn't yet uploaded. I've uploaded it now, so we should be good.

npentrel and others added 2 commits April 1, 2025 22:01
@npentrel npentrel requested a review from Otterverse April 1, 2025 20:03
Copy link
Copy Markdown
Contributor

@Otterverse Otterverse left a comment

Choose a reason for hiding this comment

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

Thanks for the extra fixes here. LGTM!

Comment thread docs/manage/fleet/provision/setup.md Outdated
Comment thread docs/manage/fleet/provision/setup.md Outdated
Comment thread docs/dev/reference/changelog.md Outdated
Comment thread docs/manage/reference/viam-agent/_index.md Outdated
Comment thread docs/manage/fleet/provision/setup.md Outdated
@npentrel npentrel merged commit 42e4713 into main Apr 1, 2025
13 checks passed
@npentrel npentrel deleted the ale7714-patch-provisioning-config-file branch April 1, 2025 21:29
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 1, 2025

🔎💬 Inkeep AI search and chat service is syncing content for source 'Viam Docs (https://docs.viam.com)'

@ale7714
Copy link
Copy Markdown
Member Author

ale7714 commented Apr 2, 2025

Thank you for picking this up Naomi 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to build This pull request is marked safe to build from a trusted zone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants