# README
Viam Agent
A self-updating service manager that maintains the lifecycle for viam-server (as built from RDK) and other Viam provided system services.
For more information, see the Viam Agent documentation.
Development
Makefile Targets
make
will build a viam-agent for your current CPU architecture. Note that as only linux is supported, this will be a linux binary.make arm64
arm64 specific build.make amd64
amd64 specific.make all
will build for all (both) supported architectures.make lint
to lint.
Version Tagging
The makefile will attempt to get a tagged version from Git. If you want to manually force a version, set TAG_VERSION=0.1.2
in the make command.
Note that there is no "v" in the actual version, though it is expected in git. E.g. a git tag of v0.1.2
becomes TAG_VERSION=0.1.2
Ex: make all TAG_VERSION=0.1.2
DevMode
Setting the environment variable VIAM_AGENT_DEVMODE=1
will skip the self-location check for the binary, so you can run it directly during development, without installing to /opt/viam.
# Packages
No description provided by the author
Package subsystems defines the subsystem interface.
# Functions
No description provided by the author
No description provided by the author
DecompressFile extracts a compressed file and returns the path to the extracted file.
DownloadFile downloads a file into the cache directory and returns a path to the file.
No description provided by the author
No description provided by the author
GetRevision returns the git revision embedded at build time.
GetVersion returns the version embedded at build time.
No description provided by the author
NewAgentSubsystem returns a new wrapped subsystem.
No description provided by the author
NewManager returns a new Manager.
NewMatchingLogger returns a MatchingLogger.
No description provided by the author
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
versions embedded at build time.
No description provided by the author
# Structs
AgentSubsystem is a wrapper for the real subsystems, mostly allowing sharing of download/update code.
CacheData stores VersionInfo and the current/previous versions for (TODO) rollback.
InternalSubsystem is shared start/stop/update code between "internal" (not viam-server) subsystems.
Manager is the core of the agent process, and maintains the list of subsystems, as well as cloud connection.
MatchingLogger provides a logger that also allows sending regex matched lines to a channel.
VersionInfo records details about each version of a subsystem.
# Interfaces
BasicSubsystem is the minimal interface.