eliza icon indicating copy to clipboard operation
eliza copied to clipboard

Kubernetes for anyone to quickly deploy

Open marcellodesales opened this issue 11 months ago • 9 comments

Is your feature request related to a problem? Please describe.

I'm looking for a team of people interested in deploying multiple Eliza in a Kubernetes cluster

Describe the solution you'd like

Deployment infrastructure using CloudNative. I see we have docker-compose already, so we should be able to build something higher-level.

Describe alternatives you've considered

There's nothing yet

Additional context

After watching Shaw's interview at https://www.youtube.com/watch?v=5GBXS5myXz0, I'm certain we can create something that's quickly deployable for at a large-scale.

marcellodesales avatar Jan 02 '25 23:01 marcellodesales

Hello @marcellodesales! Welcome to the ai16z community. Thank you for opening your first issue; we appreciate your contribution. You are now a ai16z contributor!

github-actions[bot] avatar Jan 02 '25 23:01 github-actions[bot]

A simple and efficient approach is to use environment variables in the Dockerfile to load .env and characters configuration files, and then use Kubernetes configuration files to mount different configurations for each Eliza container.


1. Use Environment Variables in the Dockerfile:

Define default environment variables in the Dockerfile using the ENV directive to specify the paths for the .env and characters configuration files.

# Set default configuration file paths
ENV ENV_FILE_PATH=/app/config/.env
ENV CHARACTERS_FILE_PATH=/app/config/characters.json

2. Dynamically Load Configurations in the Application:

Ensure that the application can dynamically load the .env and characters configuration files using the paths specified in the environment variables. This allows the application to adapt to different environments at runtime.


3. Use Different Config in Kubernetes:

Example Kubernetes Configuration:


apiVersion: v1
kind: Pod
metadata:
  name: eliza-instance1
spec:
  containers:
    - name: eliza-container
      image: your-eliza-image
      env:
        - name: ENV_FILE_PATH
          value: "/config/.env1"
        - name: CHARACTERS_FILE_PATH
          value: "/config/charactersXXX.json"
      volumeMounts:
        - name: config-volume
          mountPath: /config
  volumes:
    - name: config-volume
      configMap:
        name: eliza-config-instance1

4. Load Different Configurations for Different Instances:

  • Create separate Config for each Eliza instance, with customized content as needed.
  • Reference the corresponding Config in the Kubernetes configuration file to ensure each instance loads the correct configuration.

flingjie avatar Jan 03 '25 02:01 flingjie

@flingjie thank you! That's a good start! :) I will play with it a bit this weekend... who knows a multi-agent system to do what I need in a shot...

marcellodesales avatar Jan 03 '25 02:01 marcellodesales

Im interested in this because of a plug-in im developing. https://github.com/fetchai/uAgents this framework do it i think in python. We can port it into Eliza in no time.

AIFlowML avatar Jan 03 '25 03:01 AIFlowML

@marcellodesales I'm interested, can we connect on discord or slack or any platform, for seamless communication for enhancing this ?

vanshpatelx avatar Jan 03 '25 12:01 vanshpatelx

@vanshpatelx yeah absolutely... I still need to get through the docs from Eliza as I'm still 2 days old on this since I watched the Shaw's interview...

@AIFlowML I haven't seen the uAgents, but if they can be deployed as containers in an isolated KXS cluster (K8S or even K3S), there are a couple of use cases we can tackle to create a library of agents that are simpler to deploy in an expected and controlled/safer environment...

I'm still going through the docs on my breaks (full-time job + 1-year old baby)... Hope this weekend I will get some time to play with this...

marcellodesales avatar Jan 03 '25 22:01 marcellodesales

@marcellodesales Yeah, I will also go through docs, when you are free. just tell me, we discuss next steps. [email protected]

vanshpatelx avatar Jan 04 '25 13:01 vanshpatelx

Have you guys had any movement on this front, would love to collaborate here.

ShahNewazKhan avatar Jan 07 '25 19:01 ShahNewazKhan

@ShahNewazKhan I go through doc of this, let's connect and discuss more.

vanshpatelx avatar Jan 08 '25 01:01 vanshpatelx

This issue has been automatically marked as stale due to 30 days of inactivity. If no further activity occurs within 7 days, it will be closed automatically. Please take action if this issue is still relevant.

github-actions[bot] avatar Feb 07 '25 18:02 github-actions[bot]

@ShahNewazKhan @vanshpatelx @AIFlowML I might be able to start working on it this weekend...

  • Provide Kustomization Repository
  • Deployments:
    • Ollama Server
    • An Eliza Agent from the samples
    • n8n UI for automation
    • Ollama UI
  • Istio:
    • Add a layer for traffic management

Are there other stuff to add? What packages are we thinking to have in a clean deployment?

marcellodesales avatar Feb 07 '25 20:02 marcellodesales

@ShahNewazKhan @vanshpatelx @AIFlowML I might be able to start working on it this weekend...

  • Provide Kustomization Repository

  • Deployments:

    • Ollama Server
    • An Eliza Agent from the samples
    • n8n UI for automation
    • Ollama UI
  • Istio:

    • Add a layer for traffic management

Are there other stuff to add? What packages are we thinking to have in a clean deployment?

@marcellodesales this is adding scope for this, but it might make sense to create a docker-compose deployment first and convert it to k8s manifest files using a tool like https://kompose.io/

ShahNewazKhan avatar Feb 08 '25 00:02 ShahNewazKhan

@ShahNewazKhan @vanshpatelx @AIFlowML I might be able to start working on it this weekend...

  • Provide Kustomization Repository

  • Deployments:

    • Ollama Server
    • An Eliza Agent from the samples
    • n8n UI for automation
    • Ollama UI
  • Istio:

    • Add a layer for traffic management

Are there other stuff to add? What packages are we thinking to have in a clean deployment?

it's better some core features of Eliza like Memory Management (RAG) means any DB adapter in samples (example) code, also we can make two deployment one is for pure production anb another normal dev env.

vanshpatelx avatar Feb 08 '25 18:02 vanshpatelx