Skip to content

Commit 96ab4ec

Browse files
authored
v2.8.1 Hermes improvements (#760)
* fix stuck toggles * precommit hook: * add config editors * add missing * v2.8.0 hermes * fix auth * give my homie a workspace * fix api key config * fix plugin auth, add vere tag selection, add install for hermes image * fix hermesauth config * fix hermes entrypoint and vere image selector * fix hermes config and tlon cli * fix .env writer and get correct arch tlon bin * fix width of hermes control buttons * recreate the hermes container instead of restart * fix remote url and dockerfile * fix cli build * include tlon bin * fix tlon plugin install * mount hermes config, add config editor in gui * add hermes image * fix image * add hermes icon again * inline image * style cleanup, allow custom s3 domain removal * fix hermes interactivity * add hermes to version server * run hermes in tmux * searxng support
1 parent aa93c75 commit 96ab4ec

64 files changed

Lines changed: 5305 additions & 1845 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/hermes-image.yaml

Lines changed: 137 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,46 @@ on:
1111
description: Hermes Agent git ref
1212
required: false
1313
default: 2ffa1c97c09317c1d066aa5708b8ad961a4ca589
14+
hermes_lcm_ref:
15+
description: Hermes LCM git ref
16+
required: false
17+
default: 34043036d12f69d0089c4630eb9acfb2d9424b4c
1418
tlon_apps_ref:
1519
description: tlon-apps git ref
1620
required: false
17-
default: b9180da6491d29933a98f6e4f1b1458ce61ca576
21+
default: 33112008b1f3e83816dee61020dc5d4c57770c15
1822
push:
1923
description: Push image to Docker Hub
2024
required: false
2125
type: boolean
2226
default: true
27+
release_channel:
28+
description: Version-server channel to update
29+
required: false
30+
type: choice
31+
options:
32+
- edge
33+
- canary
34+
- latest
35+
default: edge
36+
to_canary:
37+
description: Also update canary when release_channel is edge
38+
required: false
39+
type: boolean
40+
default: false
41+
version_server:
42+
description: Version server to update
43+
required: false
44+
type: choice
45+
options:
46+
- staging.version.groundseg.app
47+
- version.groundseg.app
48+
default: staging.version.groundseg.app
49+
update_version_server:
50+
description: Update selected version server after pushing
51+
required: false
52+
type: boolean
53+
default: true
2354
push:
2455
branches:
2556
- main
@@ -37,9 +68,11 @@ permissions:
3768

3869
env:
3970
DEFAULT_IMAGE: nativeplanet/hermes-tlon
40-
HERMES_IMAGE_TAG: 0.14.0-0.13.0
71+
HERMES_IMAGE_TAG: 0.14.0-0.14.0
4172
HERMES_AGENT_REF: 2ffa1c97c09317c1d066aa5708b8ad961a4ca589
42-
TLON_APPS_REF: b9180da6491d29933a98f6e4f1b1458ce61ca576
73+
HERMES_LCM_REF: 34043036d12f69d0089c4630eb9acfb2d9424b4c
74+
TLON_APPS_REF: 33112008b1f3e83816dee61020dc5d4c57770c15
75+
VERSION_AUTH: ${{ secrets.VERSION_AUTH }}
4376

4477
jobs:
4578
build:
@@ -53,22 +86,40 @@ jobs:
5386
set -euo pipefail
5487
image="${{ github.event.inputs.image }}"
5588
hermes_ref="${{ github.event.inputs.hermes_agent_ref }}"
89+
lcm_ref="${{ github.event.inputs.hermes_lcm_ref }}"
5690
tlon_ref="${{ github.event.inputs.tlon_apps_ref }}"
91+
release_channel="${{ github.event.inputs.release_channel }}"
92+
to_canary="${{ github.event.inputs.to_canary }}"
93+
version_server="${{ github.event.inputs.version_server }}"
94+
update_version_server="${{ github.event.inputs.update_version_server }}"
5795
push_image="true"
5896
5997
if [ -z "$image" ]; then image="$DEFAULT_IMAGE"; fi
6098
if [ -z "$hermes_ref" ]; then hermes_ref="$HERMES_AGENT_REF"; fi
99+
if [ -z "$lcm_ref" ]; then lcm_ref="$HERMES_LCM_REF"; fi
61100
if [ -z "$tlon_ref" ]; then tlon_ref="$TLON_APPS_REF"; fi
101+
if [ -z "$release_channel" ]; then release_channel="edge"; fi
102+
if [ -z "$to_canary" ]; then to_canary="false"; fi
103+
if [ -z "$version_server" ]; then version_server="staging.version.groundseg.app"; fi
104+
if [ -z "$update_version_server" ]; then update_version_server="false"; fi
62105
if [ "${{ github.event_name }}" = "pull_request" ]; then
63106
push_image="false"
64107
elif [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ github.event.inputs.push }}" != "true" ]; then
65108
push_image="false"
66109
fi
110+
if [ "${{ github.event_name }}" != "workflow_dispatch" ] || [ "$push_image" != "true" ]; then
111+
update_version_server="false"
112+
fi
67113
68114
echo "image=$image" >> "$GITHUB_OUTPUT"
69115
echo "hermes-ref=$hermes_ref" >> "$GITHUB_OUTPUT"
116+
echo "lcm-ref=$lcm_ref" >> "$GITHUB_OUTPUT"
70117
echo "tlon-ref=$tlon_ref" >> "$GITHUB_OUTPUT"
71118
echo "push=$push_image" >> "$GITHUB_OUTPUT"
119+
echo "release-channel=$release_channel" >> "$GITHUB_OUTPUT"
120+
echo "to-canary=$to_canary" >> "$GITHUB_OUTPUT"
121+
echo "version-server=$version_server" >> "$GITHUB_OUTPUT"
122+
echo "update-version-server=$update_version_server" >> "$GITHUB_OUTPUT"
72123
73124
- name: Set up QEMU
74125
uses: docker/setup-qemu-action@v3
@@ -80,8 +131,8 @@ jobs:
80131
if: steps.args.outputs.push == 'true'
81132
uses: docker/login-action@v3
82133
with:
83-
username: ${{ secrets.DOCKERHUB_USERNAME }}
84-
password: ${{ secrets.DOCKERHUB_TOKEN }}
134+
username: nativeplanet
135+
password: ${{ secrets.DOCKER_PAT }}
85136

86137
- name: Build Hermes image
87138
uses: docker/build-push-action@v6
@@ -92,9 +143,90 @@ jobs:
92143
push: ${{ steps.args.outputs.push == 'true' }}
93144
build-args: |
94145
HERMES_AGENT_REF=${{ steps.args.outputs.hermes-ref }}
146+
HERMES_LCM_REF=${{ steps.args.outputs.lcm-ref }}
95147
TLON_APPS_REF=${{ steps.args.outputs.tlon-ref }}
96148
tags: |
97149
${{ steps.args.outputs.image }}:${{ env.HERMES_IMAGE_TAG }}
98150
${{ steps.args.outputs.image }}:${{ env.HERMES_IMAGE_TAG }}-${{ github.sha }}
99151
cache-from: type=gha
100152
cache-to: type=gha,mode=max
153+
154+
- name: Install version update tools
155+
if: steps.args.outputs.update-version-server == 'true'
156+
run: |
157+
sudo apt-get update
158+
sudo apt-get install -y jq
159+
160+
- name: Update version server
161+
if: steps.args.outputs.update-version-server == 'true'
162+
run: |
163+
set -euo pipefail
164+
165+
if [ -z "${VERSION_AUTH:-}" ]; then
166+
echo "VERSION_AUTH secret is required to update the version server"
167+
exit 1
168+
fi
169+
170+
image="${{ steps.args.outputs.image }}"
171+
tag="${{ env.HERMES_IMAGE_TAG }}-${{ github.sha }}"
172+
image_ref="${image}:${tag}"
173+
version_server="${{ steps.args.outputs.version-server }}"
174+
175+
repo="$image"
176+
case "$repo" in
177+
registry.hub.docker.com/*)
178+
;;
179+
docker.io/*)
180+
repo="registry.hub.docker.com/${repo#docker.io/}"
181+
;;
182+
*/*)
183+
repo="registry.hub.docker.com/${repo}"
184+
;;
185+
*)
186+
echo "Unsupported image name for version server repo: $repo"
187+
exit 1
188+
;;
189+
esac
190+
191+
manifest="$(docker buildx imagetools inspect --raw "$image_ref")"
192+
amd64_sha="$(echo "$manifest" | jq -r '.manifests[] | select(.platform.os == "linux" and .platform.architecture == "amd64") | .digest' | sed 's/^sha256://')"
193+
arm64_sha="$(echo "$manifest" | jq -r '.manifests[] | select(.platform.os == "linux" and .platform.architecture == "arm64") | .digest' | sed 's/^sha256://')"
194+
195+
if [ -z "$amd64_sha" ] || [ "$amd64_sha" = "null" ]; then
196+
echo "Unable to resolve amd64 image digest for $image_ref"
197+
exit 1
198+
fi
199+
if [ -z "$arm64_sha" ] || [ "$arm64_sha" = "null" ]; then
200+
echo "Unable to resolve arm64 image digest for $image_ref"
201+
exit 1
202+
fi
203+
204+
update_channel() {
205+
channel="$1"
206+
echo "Updating ${version_server} groundseg.${channel}.hermes -> ${repo}:${tag}"
207+
208+
curl -f -X PUT \
209+
-H "X-Api-Key: ${VERSION_AUTH}" \
210+
-H 'Content-Type: application/json' \
211+
"https://${version_server}/modify/groundseg/${channel}/hermes/repo/payload" \
212+
-d "{\"value\":\"${repo}\"}"
213+
214+
curl -f -X PUT \
215+
-H "X-Api-Key: ${VERSION_AUTH}" \
216+
"https://${version_server}/modify/groundseg/${channel}/hermes/tag/${tag}"
217+
218+
curl -f -X PUT \
219+
-H "X-Api-Key: ${VERSION_AUTH}" \
220+
"https://${version_server}/modify/groundseg/${channel}/hermes/amd64_sha256/${amd64_sha}"
221+
222+
curl -f -X PUT \
223+
-H "X-Api-Key: ${VERSION_AUTH}" \
224+
"https://${version_server}/modify/groundseg/${channel}/hermes/arm64_sha256/${arm64_sha}"
225+
}
226+
227+
release_channel="${{ steps.args.outputs.release-channel }}"
228+
update_channel "$release_channel"
229+
230+
if [ "$release_channel" = "edge" ] && [ "${{ steps.args.outputs.to-canary }}" = "true" ]; then
231+
update_channel "canary"
232+
fi

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
goseg/web/*
2+
!goseg/web/hermes.png

0 commit comments

Comments
 (0)