Skip to content

Commit 67a6f93

Browse files
author
mike dupont
committed
rework of patch
1 parent 0d1d6df commit 67a6f93

Some content is hidden

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

44 files changed

+803
-130
lines changed

.github/workflows/image.yaml

+87-61
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,96 @@
1-
#
1+
22
name: Create and publish a Docker image
33

4-
# Configures this workflow to run every time a change is pushed to the branch called `release`.
54
on:
6-
release:
7-
types: [created]
8-
workflow_dispatch:
5+
workflow_dispatch:
6+
#push:
7+
#pull_request:
98

10-
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
119
env:
12-
REGISTRY: ghcr.io
13-
IMAGE_NAME: ${{ github.repository }}
10+
REGISTRY: ghcr.io
11+
IMAGE_NAME: ${{ github.repository }}
1412

15-
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
1613
jobs:
17-
build-and-push-image:
18-
runs-on: ubuntu-latest
19-
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
20-
permissions:
21-
contents: read
22-
packages: write
23-
attestations: write
24-
id-token: write
25-
#
26-
steps:
27-
- name: Checkout repository
28-
uses: actions/checkout@v4
29-
# Uses the `docker/login-action` action to log in to the Container registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
30-
- name: Log in to the Container registry
31-
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
32-
with:
33-
registry: ${{ env.REGISTRY }}
34-
username: ${{ github.actor }}
35-
password: ${{ secrets.GITHUB_TOKEN }}
36-
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
37-
- name: Extract metadata (tags, labels) for Docker
38-
id: meta
39-
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
40-
with:
41-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
42-
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
43-
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
44-
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
45-
- name: Build and push Docker image
46-
id: push
47-
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
48-
with:
49-
context: .
50-
push: true
51-
tags: ${{ steps.meta.outputs.tags }}
52-
labels: ${{ steps.meta.outputs.labels }}
14+
15+
build-and-push-image:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: write
20+
attestations: write
21+
id-token: write
22+
23+
steps:
24+
#- name: Configure AWS credentials
25+
# uses: meta-introspector/configure-aws-credentials@v4
26+
# with:
27+
# aws-region: ${{ secrets.AWS_REGION || 'us-east-2'}}
28+
# role-session-name: github-actions-${{ env.APP_NAME || 'eliza'}}
29+
# # FIXME hard coded
30+
# role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID || '767503528736' }}:role/github
31+
32+
- name: Set up Docker Buildx
33+
uses: meta-introspector/setup-buildx-action@v3.8.0
34+
with:
35+
install: true
36+
platforms: linux/amd64,linux/arm/v7,linux/arm/v8
37+
38+
# - name: Login to Amazon ECR
39+
# id: login-ecr
40+
# uses: meta-introspector/amazon-ecr-login@v1
41+
42+
- name: Set short sha
43+
id: sha_short
44+
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
45+
46+
- name: Login to Docker Hub
47+
uses: meta-introspector/login-action@v3
48+
with:
49+
username: ${{ vars.DOCKER_HUB_USERNAME }}
50+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
51+
52+
- name: Checkout repository
53+
uses: meta-introspector/checkout@v4
54+
55+
- name: Log in to the Container registry
56+
uses: meta-introspector/login-action@v3.0.0
57+
with:
58+
registry: ${{ env.REGISTRY }}
59+
username: ${{ github.actor }}
60+
password: ${{ secrets.GITHUB_TOKEN }}
61+
62+
- name: Extract metadata (tags, labels) for Docker
63+
id: meta
64+
uses: meta-introspector/metadata-action@v5.5.1
65+
with:
66+
images: |
67+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
68+
h4ckermike/elizaos-eliza
69+
# ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY || 'agent/eliza'}}
70+
71+
- name: Build and push Docker image
72+
id: push
73+
uses: meta-introspector/build-push-action@v6.10.0
74+
with:
75+
platforms: linux/arm64,linux/arm64/v8
76+
context: .
77+
push: true
78+
tags: |
79+
${{ steps.meta.outputs.tags }}
80+
labels: ${{ steps.meta.outputs.labels }}
5381

54-
# This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)."
55-
- name: Generate artifact attestation
56-
uses: actions/attest-build-provenance@v1
57-
with:
58-
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
59-
subject-digest: ${{ steps.push.outputs.digest }}
60-
push-to-registry: true
82+
- name: Generate artifact attestation
83+
uses: meta-introspector/attest-build-provenance@local
84+
with:
85+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
86+
subject-digest: ${{ steps.push.outputs.digest }}
87+
push-to-registry: true
6188

62-
# This step makes the Docker image public, so users can pull it without authentication.
63-
- name: Make Docker image public
64-
run: |
65-
curl \
66-
-X PATCH \
67-
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
68-
-H "Accept: application/vnd.github.v3+json" \
69-
https://api.github.com/user/packages/container/${{ env.IMAGE_NAME }}/visibility \
70-
-d '{"visibility":"public"}'
89+
- name: Make Docker image public
90+
run: |
91+
curl \
92+
-X PATCH \
93+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
94+
-H "Accept: application/vnd.github.v3+json" \
95+
https://api.github.com/user/packages/container/${{ env.IMAGE_NAME }}/visibility \
96+
-d '{"visibility":"public"}'

.github/workflows/pr.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: PR Title Check
22

33
on:
4-
pull_request:
5-
types: [opened, edited, synchronize]
4+
workflow_dispatch:
5+
66

77
jobs:
88
check-pr-title:

.github/workflows/tauri-ci.yml

+2-10
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,8 @@ env:
1111
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
1212

1313
on:
14-
push:
15-
branches: [main, develop, v2-develop]
16-
paths:
17-
- 'packages/app/**'
18-
- '.github/workflows/**'
19-
pull_request:
20-
branches: [v2-develop]
21-
paths:
22-
- 'packages/app/**'
23-
- '.github/workflows/**'
14+
workflow_dispatch:
15+
2416

2517
jobs:
2618
test-build:

.github/workflows/test.yaml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: testdocker
2+
on:
3+
workflow_dispatch:
4+
5+
env:
6+
REGISTRY: ghcr.io
7+
IMAGE_NAME: ${{ github.repository }}
8+
jobs:
9+
build-and-push-image:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
attestations: write
15+
id-token: write
16+
steps:
17+
- name: Login to Docker Hub
18+
uses: meta-introspector/login-action@v3
19+
with:
20+
username: ${{ vars.DOCKER_HUB_USERNAME }}
21+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
22+
- name: Build and push Docker image
23+
id: push
24+
uses: meta-introspector/build-push-action@v6.10.0
25+
with:
26+
platforms: linux/arm64,linux/arm64/v8
27+
context: .
28+
push: true
29+
tags: |
30+
${{ steps.meta.outputs.tags }}
31+
labels: ${{ steps.meta.outputs.labels }}
32+
33+

.gitignore

+52-1
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,55 @@ lerna-debug.log
6565
tsdoc_cache/
6666
tsdoc_comments/
6767

68-
**/elizaDb/**
68+
**/elizaDb/**# -*- mode: gitignore; -*-
69+
*~
70+
\#*\#
71+
/.emacs.desktop
72+
/.emacs.desktop.lock
73+
*.elc
74+
auto-save-list
75+
tramp
76+
.\#*
77+
78+
# Org-mode
79+
.org-id-locations
80+
*_archive
81+
82+
# flymake-mode
83+
*_flymake.*
84+
85+
# eshell files
86+
/eshell/history
87+
/eshell/lastdir
88+
89+
# elpa packages
90+
/elpa/
91+
92+
# reftex files
93+
*.rel
94+
95+
# AUCTeX auto folder
96+
/auto/
97+
98+
# cask packages
99+
.cask/
100+
dist/
101+
102+
# Flycheck
103+
flycheck_*.el
104+
105+
# server auth directory
106+
/server/
107+
108+
# projectiles files
109+
.projectile
110+
111+
# directory configuration
112+
.dir-locals.el
113+
114+
# network security
115+
/network-security.data
116+
117+
packages/autodoc/text_objects/*
118+
/env
119+
pglite/*

.gitmodules

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[submodule "vendor/elizaos/plugin-twitter"]
2+
path = vendor/elizaos/plugin-twitter
3+
url = https://github.com/meta-introspector/plugin-twitter
4+
[submodule "vendor/elizaos/agent-twitter-client"]
5+
path = vendor/elizaos/agent-twitter-client
6+
url = https://github.com/meta-introspector/agent-twitter-client.git
7+
[submodule "vendor/elizaos/client-twitter"]
8+
path = vendor/elizaos/client-twitter
9+
url = https://github.com/meta-introspector/client-twitter-eliza-zos
10+
[submodule "vendor/elizaos/client-discord-eliza"]
11+
path = vendor/elizaos/client-discord-eliza
12+
url = https://github.com/meta-introspector/client-discord-eliza-zos
13+
[submodule "vendor/elizaos/plugin-speech-tts"]
14+
path = vendor/elizaos/plugin-speech-tts
15+
url = https://github.com/meta-introspector/plugin-speech-tts-eliza-zos
16+
[submodule "vendor/elizaos/client-telegram"]
17+
path = vendor/elizaos/client-telegram
18+
url = https://github.com/meta-introspector/client-telegram-eliza-zos
19+
[submodule "characters"]
20+
path = characters
21+
url = https://github.com/meta-introspector/characters-eliza-zos

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v23.3.0
1+
v23.9.0

buildspec.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: 0.2
2+
3+
env:
4+
parameter-store:
5+
DOCKER_USERNAME : "tine_agent_4_docker_username"
6+
DOCKER_PASSWORD : "tine_agent_4_docker_password"
7+
#DOCKER_IMAGE : "tine_agent_7_agent_image"
8+
variables:
9+
DOCKER_IMAGE : "h4ckermike/elizaos-eliza:v2"
10+
11+
12+
phases:
13+
pre_build:
14+
commands:
15+
- apt update
16+
- apt-get install -y ec2-instance-connect git wget unzip systemd ca-certificates curl cloud-utils apt-transport-https ca-certificates software-properties-common
17+
- curl -fsSL test.docker.com -o get-docker.sh && sh get-docker.sh
18+
- echo $DOCKER_PASSWORD | md5sum
19+
- echo $DOCKER_PASSWORD | wc
20+
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
21+
- aws ecr get-login-password --region us-east-2 | docker login --username AWS --password-stdin 767503528736.dkr.ecr.us-east-2.amazonaws.com
22+
build:
23+
commands:
24+
- docker build -t agent/eliza:feb10 .
25+
- docker tag agent/eliza:feb10 767503528736.dkr.ecr.us-east-2.amazonaws.com/agent/eliza:feb10
26+
post_build:
27+
commands:
28+
- docker push 767503528736.dkr.ecr.us-east-2.amazonaws.com/agent/eliza:feb10
29+
- docker tag 767503528736.dkr.ecr.us-east-2.amazonaws.com/agent/eliza:feb10 $DOCKER_IMAGE
30+
- docker push $DOCKER_IMAGE
31+
# h4ckermike/elizaos-eliza:feb10
32+

call_update.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
aws ssm send-command \
2+
--profile solfunmeme_dev \
3+
--region us-east-2 \
4+
--document-name "UpdateEliza" \
5+
--document-version "\$LATEST" \
6+
--targets '[{"Key":"InstanceIds","Values":["i-0b0e822632e0bef20"]}]' \
7+
--parameters '{"ImageParameterName":["tine_agent_4_agent_image"],"CharacterParameterName":["tine-agent-config-1"],"ContainerMemory":["1512"]}' \
8+
--timeout-seconds 600 \
9+
--max-concurrency "50" \
10+
--max-errors "0"

codebuild.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
aws codebuild start-build --region us-east-2 \
3+
--project-name github-runner-codebuild-eliza-build \
4+
--source-version $(git rev-parse --abbrev-ref HEAD) \
5+
--source-type-override GITHUB \
6+
--source-location-override https://github.com/meta-introspector/cloud-deployment-eliza.git \
7+
--git-clone-depth 1 \
8+
--git-submodules-config fetchSubmodules=true

docker-entrypoint-none.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Run command with node if the first argument contains a "-" or is not a system command. The last
5+
# part inside the "{}" is a workaround for the following bug in ash/dash:
6+
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264
7+
set -x
8+
#if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then
9+
#apt update
10+
#apt install -y strace
11+
12+
#export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
13+
#corepack enable && corepack install --global pnpm@9.8.0
14+
15+
#strace -f -o /opt/agent/strace.log -s99999 node CMD ["pnpm", "start", "--characters=characters/eliza.character.json"]
16+
#pnpm start --characters=characters/tine-test.character.json
17+
#pnpm start --characters=$(ls -1p characters/*.json | paste -sd,)
18+
#fi
19+
#exec "$@"
20+
bun start # --characters=$(ls -1p characters/*.json | paste -sd,)

docker-entrypoint-strace.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Run command with node if the first argument contains a "-" or is not a system command. The last
5+
# part inside the "{}" is a workaround for the following bug in ash/dash:
6+
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264
7+
set -x
8+
#if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then
9+
strace -f -o /opt/agent/strace.log -s99999 node "$@"
10+
#fi
11+
#exec "$@"

0 commit comments

Comments
 (0)