Commit 63bdbd9
committed
client: Allow fetching the env from the coordinator
Remote users have to keep a local copy of the lab env file in sync with
the coordinator before they can run labgrid-client against it. This is
friction for casual workflows like triage or console access from a
laptop, and is awkward to maintain across many client machines.
Provide a way for clients to fetch the env from the coordinator on
startup. Setting LG_ENV (or --config) to the literal string
'coordinator:' issues a one-shot GetEnvironment RPC against the
coordinator. The returned YAML is written under $XDG_CACHE_HOME/labgrid
(or ~/.cache/labgrid) and loaded exactly as if the user had pointed at a
local file, so the rest of the client is untouched. The cache file is
overwritten on each fetch so users can inspect what env the client just
loaded. Remote users then only need labgrid, network access to the
coordinator and three environment variables (PATH, LG_COORDINATOR,
LG_ENV=coordinator:) to run labgrid-client console -p <board> from
anywhere.
Per-user paths inside the served env (build dirs, log dirs, source
trees) are still resolvable via the existing LG_* template substitution,
so individual clients can override only the few values that matter to
them without forking the env file.
The coordinator address used for the fetch comes from --coordinator on
the command line if given, otherwise LG_COORDINATOR, with
127.0.0.1:20408 as the final default - matching the fallback chain
main() uses elsewhere.
Signed-off-by: Simon Glass <sjg@chromium.org>1 parent 18c310b commit 63bdbd9
4 files changed
Lines changed: 93 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
52 | 61 | | |
53 | 62 | | |
54 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
169 | 200 | | |
170 | 201 | | |
171 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1725 | 1725 | | |
1726 | 1726 | | |
1727 | 1727 | | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
1728 | 1761 | | |
1729 | 1762 | | |
1730 | 1763 | | |
| |||
2305 | 2338 | | |
2306 | 2339 | | |
2307 | 2340 | | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
2308 | 2352 | | |
2309 | 2353 | | |
2310 | 2354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1145 | 1145 | | |
1146 | 1146 | | |
1147 | 1147 | | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
1148 | 1157 | | |
1149 | 1158 | | |
1150 | 1159 | | |
| |||
0 commit comments