From 5d4de9d6c0c2128e5783293fd0190fc3c2603de6 Mon Sep 17 00:00:00 2001 From: Shawn TIAN Date: Wed, 23 Apr 2025 10:58:06 +0800 Subject: [PATCH] update docs --- .../imgs}/01_create_agent_on_phala_cloud.png | Bin .../swarms_cloud/imgs}/02_serial_logs.png | Bin .../swarms_cloud/imgs}/03_serial_logs.png | Bin .../imgs}/04_swarms_agent_containers.png | Bin .../swarms_cloud/imgs}/05_agent_output.png | Bin .../swarms_cloud/imgs}/06_attestation.png | Bin docs/swarms_cloud/phala_deploy.md | 81 ++++++++++-------- tee/README.md | 14 +-- 8 files changed, 55 insertions(+), 40 deletions(-) rename {tee => docs/swarms_cloud/imgs}/01_create_agent_on_phala_cloud.png (100%) rename {tee => docs/swarms_cloud/imgs}/02_serial_logs.png (100%) rename {tee => docs/swarms_cloud/imgs}/03_serial_logs.png (100%) rename {tee => docs/swarms_cloud/imgs}/04_swarms_agent_containers.png (100%) rename {tee => docs/swarms_cloud/imgs}/05_agent_output.png (100%) rename {tee => docs/swarms_cloud/imgs}/06_attestation.png (100%) diff --git a/tee/01_create_agent_on_phala_cloud.png b/docs/swarms_cloud/imgs/01_create_agent_on_phala_cloud.png similarity index 100% rename from tee/01_create_agent_on_phala_cloud.png rename to docs/swarms_cloud/imgs/01_create_agent_on_phala_cloud.png diff --git a/tee/02_serial_logs.png b/docs/swarms_cloud/imgs/02_serial_logs.png similarity index 100% rename from tee/02_serial_logs.png rename to docs/swarms_cloud/imgs/02_serial_logs.png diff --git a/tee/03_serial_logs.png b/docs/swarms_cloud/imgs/03_serial_logs.png similarity index 100% rename from tee/03_serial_logs.png rename to docs/swarms_cloud/imgs/03_serial_logs.png diff --git a/tee/04_swarms_agent_containers.png b/docs/swarms_cloud/imgs/04_swarms_agent_containers.png similarity index 100% rename from tee/04_swarms_agent_containers.png rename to docs/swarms_cloud/imgs/04_swarms_agent_containers.png diff --git a/tee/05_agent_output.png b/docs/swarms_cloud/imgs/05_agent_output.png similarity index 100% rename from tee/05_agent_output.png rename to docs/swarms_cloud/imgs/05_agent_output.png diff --git a/tee/06_attestation.png b/docs/swarms_cloud/imgs/06_attestation.png similarity index 100% rename from tee/06_attestation.png rename to docs/swarms_cloud/imgs/06_attestation.png diff --git a/docs/swarms_cloud/phala_deploy.md b/docs/swarms_cloud/phala_deploy.md index 10b43d20..5627f04c 100644 --- a/docs/swarms_cloud/phala_deploy.md +++ b/docs/swarms_cloud/phala_deploy.md @@ -14,55 +14,68 @@ For detailed instructions about Trusted Execution Environment setup, please refe ## 🚀 Deployment Steps -### 1. Build and Publish Docker Image +### 1. Configure Your Environment -```bash -# Build the Docker image -docker compose build -t /swarm-agent-node:latest - -# Push to DockerHub -docker push /swarm-agent-node:latest -``` - -### 2. Deploy to Phala Cloud - -Choose one of these deployment methods: -- Use [tee-cloud-cli](https://github.com/Phala-Network/tee-cloud-cli) (Recommended) -- Deploy manually via the [Phala Cloud Dashboard](https://cloud.phala.network/) - -### 3. Verify TEE Attestation - -Visit the [TEE Attestation Explorer](https://proof.t16z.com/) to check and verify your agent's TEE proof. - -## 📝 Docker Configuration - -Below is a sample Docker Compose configuration for your Swarms agent: +First, prepare your `docker-compose.yaml` file. You can find an example in [docker-compose.yaml](./docker-compose.yaml). Make sure to have your OpenAI API key ready. ```yaml services: swarms-agent-server: - image: swarms-agent-node:latest - platform: linux/amd64 + image: python:3.12-slim volumes: - - /var/run/tappd.sock:/var/run/tappd.sock - swarms:/app restart: always - ports: - - 8000:8000 - command: # Sample MCP Server + environment: + - OPENAI_API_KEY=${OPENAI_API_KEY} + command: # Run swarms agent example - /bin/sh - -c - | - cd /app/mcp_example - python mcp_test.py + # install dependencies + apt update && apt install -y git python3-pip + mkdir -p /app && cd /app + + git clone --depth 1 https://github.com/The-Swarm-Corporation/swarms-examples + cd swarms-examples/ + pip install -r requirements.txt && pip install langchain-community langchain-core + cd examples/agents/ + python o1_preview.py + + # keep container running + sleep infinity + volumes: swarms: ``` -## 📚 Additional Resources +### 2. Deploy to Phala Cloud -For more comprehensive documentation and examples, visit our [Official Documentation](https://docs.swarms.world/en/latest/). +Choose one of these deployment methods: + +- Use [tee-cloud-cli](https://github.com/Phala-Network/tee-cloud-cli) (Recommended) +- Deploy manually via the [Phala Cloud Dashboard](https://cloud.phala.network/) + 1. Navigate to the [Phala Cloud dashboard](https://cloud.phala.network/dashboard) + 2. Create a new Swarms agent application + ![Creating a Swarms agent on Phala Cloud](./imgs/01_create_agent_on_phala_cloud.png) + +### 3. Monitor Your Deployment + +1. Check the initialization logs of your agent + ![Agent initialization logs](./imgs/02_serial_logs.png) + ![Detailed initialization logs](./imgs/03_serial_logs.png) ---- +2. Verify your container is running + ![Swarms Agent Container Status](./imgs/04_swarms_agent_containers.png) -> **Note**: Make sure to replace `` with your actual DockerHub username when building and pushing the image. \ No newline at end of file +3. Monitor your agent's output + ![Swarms Agent Logs](./imgs/05_agent_output.png) + +### 4. Verify TEE Attestation + +Visit the [TEE Attestation Explorer](https://proof.t16z.com/) to check and verify your agent's TEE proof. + +![TEE Attestation Verification](./imgs/06_attestation.png) + +## 📚 Additional Resources + +For more comprehensive documentation and examples, visit our [Official Documentation](https://docs.swarms.world/en/latest/). diff --git a/tee/README.md b/tee/README.md index b830a24e..816cb421 100644 --- a/tee/README.md +++ b/tee/README.md @@ -48,26 +48,28 @@ volumes: 1. Navigate to the [Phala Cloud dashboard](https://cloud.phala.network/dashboard) 2. Create a new Swarms agent application - ![Creating a Swarms agent on Phala Cloud](./01_create_agent_on_phala_cloud.png) + ![Creating a Swarms agent on Phala Cloud](../docs/swarms_cloud/imgs/01_create_agent_on_phala_cloud.png) ### 3. 📊 Monitor Your Deployment 1. Check the initialization logs of your agent - ![Agent initialization logs](./02_serial_logs.png) - ![Detailed initialization logs](./03_serial_logs.png) + ![Agent initialization logs](../docs/swarms_cloud/imgs/02_serial_logs.png) + ![Detailed initialization logs](../docs/swarms_cloud/imgs/03_serial_logs.png) 2. Verify your container is running - ![Swarms Agent Container Status](./04_swarms_agent_containers.png) + ![Swarms Agent Container Status](../docs/swarms_cloud/imgs/04_swarms_agent_containers.png) 3. Monitor your agent's output - ![Swarms Agent Logs](./05_agent_output.png) + ![Swarms Agent Logs](../docs/swarms_cloud/imgs/05_agent_output.png) ### 4. ✅ Verify TEE Attestation Ensure your agent is running in a secure TEE environment by checking the attestation proof on the [TEE Attestation Explorer](https://proof.t16z.com/). -![TEE Attestation Verification](./06_attestation.png) +![TEE Attestation Verification](../docs/swarms_cloud/imgs/06_attestation.png) ## 🎉 Success! You've successfully deployed your Swarms Agent in a secure TEE environment using Phala Cloud. Your agent is now running in an isolated, trusted execution environment, ensuring enhanced security for your AI operations. + +If you have any questions, please reach out to us on [Phala Cloud](https://cloud.phala.network/).