pi-herdsman 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/guides/container-deployment.md +98 -103
- package/package.json +1 -1
|
@@ -1,178 +1,173 @@
|
|
|
1
1
|
# Container deployment
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Run Pi Herdsman as a portable SSH-accessible coding-agent environment with Pi, Herdr, developer tools, and persistent state.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
coding agents. It packages Pi, herdr, Pi Herdsman, developer tooling, and
|
|
7
|
-
OpenSSH while keeping mutable user state under `/home/herdsman`.
|
|
5
|
+
## Quick start
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
boundary; connect with your own SSH key and use Pi and herdr normally.
|
|
7
|
+
Start:
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
layer normally through Pi's native context-file discovery.
|
|
9
|
+
```sh
|
|
10
|
+
SSH_AUTHORIZED_KEYS="$(cat ~/.ssh/id_ed25519.pub)" docker compose up -d
|
|
11
|
+
```
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
Connect:
|
|
18
14
|
|
|
19
|
-
|
|
15
|
+
```sh
|
|
16
|
+
ssh -p 2222 herdsman@your-host
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Herdr opens automatically. Select a workspace and run:
|
|
20
20
|
|
|
21
21
|
```sh
|
|
22
|
-
|
|
22
|
+
pi
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
That's it.
|
|
26
|
+
|
|
27
|
+
## Add it to Herdr
|
|
26
28
|
|
|
27
29
|
```sh
|
|
28
|
-
|
|
30
|
+
herdr machine add ssh://herdsman@your-host:2222 --label my-herd
|
|
29
31
|
```
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
With an existing `~/.ssh/config` host:
|
|
32
34
|
|
|
33
35
|
```sh
|
|
34
|
-
herdr
|
|
36
|
+
herdr machine add my-herd --label my-herd
|
|
35
37
|
```
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
`SSH_AUTHORIZED_KEYS` is required to initialize the account's authorized keys.
|
|
39
|
-
The keys are saved in the persistent home volume; changing the environment
|
|
40
|
-
variable later does not replace an existing authorized-keys file. SSH agent
|
|
41
|
-
forwarding remains available, so `ssh -A` can be used when a session needs
|
|
42
|
-
access to private Git repositories without copying private keys into the
|
|
43
|
-
container.
|
|
39
|
+
The remote machine then appears alongside Local in Herdr.
|
|
44
40
|
|
|
45
|
-
##
|
|
41
|
+
## Use Tailscale
|
|
46
42
|
|
|
47
|
-
|
|
48
|
-
computer running your local herdr client:
|
|
43
|
+
Start with the Tailscale sidecar:
|
|
49
44
|
|
|
50
45
|
```sh
|
|
51
|
-
|
|
46
|
+
TS_AUTHKEY=tskey-auth-... \
|
|
47
|
+
SSH_AUTHORIZED_KEYS="$(cat ~/.ssh/id_ed25519.pub)" \
|
|
48
|
+
docker compose \
|
|
49
|
+
-f compose.yaml \
|
|
50
|
+
-f compose.tailscale.yaml \
|
|
51
|
+
up -d
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
Connect:
|
|
55
55
|
|
|
56
56
|
```sh
|
|
57
|
-
|
|
57
|
+
ssh herdsman@pi-herdsman
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Add it to Herdr:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
herdr machine add ssh://herdsman@pi-herdsman --label my-herd
|
|
58
64
|
```
|
|
59
65
|
|
|
60
|
-
|
|
61
|
-
Connected machine workspaces and agents appear alongside Local in the same
|
|
62
|
-
herdr window, and disconnecting the client does not stop the remote work.
|
|
66
|
+
Use another hostname:
|
|
63
67
|
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
```sh
|
|
69
|
+
TAILSCALE_HOSTNAME=my-herd \
|
|
70
|
+
TS_AUTHKEY=tskey-auth-... \
|
|
71
|
+
SSH_AUTHORIZED_KEYS="$(cat ~/.ssh/id_ed25519.pub)" \
|
|
72
|
+
docker compose \
|
|
73
|
+
-f compose.yaml \
|
|
74
|
+
-f compose.tailscale.yaml \
|
|
75
|
+
up -d
|
|
76
|
+
```
|
|
66
77
|
|
|
67
|
-
|
|
78
|
+
Tailscale provides networking only. SSH remains normal OpenSSH.
|
|
68
79
|
|
|
69
|
-
|
|
80
|
+
## Update
|
|
70
81
|
|
|
71
82
|
```sh
|
|
72
83
|
docker compose pull
|
|
73
84
|
docker compose up -d
|
|
74
85
|
```
|
|
75
86
|
|
|
76
|
-
|
|
77
|
-
`/home/herdsman` and the SSH host identity.
|
|
87
|
+
Persistent state survives container replacement.
|
|
78
88
|
|
|
79
|
-
##
|
|
89
|
+
## Use a host bind mount
|
|
80
90
|
|
|
81
|
-
The default
|
|
91
|
+
The default Docker-managed volume needs no manual permission setup.
|
|
82
92
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
tools; npm globals; Git, GitHub and user SSH state; and repositories.
|
|
86
|
-
- `/var/lib/herdsman/ssh` contains the SSH server host key, preserving server
|
|
87
|
-
identity when the container is replaced.
|
|
88
|
-
|
|
89
|
-
The image uses its built-in `herdsman` UID and GID by default. For Linux or NAS
|
|
90
|
-
bind mounts owned by a different host account, set `PUID` and `PGID` to the
|
|
91
|
-
directory owner's numeric IDs:
|
|
93
|
+
For a Linux or NAS bind mount, prepare the directory for the UID/GID the
|
|
94
|
+
container will use:
|
|
92
95
|
|
|
93
96
|
```sh
|
|
94
|
-
PUID=
|
|
95
|
-
PGID=
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
PUID=1035
|
|
98
|
+
PGID=65537
|
|
99
|
+
|
|
100
|
+
mkdir -p ./data/herdsman-home
|
|
101
|
+
sudo chown "$PUID:$PGID" ./data/herdsman-home
|
|
102
|
+
sudo chmod go-w ./data/herdsman-home
|
|
98
103
|
```
|
|
99
104
|
|
|
100
|
-
|
|
105
|
+
Set the same IDs in `.env`:
|
|
101
106
|
|
|
102
107
|
```dotenv
|
|
103
108
|
PUID=1035
|
|
104
109
|
PGID=65537
|
|
105
110
|
```
|
|
106
111
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
it. Existing volumes are not migrated automatically; startup fails if
|
|
110
|
-
`/home/herdsman` is not writable by the resulting account. Repositories can
|
|
111
|
-
live under the persistent home, for example `~/projects`. Host checkouts can
|
|
112
|
-
be mounted explicitly when needed.
|
|
112
|
+
Create `compose.bind-mount.yaml` to replace the home volume with the host
|
|
113
|
+
directory while keeping the SSH server identity in its named volume:
|
|
113
114
|
|
|
114
|
-
|
|
115
|
+
```yaml
|
|
116
|
+
services:
|
|
117
|
+
herdsman:
|
|
118
|
+
volumes:
|
|
119
|
+
- ./data/herdsman-home:/home/herdsman
|
|
120
|
+
- herdsman-ssh:/var/lib/herdsman/ssh
|
|
121
|
+
```
|
|
115
122
|
|
|
116
|
-
|
|
123
|
+
Start with both Compose files:
|
|
117
124
|
|
|
118
125
|
```sh
|
|
119
|
-
|
|
120
|
-
|
|
126
|
+
SSH_AUTHORIZED_KEYS="$(cat ~/.ssh/id_ed25519.pub)" \
|
|
127
|
+
docker compose -f compose.yaml -f compose.bind-mount.yaml up -d
|
|
121
128
|
```
|
|
122
129
|
|
|
123
|
-
|
|
124
|
-
|
|
130
|
+
OpenSSH requires the home directory to be owned by root or the login user and
|
|
131
|
+
not writable by group or others. The container validates this at startup but
|
|
132
|
+
does not change ownership or permissions of host bind mounts.
|
|
125
133
|
|
|
126
|
-
##
|
|
134
|
+
## Forward your SSH agent
|
|
127
135
|
|
|
128
|
-
|
|
129
|
-
namespace; it does not run in the Herdsman container. Start both services with:
|
|
136
|
+
For private Git repositories:
|
|
130
137
|
|
|
131
138
|
```sh
|
|
132
|
-
|
|
133
|
-
SSH_AUTHORIZED_KEYS="$(cat ~/.ssh/id_ed25519.pub)" \
|
|
134
|
-
docker compose \
|
|
135
|
-
-f compose.yaml \
|
|
136
|
-
-f compose.tailscale.yaml \
|
|
137
|
-
up -d
|
|
139
|
+
ssh -A -p 2222 herdsman@your-host
|
|
138
140
|
```
|
|
139
141
|
|
|
140
|
-
|
|
142
|
+
## Install another tool
|
|
141
143
|
|
|
142
144
|
```sh
|
|
143
|
-
|
|
145
|
+
mise use -g uv@latest
|
|
144
146
|
```
|
|
145
147
|
|
|
146
|
-
|
|
147
|
-
Tailscale networking, not Tailscale SSH.
|
|
148
|
-
|
|
149
|
-
## Interactive sessions
|
|
148
|
+
Tools installed with mise persist in the home volume.
|
|
150
149
|
|
|
151
|
-
|
|
152
|
-
reached through the optional Tailscale sidecar.
|
|
150
|
+
## What persists?
|
|
153
151
|
|
|
154
|
-
|
|
152
|
+
| Path | Contents |
|
|
153
|
+
| ----------------------- | --------------------------------------------------------------------------------- |
|
|
154
|
+
| `/home/herdsman` | Pi and Herdr state, repositories, config, credentials, SSH state, installed tools |
|
|
155
|
+
| `/var/lib/herdsman/ssh` | SSH server identity |
|
|
155
156
|
|
|
156
|
-
|
|
157
|
+
Running processes do not survive a container restart.
|
|
157
158
|
|
|
158
|
-
|
|
159
|
-
docker exec -it --user herdsman <container> bash
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
or with Compose:
|
|
163
|
-
|
|
164
|
-
```sh
|
|
165
|
-
docker compose exec --user herdsman herdsman bash
|
|
166
|
-
```
|
|
159
|
+
## Defaults
|
|
167
160
|
|
|
168
|
-
|
|
169
|
-
|
|
161
|
+
| Setting | Default |
|
|
162
|
+
| ------------------ | ------------- |
|
|
163
|
+
| SSH port | `2222` |
|
|
164
|
+
| User | `herdsman` |
|
|
165
|
+
| Tailscale hostname | `pi-herdsman` |
|
|
166
|
+
| Password login | disabled |
|
|
167
|
+
| Root SSH login | disabled |
|
|
170
168
|
|
|
171
|
-
|
|
169
|
+
`SSH_AUTHORIZED_KEYS` is required only on first start. Existing authorized keys are not overwritten.
|
|
172
170
|
|
|
173
|
-
|
|
171
|
+
Pi sessions automatically receive the container environment context from `/AGENTS.md`.
|
|
174
172
|
|
|
175
|
-
|
|
176
|
-
remains alive. Replacing or restarting the Docker container kills its
|
|
177
|
-
processes. Herdr can restore layout and supported Pi conversations, but
|
|
178
|
-
arbitrary processes do not survive a container restart.
|
|
173
|
+
See the [Herdr machine documentation](https://herdr.dev/docs/connecting-machines/) for machine and SSH configuration.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-herdsman",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Asynchronous Pi subagents and agent fleet orchestration for parallel coding agents with nested delegation, background work, and supervision in herdr.",
|
|
6
6
|
"license": "Apache-2.0",
|