Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cloud deployment patch #52

Open
wants to merge 2 commits into
base: v2-develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 87 additions & 61 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
@@ -1,70 +1,96 @@
#

name: Create and publish a Docker image

# Configures this workflow to run every time a change is pushed to the branch called `release`.
on:
release:
types: [created]
workflow_dispatch:
workflow_dispatch:
#push:
#pull_request:

# 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.
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
jobs:
build-and-push-image:
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: write
attestations: write
id-token: write
#
steps:
- name: Checkout repository
uses: actions/checkout@v4
# 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.
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# 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.
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# 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.
# 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.
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
- name: Build and push Docker image
id: push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
#- name: Configure AWS credentials
# uses: meta-introspector/configure-aws-credentials@v4
# with:
# aws-region: ${{ secrets.AWS_REGION || 'us-east-2'}}
# role-session-name: github-actions-${{ env.APP_NAME || 'eliza'}}
# # FIXME hard coded
# role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID || '767503528736' }}:role/github

- name: Set up Docker Buildx
uses: meta-introspector/setup-buildx-action@v3.8.0
with:
install: true
platforms: linux/amd64,linux/arm/v7,linux/arm/v8

# - name: Login to Amazon ECR
# id: login-ecr
# uses: meta-introspector/amazon-ecr-login@v1

- name: Set short sha
id: sha_short
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Login to Docker Hub
uses: meta-introspector/login-action@v3
with:
username: ${{ vars.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Checkout repository
uses: meta-introspector/checkout@v4

- name: Log in to the Container registry
uses: meta-introspector/login-action@v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: meta-introspector/metadata-action@v5.5.1
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
h4ckermike/elizaos-eliza
# ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY || 'agent/eliza'}}

- name: Build and push Docker image
id: push
uses: meta-introspector/build-push-action@v6.10.0
with:
platforms: linux/arm64,linux/arm64/v8
context: .
push: true
tags: |
${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

# 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)."
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
- name: Generate artifact attestation
uses: meta-introspector/attest-build-provenance@local
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

# This step makes the Docker image public, so users can pull it without authentication.
- name: Make Docker image public
run: |
curl \
-X PATCH \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/user/packages/container/${{ env.IMAGE_NAME }}/visibility \
-d '{"visibility":"public"}'
- name: Make Docker image public
run: |
curl \
-X PATCH \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/user/packages/container/${{ env.IMAGE_NAME }}/visibility \
-d '{"visibility":"public"}'
7 changes: 1 addition & 6 deletions .github/workflows/integrationTests.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
name: Integration Tests

on:
push:
branches:
- "*"
pull_request_target:
branches:
- "*"
workflow_dispatch:

env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: PR Title Check

on:
pull_request:
types: [opened, edited, synchronize]
workflow_dispatch:


jobs:
check-pr-title:
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/tauri-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,8 @@ env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1

on:
push:
branches: [main, develop, v2-develop]
paths:
- 'packages/app/**'
- '.github/workflows/**'
pull_request:
branches: [v2-develop]
paths:
- 'packages/app/**'
- '.github/workflows/**'
workflow_dispatch:


jobs:
test-build:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: testdocker
on:
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Login to Docker Hub
uses: meta-introspector/login-action@v3
with:
username: ${{ vars.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push Docker image
id: push
uses: meta-introspector/build-push-action@v6.10.0
with:
platforms: linux/arm64,linux/arm64/v8
context: .
push: true
tags: |
${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}


52 changes: 51 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,54 @@ lerna-debug.log
tsdoc_cache/
tsdoc_comments/

**/elizaDb/**
**/elizaDb/**# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*

# Org-mode
.org-id-locations
*_archive

# flymake-mode
*_flymake.*

# eshell files
/eshell/history
/eshell/lastdir

# elpa packages
/elpa/

# reftex files
*.rel

# AUCTeX auto folder
/auto/

# cask packages
.cask/
dist/

# Flycheck
flycheck_*.el

# server auth directory
/server/

# projectiles files
.projectile

# directory configuration
.dir-locals.el

# network security
/network-security.data

packages/autodoc/text_objects/*
/env
21 changes: 21 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[submodule "vendor/elizaos/plugin-twitter"]
path = vendor/elizaos/plugin-twitter
url = https://github.com/meta-introspector/plugin-twitter
[submodule "vendor/elizaos/agent-twitter-client"]
path = vendor/elizaos/agent-twitter-client
url = https://github.com/meta-introspector/agent-twitter-client.git
[submodule "vendor/elizaos/client-twitter"]
path = vendor/elizaos/client-twitter
url = https://github.com/meta-introspector/client-twitter-eliza-zos
[submodule "vendor/elizaos/client-discord-eliza"]
path = vendor/elizaos/client-discord-eliza
url = https://github.com/meta-introspector/client-discord-eliza-zos
[submodule "vendor/elizaos/plugin-speech-tts"]
path = vendor/elizaos/plugin-speech-tts
url = https://github.com/meta-introspector/plugin-speech-tts-eliza-zos
[submodule "vendor/elizaos/client-telegram"]
path = vendor/elizaos/client-telegram
url = https://github.com/meta-introspector/client-telegram-eliza-zos
[submodule "characters"]
path = characters
url = https://github.com/meta-introspector/characters-eliza-zos
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v23.3.0
v23.9.0
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
- feat: add docs for story plugin [\#1672](https://github.com/elizaOS/eliza/pull/1672) ([chandiniv1](https://github.com/chandiniv1))
- fix: 1668 fix twitter image link [\#1671](https://github.com/elizaOS/eliza/pull/1671) ([nusk0](https://github.com/nusk0))
- fix: 1634 fix image description service [\#1667](https://github.com/elizaOS/eliza/pull/1667) ([nusk0](https://github.com/nusk0))
- fix: Seperated imageModelProvider and imageVisionModelProvider for ImageDescriptioServices [\#1664](https://github.com/elizaOS/eliza/pull/1664) ([denizekiz](https://github.com/denizekiz))
- fix: Separated imageModelProvider and imageVisionModelProvider for ImageDescriptionServices [\#1664](https://github.com/elizaOS/eliza/pull/1664) ([denizekiz](https://github.com/denizekiz))
- fix: Update Supabase schema.sql [\#1660](https://github.com/elizaOS/eliza/pull/1660) ([0xRider](https://github.com/0xRider))
- fix: Fix bug in plugin-bootstrap/src/evaluators/facts.ts [\#1648](https://github.com/elizaOS/eliza/pull/1648) ([metakai1](https://github.com/metakai1))
- Added Hungarian README [\#1645](https://github.com/elizaOS/eliza/pull/1645) ([mdominikd](https://github.com/mdominikd))
Expand Down Expand Up @@ -188,7 +188,7 @@
- bun install shows errors [\#1234](https://github.com/elizaOS/eliza/issues/1234)
- Long tweets fail with error Tweet needs to be a bit shorter \(Code 186\) [\#1178](https://github.com/elizaOS/eliza/issues/1178)
- Unable to Perform Transfer with plugin-evm Due to Parameter Parsing Error [\#964](https://github.com/elizaOS/eliza/issues/964)
- I have a twitter premium subscription and MAX\_TWEET\_LENGTH to 2500 but I can't to post a tweet with more than 280 characteres [\#883](https://github.com/elizaOS/eliza/issues/883)
- I have a twitter premium subscription and MAX\_TWEET\_LENGTH to 2500 but I can't to post a tweet with more than 280 characters [\#883](https://github.com/elizaOS/eliza/issues/883)
- Twitter cookies do not match the docs [\#558](https://github.com/elizaOS/eliza/issues/558)

**Closed issues:**
Expand Down
28 changes: 2 additions & 26 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,45 +27,21 @@ COPY scripts ./scripts
# Copy source code
COPY packages ./packages



# Install dependencies
RUN bun install
RUN bun add better-sqlite3

# Build the project
RUN bun run build

# Create a new stage for the final image
FROM node:23.3.0-slim

WORKDIR /app

# Install Node.js 23.3.0 and required dependencies
RUN apt-get update && \
apt-get install -y curl git python3 make g++ unzip build-essential nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install bun using npm
RUN npm install -g bun turbo@2.3.3

# Copy built artifacts and production dependencies from the builder stage
COPY --from=builder /app/package.json ./
COPY --from=builder /app/tsconfig.json ./
COPY --from=builder /app/turbo.json ./
COPY --from=builder /app/lerna.json ./
COPY --from=builder /app/renovate.json ./
COPY --from=builder /app/biome.json ./
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/packages ./packages
COPY --from=builder /app/scripts ./scripts

# Set environment variables
ENV NODE_ENV=production

# Expose any necessary ports (if needed)
EXPOSE 3000 5173


# Start the application
CMD ["bun", "run", "start"]
CMD ["bun", "start"]
Loading
Loading