shimpz-cli 0.5.42

Fast local tooling for Shimpz Assistants
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
name: ${SHIMPZ_PROJECT_NAME:?CLI must pin SHIMPZ_PROJECT_NAME}

services:
  shimpz-account-egress-init:
    container_name: shimpz-account-egress-init
    image: ${SHIMPZ_EGRESS_IMAGE:?CLI must pin SHIMPZ_EGRESS_IMAGE}
    platform: ${SHIMPZ_SPACE_PLATFORM:?CLI must pin SHIMPZ_SPACE_PLATFORM}
    pull_policy: never
    restart: "no"
    user: "0:0"
    network_mode: none
    read_only: true
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
    security_opt:
      - no-new-privileges:true
    command: ["account-init"]
    volumes:
      - type: volume
        source: account_egress_capability
        target: /run/shimpz-account-egress
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
    tmpfs:
      - /tmp:rw,noexec,nosuid,nodev,size=8m
    cpuset: "${SHIMPZ_CPUSET:?CLI must limit local CPUs}"
    cpus: "0.25"
    mem_limit: 64m
    memswap_limit: 64m
    pids_limit: 32
    logging:
      driver: none

  team:
    container_name: shimpz-team
    image: ${SHIMPZ_TEAM_IMAGE:?CLI must pin SHIMPZ_TEAM_IMAGE}
    platform: ${SHIMPZ_SPACE_PLATFORM:?CLI must pin SHIMPZ_SPACE_PLATFORM}
    pull_policy: never
    restart: on-failure
    user: "10001:10001"
    read_only: true
    cap_drop:
      - ALL
    security_opt:
      - no-new-privileges:true
    group_add:
      - "${SHIMPZ_DOCKER_GID:?CLI must bind the Docker socket group}"
      - "10016"
      - "10017"
      - "10021"
      - "10022"
    environment:
      SHIMPZ_SPACE_ID: ${SHIMPZ_SPACE_ID:?CLI must preserve SHIMPZ_SPACE_ID}
      SHIMPZ_BRAIN_RUNTIME_URL: http://brain:8080
      SHIMPZ_BRAIN_RUNTIME_TOKEN_FILE: /run/shimpz-brain-runtime/token
      SHIMPZ_LOCAL_ACTION_JOURNAL_PATH: /var/lib/shimpz-local/action-journal/journal.sqlite3
      SHIMPZ_LOCAL_CHAT_CONTINUATIONS_STATE_PATH: /var/lib/shimpz-local/chat-continuations/state/continuations.json
      SHIMPZ_LOCAL_CHAT_CONTINUATIONS_KEY_PATH: /var/lib/shimpz-local/chat-continuations/key/aes256.key
      SHIMPZ_OAUTH_BROKER_PROXY_HOST: shimpz-account-egress
      SHIMPZ_OAUTH_BROKER_PROXY_CAPABILITY_FILE: /run/shimpz-account-egress/token
      SHIMPZ_ASSISTANT_EGRESS_CONTAINER: shimpz-assistant-egress
      SHIMPZ_ASSISTANT_EGRESS_POLICY_DIR: /var/lib/shimpz-local/assistant-egress
    volumes:
      - type: bind
        source: ${SHIMPZ_DOCKER_SOCKET:?CLI must bind the platform Docker socket}
        target: /var/run/docker.sock
        bind:
          create_host_path: false
      - type: volume
        source: controller_token
        target: /run/shimpz-local
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: controller_audit
        target: /var/log/shimpz-local
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: controller_storage
        target: /var/lib/shimpz-local/storage
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: controller_inference
        target: /var/lib/shimpz-local/inference
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: controller_action_journal
        target: /var/lib/shimpz-local/action-journal
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: controller_publications
        target: /var/lib/shimpz-local/publications
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: controller_cosign_trust
        target: /var/lib/shimpz-local/cosign
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: controller_assistant_integration_state
        target: /var/lib/shimpz-local/assistant-integrations/state
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: controller_assistant_integration_key
        target: /var/lib/shimpz-local/assistant-integrations/key
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: controller_chat_continuation_state
        target: /var/lib/shimpz-local/chat-continuations/state
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: controller_chat_continuation_key
        target: /var/lib/shimpz-local/chat-continuations/key
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: assistant_egress_policy
        target: /var/lib/shimpz-local/assistant-egress
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: brain_runtime_token
        target: /run/shimpz-brain-runtime
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: supervisor_key
        target: /run/shimpz-local-supervisor
        read_only: true
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: account_egress_capability
        target: /run/shimpz-account-egress
        read_only: true
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
    tmpfs:
      - /tmp:rw,noexec,nosuid,nodev,size=32m
    cpuset: "${SHIMPZ_CPUSET:?CLI must limit local CPUs}"
    cpus: "1.0"
    mem_limit: 256m
    memswap_limit: 256m
    pids_limit: 128
    stop_grace_period: 15s
    logging:
      driver: none
    depends_on:
      shimpz-account-egress-init:
        condition: service_completed_successfully
      shimpz-assistant-egress:
        condition: service_started
      shimpz-assistant-release:
        condition: service_healthy
      shimpz-account-egress:
        condition: service_healthy
    networks:
      - control
      - brain_runtime
      - account_egress
      - assistant_release

  shimpz-assistant-egress:
    container_name: shimpz-assistant-egress
    image: ${SHIMPZ_EGRESS_IMAGE:?CLI must pin SHIMPZ_EGRESS_IMAGE}
    platform: ${SHIMPZ_SPACE_PLATFORM:?CLI must pin SHIMPZ_SPACE_PLATFORM}
    pull_policy: never
    restart: on-failure
    user: "10005:10005"
    command: ["assistant"]
    group_add:
      - "10017"
    read_only: true
    cap_drop:
      - ALL
    security_opt:
      - no-new-privileges:true
    labels:
      com.shimpz.local.managed: "1"
      com.shimpz.local.profile: local-v1
      com.shimpz.local.space-id: ${SHIMPZ_SPACE_ID:?CLI must preserve SHIMPZ_SPACE_ID}
      com.shimpz.local.kind: assistant-egress
    environment:
      SHIMPZ_ASSISTANT_EGRESS_PORT: "8889"
      SHIMPZ_ASSISTANT_EGRESS_POLICY_DIR: /policy
      SHIMPZ_ASSISTANT_EGRESS_AUDIT_LOG: /var/log/assistant-egress/audit.jsonl
      SHIMPZ_ASSISTANT_EGRESS_MAX_CONCURRENCY: "64"
      SHIMPZ_ASSISTANT_EGRESS_MAX_SOURCE_CONCURRENCY: "8"
      SHIMPZ_ASSISTANT_EGRESS_LISTEN_BACKLOG: "16"
    volumes:
      - type: volume
        source: assistant_egress_policy
        target: /policy
        read_only: true
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: assistant_egress_audit
        target: /var/log/assistant-egress
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
    tmpfs:
      - /tmp:rw,noexec,nosuid,nodev,size=16m
    healthcheck:
      test: ["CMD", "python3", "/app/entrypoint.py", "healthcheck", "assistant"]
      interval: 30s
      timeout: 3s
      retries: 3
      start_period: 30s
      start_interval: 1s
    cpuset: "${SHIMPZ_CPUSET:?CLI must limit local CPUs}"
    cpus: "1.0"
    mem_limit: 256m
    memswap_limit: 256m
    pids_limit: 128
    ulimits:
      nofile:
        soft: 512
        hard: 512
    stop_grace_period: 15s
    logging:
      driver: none
    networks:
      - assistant_egress_out

  shimpz-assistant-release:
    container_name: shimpz-assistant-release
    image: ${SHIMPZ_EGRESS_IMAGE:?CLI must pin SHIMPZ_EGRESS_IMAGE}
    platform: ${SHIMPZ_SPACE_PLATFORM:?CLI must pin SHIMPZ_SPACE_PLATFORM}
    pull_policy: never
    restart: on-failure
    user: "10004:10004"
    command: ["release"]
    read_only: true
    cap_drop:
      - ALL
    security_opt:
      - no-new-privileges:true
    labels:
      com.shimpz.local.managed: "1"
      com.shimpz.local.profile: local-v1
      com.shimpz.local.space-id: ${SHIMPZ_SPACE_ID:?CLI must preserve SHIMPZ_SPACE_ID}
      com.shimpz.local.kind: assistant-release
    environment:
      SHIMPZ_EGRESS_ALLOW: developers.shimpz.com,ghcr.io,tuf-repo-cdn.sigstore.dev,rekor.sigstore.dev,pkg-containers.githubusercontent.com
      SHIMPZ_EGRESS_AUDIT_LOG: /var/log/assistant-release/audit.jsonl
      SHIMPZ_EGRESS_MAX_CONCURRENCY: "16"
      SHIMPZ_EGRESS_MAX_SOURCE_CONCURRENCY: "4"
      SHIMPZ_EGRESS_LISTEN_BACKLOG: "8"
    volumes:
      - type: volume
        source: assistant_release_audit
        target: /var/log/assistant-release
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
    tmpfs:
      - /tmp:rw,noexec,nosuid,nodev,size=8m
    healthcheck:
      test: ["CMD", "python3", "/app/entrypoint.py", "healthcheck", "release"]
      interval: 30s
      timeout: 3s
      retries: 3
      start_period: 30s
      start_interval: 1s
    cpuset: "${SHIMPZ_CPUSET:?CLI must limit local CPUs}"
    cpus: "0.5"
    mem_limit: 128m
    memswap_limit: 128m
    pids_limit: 64
    ulimits:
      nofile:
        soft: 256
        hard: 256
    stop_grace_period: 15s
    logging:
      driver: none
    networks:
      - assistant_release
      - assistant_release_out

  shimpz-account-egress:
    container_name: shimpz-account-egress
    image: ${SHIMPZ_EGRESS_IMAGE:?CLI must pin SHIMPZ_EGRESS_IMAGE}
    platform: ${SHIMPZ_SPACE_PLATFORM:?CLI must pin SHIMPZ_SPACE_PLATFORM}
    pull_policy: never
    restart: on-failure
    user: "10006:10006"
    command: ["account"]
    group_add:
      - "10022"
    read_only: true
    cap_drop:
      - ALL
    security_opt:
      - no-new-privileges:true
    labels:
      com.shimpz.local.managed: "1"
      com.shimpz.local.profile: local-v1
      com.shimpz.local.space-id: ${SHIMPZ_SPACE_ID:?CLI must preserve SHIMPZ_SPACE_ID}
      com.shimpz.local.kind: account-egress
    volumes:
      - type: volume
        source: account_egress_capability
        target: /run/shimpz-account-egress
        read_only: true
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: account_egress_audit
        target: /var/log/account-egress
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
    tmpfs:
      - /tmp:rw,noexec,nosuid,nodev,size=8m
    cpuset: "${SHIMPZ_CPUSET:?CLI must limit local CPUs}"
    cpus: "0.5"
    mem_limit: 128m
    memswap_limit: 128m
    pids_limit: 64
    ulimits:
      nofile:
        soft: 256
        hard: 256
    stop_grace_period: 15s
    depends_on:
      shimpz-account-egress-init:
        condition: service_completed_successfully
    logging:
      driver: none
    networks:
      - account_egress
      - account_egress_out
    healthcheck:
      test: ["CMD", "python3", "/app/entrypoint.py", "healthcheck", "account"]
      interval: 30s
      timeout: 3s
      retries: 3
      start_period: 30s
      start_interval: 1s

  shimpz-brain-egress:
    container_name: shimpz-brain-egress
    image: ${SHIMPZ_EGRESS_IMAGE:?CLI must pin SHIMPZ_EGRESS_IMAGE}
    platform: ${SHIMPZ_SPACE_PLATFORM:?CLI must pin SHIMPZ_SPACE_PLATFORM}
    pull_policy: never
    restart: on-failure
    user: "10001:10001"
    command: ["brain"]
    read_only: true
    cap_drop:
      - ALL
    security_opt:
      - no-new-privileges:true
    environment:
      SHIMPZ_EGRESS_AUDIT_LOG: /var/log/brain-egress/audit.jsonl
      SHIMPZ_EGRESS_MAX_CONCURRENCY: "64"
      SHIMPZ_EGRESS_MAX_SOURCE_CONCURRENCY: "8"
      SHIMPZ_EGRESS_LISTEN_BACKLOG: "16"
    labels:
      com.shimpz.local.managed: "1"
      com.shimpz.local.profile: local-v1
      com.shimpz.local.space-id: ${SHIMPZ_SPACE_ID:?CLI must preserve SHIMPZ_SPACE_ID}
      com.shimpz.local.kind: brain-egress
    volumes:
      - type: volume
        source: brain_egress_audit
        target: /var/log/brain-egress
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
    tmpfs:
      - /tmp:rw,noexec,nosuid,nodev,size=16m
    cpuset: "${SHIMPZ_CPUSET:?CLI must limit local CPUs}"
    cpus: "1.0"
    mem_limit: 256m
    memswap_limit: 256m
    pids_limit: 128
    ulimits:
      nofile:
        soft: 512
        hard: 512
    stop_grace_period: 15s
    logging:
      driver: none
    networks:
      - brain_egress
      - brain_egress_out
    healthcheck:
      test: ["CMD", "python3", "/app/entrypoint.py", "healthcheck", "brain"]
      interval: 30s
      timeout: 4s
      retries: 3
      start_period: 30s
      start_interval: 1s

  brain:
    container_name: shimpz-brain
    image: ${SHIMPZ_BRAIN_IMAGE:?CLI must pin SHIMPZ_BRAIN_IMAGE}
    platform: ${SHIMPZ_SPACE_PLATFORM:?CLI must pin SHIMPZ_SPACE_PLATFORM}
    pull_policy: never
    restart: on-failure
    user: "10001:10001"
    group_add:
      - "10016"
    read_only: true
    cap_drop:
      - ALL
    security_opt:
      - no-new-privileges:true
    environment:
      LANGCHAIN_TRACING_V2: "false"
      LANGSMITH_TRACING: "false"
      HTTPS_PROXY: http://shimpz-brain-egress:8888
      HTTP_PROXY: http://shimpz-brain-egress:8888
      https_proxy: http://shimpz-brain-egress:8888
      http_proxy: http://shimpz-brain-egress:8888
      NO_PROXY: localhost,127.0.0.1,::1
      no_proxy: localhost,127.0.0.1,::1
      SHIMPZ_BRAIN_RUNTIME_TOKEN_FILE: /run/shimpz-brain-runtime/token
      SHIMPZ_BRAIN_RUNTIME_STATE: /var/lib/shimpz-brain-runtime/checkpoints.sqlite3
    volumes:
      - type: volume
        source: brain_runtime_token
        target: /run/shimpz-brain-runtime
        read_only: true
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: brain_runtime_state
        target: /var/lib/shimpz-brain-runtime
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
    tmpfs:
      - /tmp:rw,noexec,nosuid,nodev,size=64m
    cpuset: "${SHIMPZ_CPUSET:?CLI must limit local CPUs}"
    cpus: "2.0"
    mem_limit: 1g
    memswap_limit: 1g
    pids_limit: 128
    stop_grace_period: 15s
    depends_on:
      team:
        condition: service_healthy
      shimpz-brain-egress:
        condition: service_healthy
    logging:
      driver: none
    networks:
      - brain_runtime
      - brain_egress

  admin:
    container_name: shimpz-admin
    image: ${SHIMPZ_ADMIN_IMAGE:?CLI must pin SHIMPZ_ADMIN_IMAGE}
    platform: ${SHIMPZ_SPACE_PLATFORM:?CLI must pin SHIMPZ_SPACE_PLATFORM}
    pull_policy: never
    restart: on-failure
    user: "1000:1000"
    group_add:
      - "10010"
      - "10021"
    read_only: true
    cap_drop:
      - ALL
    security_opt:
      - no-new-privileges:true
    ports:
      - "127.0.0.1:${SHIMPZ_PORT:-7777}:4600"
    environment:
      SHIMPZ_ADMIN_PROFILE: local
      SHIMPZ_TEAM_URL: http://team:7077
      SHIMPZ_TEAM_TOKEN_FILE: /run/shimpz-local/token
      SHIMPZ_TEAM_CREDENTIALS_ENABLED: "0"
      SHIMPZ_ADMIN_ALLOWED_ORIGINS: ${SHIMPZ_ADMIN_ALLOWED_ORIGINS:?CLI must pin Admin origins}
      SHIMPZ_SPACE_ID: ${SHIMPZ_SPACE_ID:?CLI must pin Space identity}
    volumes:
      - type: volume
        source: config
        target: /repo
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: data
        target: /data
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: controller_token
        target: /run/shimpz-local
        read_only: true
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: supervisor_key
        target: /run/shimpz-local-supervisor
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: release_status
        target: /run/shimpz-local-release
        read_only: true
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
      - type: volume
        source: reset_capability
        target: /run/shimpz-local-reset
        read_only: true
        volume:
          nocopy: {{SHIMPZ_VOLUME_NOCOPY}}
    tmpfs:
      - /tmp:rw,noexec,nosuid,nodev,size=32m
    healthcheck:
      test: ["CMD", "python", "-c", "import urllib.request; request=urllib.request.Request('http://127.0.0.1:4600/api/session', method='POST'); urllib.request.urlopen(request, timeout=2).read()"]
      interval: 30s
      timeout: 3s
      retries: 3
      start_period: 30s
      start_interval: 1s
    cpus: "2.0"
    cpuset: "${SHIMPZ_CPUSET:?CLI must limit local CPUs}"
    mem_limit: 512m
    memswap_limit: 512m
    pids_limit: 128
    stop_grace_period: 15s
    depends_on:
      team:
        condition: service_healthy
      brain:
        condition: service_healthy
    logging:
      driver: none
    networks:
      - control
      - egress

volumes:
{{SHIMPZ_VOLUME_DEFINITIONS}}

networks:
  control:
    driver: bridge
    internal: true
  brain_runtime:
    driver: bridge
    internal: true
  brain_egress:
    driver: bridge
    internal: true
  brain_egress_out:
    driver: bridge
  assistant_egress_out:
    driver: bridge
  assistant_release:
    driver: bridge
    internal: true
  assistant_release_out:
    driver: bridge
  account_egress:
    driver: bridge
    internal: true
  account_egress_out:
    driver: bridge
  egress:
    driver: bridge