DevOps: Prepare Github action for building online Docker images (#316)
Browse files- .github/workflows/docker-build.yml +44 -0
- README.md +44 -9
- README_zh.md +44 -10
.github/workflows/docker-build.yml
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Build and Publish Docker Image
|
2 |
+
|
3 |
+
on:
|
4 |
+
push:
|
5 |
+
branches:
|
6 |
+
- main
|
7 |
+
- test-docker-build
|
8 |
+
workflow_dispatch: # Allow manual triggering
|
9 |
+
|
10 |
+
jobs:
|
11 |
+
build-and-push:
|
12 |
+
name: Build and Push Docker Image
|
13 |
+
runs-on: ubuntu-latest
|
14 |
+
|
15 |
+
steps:
|
16 |
+
- name: Checkout code
|
17 |
+
uses: actions/checkout@v3
|
18 |
+
|
19 |
+
- name: Set up QEMU
|
20 |
+
uses: docker/setup-qemu-action@v2
|
21 |
+
with:
|
22 |
+
platforms: 'arm64,amd64'
|
23 |
+
|
24 |
+
- name: Set up Docker Buildx
|
25 |
+
uses: docker/setup-buildx-action@v2
|
26 |
+
|
27 |
+
- name: Login to Docker Hub
|
28 |
+
uses: docker/login-action@v2
|
29 |
+
with:
|
30 |
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
31 |
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
32 |
+
|
33 |
+
- name: Build and push
|
34 |
+
uses: docker/build-push-action@v4
|
35 |
+
with:
|
36 |
+
context: .
|
37 |
+
file: .container/Dockerfile
|
38 |
+
platforms: linux/amd64,linux/arm64
|
39 |
+
push: true
|
40 |
+
tags: |
|
41 |
+
mugglejinx/owl:latest
|
42 |
+
mugglejinx/owl:${{ github.sha }}
|
43 |
+
cache-from: type=registry,ref=mugglejinx/owl:buildcache
|
44 |
+
cache-to: type=registry,ref=mugglejinx/owl:buildcache,mode=max
|
README.md
CHANGED
@@ -260,6 +260,10 @@ Alternatively, you can set environment variables directly in your terminal:
|
|
260 |
|
261 |
## **Running with Docker**
|
262 |
|
|
|
|
|
|
|
|
|
263 |
```bash
|
264 |
# Clone the repository
|
265 |
git clone https://github.com/camel-ai/owl.git
|
@@ -268,32 +272,63 @@ cd owl
|
|
268 |
# Configure environment variables
|
269 |
cp owl/.env_template owl/.env
|
270 |
# Edit the .env file and fill in your API keys
|
|
|
271 |
|
272 |
-
|
273 |
-
# (By default it's using pre-built online image, you can also check the docker-compose.yml for building locally)
|
274 |
-
cd .container
|
275 |
|
|
|
|
|
|
|
|
|
|
|
276 |
docker-compose up -d
|
277 |
|
278 |
# Run OWL inside the container
|
279 |
docker-compose exec owl bash
|
280 |
-
|
281 |
-
# activate the virtual environment
|
282 |
cd .. && source .venv/bin/activate
|
|
|
|
|
|
|
|
|
|
|
283 |
|
284 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
|
286 |
-
#
|
|
|
|
|
|
|
287 |
xvfb-python examples/run.py
|
|
|
|
|
|
|
288 |
|
289 |
-
|
|
|
290 |
cd .container
|
|
|
|
|
291 |
chmod +x build_docker.sh
|
292 |
./build_docker.sh
|
293 |
-
|
|
|
294 |
./run_in_docker.sh "your question"
|
295 |
```
|
296 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
For more detailed Docker usage instructions, including cross-platform support, optimized configurations, and troubleshooting, please refer to [DOCKER_README.md](.container/DOCKER_README_en.md).
|
298 |
|
299 |
# 🚀 Quick Start
|
|
|
260 |
|
261 |
## **Running with Docker**
|
262 |
|
263 |
+
OWL can be easily deployed using Docker, which provides a consistent environment across different platforms.
|
264 |
+
|
265 |
+
### **Setup Instructions**
|
266 |
+
|
267 |
```bash
|
268 |
# Clone the repository
|
269 |
git clone https://github.com/camel-ai/owl.git
|
|
|
272 |
# Configure environment variables
|
273 |
cp owl/.env_template owl/.env
|
274 |
# Edit the .env file and fill in your API keys
|
275 |
+
```
|
276 |
|
277 |
+
### **Deployment Options**
|
|
|
|
|
278 |
|
279 |
+
#### **Option 1: Using Pre-built Image (Recommended)**
|
280 |
+
|
281 |
+
```bash
|
282 |
+
# This option downloads a ready-to-use image from Docker Hub
|
283 |
+
# Fastest and recommended for most users
|
284 |
docker-compose up -d
|
285 |
|
286 |
# Run OWL inside the container
|
287 |
docker-compose exec owl bash
|
|
|
|
|
288 |
cd .. && source .venv/bin/activate
|
289 |
+
playwright install-deps
|
290 |
+
xvfb-python examples/run.py
|
291 |
+
```
|
292 |
+
|
293 |
+
#### **Option 2: Building Image Locally**
|
294 |
|
295 |
+
```bash
|
296 |
+
# For users who need to customize the Docker image or cannot access Docker Hub:
|
297 |
+
# 1. Open docker-compose.yml
|
298 |
+
# 2. Comment out the "image: mugglejinx/owl:latest" line
|
299 |
+
# 3. Uncomment the "build:" section and its nested properties
|
300 |
+
# 4. Then run:
|
301 |
+
docker-compose up -d --build
|
302 |
|
303 |
+
# Run OWL inside the container
|
304 |
+
docker-compose exec owl bash
|
305 |
+
cd .. && source .venv/bin/activate
|
306 |
+
playwright install-deps
|
307 |
xvfb-python examples/run.py
|
308 |
+
```
|
309 |
+
|
310 |
+
#### **Option 3: Using Convenience Scripts**
|
311 |
|
312 |
+
```bash
|
313 |
+
# Navigate to container directory
|
314 |
cd .container
|
315 |
+
|
316 |
+
# Make the script executable and build the Docker image
|
317 |
chmod +x build_docker.sh
|
318 |
./build_docker.sh
|
319 |
+
|
320 |
+
# Run OWL with your question
|
321 |
./run_in_docker.sh "your question"
|
322 |
```
|
323 |
|
324 |
+
### **MCP Desktop Commander Setup**
|
325 |
+
|
326 |
+
If using MCP Desktop Commander within Docker, run:
|
327 |
+
|
328 |
+
```bash
|
329 |
+
npx -y @wonderwhy-er/desktop-commander setup --force-file-protocol
|
330 |
+
```
|
331 |
+
|
332 |
For more detailed Docker usage instructions, including cross-platform support, optimized configurations, and troubleshooting, please refer to [DOCKER_README.md](.container/DOCKER_README_en.md).
|
333 |
|
334 |
# 🚀 Quick Start
|
README_zh.md
CHANGED
@@ -253,7 +253,9 @@ OWL 需要各种 API 密钥来与不同的服务进行交互。`owl/.env_templat
|
|
253 |
|
254 |
## **使用Docker运行**
|
255 |
|
256 |
-
|
|
|
|
|
257 |
|
258 |
```bash
|
259 |
# 克隆仓库
|
@@ -263,32 +265,64 @@ cd owl
|
|
263 |
# 配置环境变量
|
264 |
cp owl/.env_template owl/.env
|
265 |
# 编辑.env文件,填入您的API密钥
|
|
|
266 |
|
267 |
-
|
268 |
-
|
|
|
269 |
|
|
|
|
|
|
|
270 |
docker-compose up -d
|
271 |
|
272 |
# 在容器中运行OWL
|
273 |
docker-compose exec owl bash
|
274 |
-
|
275 |
-
# 激活虚拟环境
|
276 |
cd .. && source .venv/bin/activate
|
|
|
|
|
|
|
|
|
|
|
277 |
|
278 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
|
280 |
-
|
|
|
|
|
|
|
281 |
xvfb-python examples/run.py
|
|
|
|
|
|
|
282 |
|
283 |
-
|
|
|
284 |
cd .container
|
|
|
|
|
285 |
chmod +x build_docker.sh
|
286 |
./build_docker.sh
|
287 |
-
|
|
|
288 |
./run_in_docker.sh "您的问题"
|
289 |
```
|
290 |
|
291 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
292 |
|
293 |
# 🚀 快速开始
|
294 |
|
|
|
253 |
|
254 |
## **使用Docker运行**
|
255 |
|
256 |
+
OWL可以通过Docker轻松部署,Docker提供了跨不同平台的一致环境。
|
257 |
+
|
258 |
+
### **设置说明**
|
259 |
|
260 |
```bash
|
261 |
# 克隆仓库
|
|
|
265 |
# 配置环境变量
|
266 |
cp owl/.env_template owl/.env
|
267 |
# 编辑.env文件,填入您的API密钥
|
268 |
+
```
|
269 |
|
270 |
+
### **部署选项**
|
271 |
+
|
272 |
+
#### **选项1:使用预构建镜像(推荐)**
|
273 |
|
274 |
+
```bash
|
275 |
+
# 此选项从Docker Hub下载一个即用型镜像
|
276 |
+
# 最快速且推荐给大多数用户
|
277 |
docker-compose up -d
|
278 |
|
279 |
# 在容器中运行OWL
|
280 |
docker-compose exec owl bash
|
|
|
|
|
281 |
cd .. && source .venv/bin/activate
|
282 |
+
playwright install-deps
|
283 |
+
xvfb-python examples/run.py
|
284 |
+
```
|
285 |
+
|
286 |
+
#### **选项2:本地构建镜像**
|
287 |
|
288 |
+
```bash
|
289 |
+
# 适用于需要自定义Docker镜像或无法访问Docker Hub的用户:
|
290 |
+
# 1. 打开docker-compose.yml
|
291 |
+
# 2. 注释掉"image: mugglejinx/owl:latest"行
|
292 |
+
# 3. 取消注释"build:"部分及其嵌套属性
|
293 |
+
# 4. 然后运行:
|
294 |
+
docker-compose up -d --build
|
295 |
|
296 |
+
# 在容器中运行OWL
|
297 |
+
docker-compose exec owl bash
|
298 |
+
cd .. && source .venv/bin/activate
|
299 |
+
playwright install-deps
|
300 |
xvfb-python examples/run.py
|
301 |
+
```
|
302 |
+
|
303 |
+
#### **选项3:使用便捷脚本**
|
304 |
|
305 |
+
```bash
|
306 |
+
# 导航到容器目录
|
307 |
cd .container
|
308 |
+
|
309 |
+
# 使脚本可执行并构建Docker镜像
|
310 |
chmod +x build_docker.sh
|
311 |
./build_docker.sh
|
312 |
+
|
313 |
+
# 使用您的问题运行OWL
|
314 |
./run_in_docker.sh "您的问题"
|
315 |
```
|
316 |
|
317 |
+
### **MCP Desktop Commander设置**
|
318 |
+
|
319 |
+
如果在Docker中使用MCP Desktop Commander,请运行:
|
320 |
+
|
321 |
+
```bash
|
322 |
+
npx -y @wonderwhy-er/desktop-commander setup --force-file-protocol
|
323 |
+
```
|
324 |
+
|
325 |
+
更多详细的Docker使用说明,包括跨平台支持、优化配置和故障排除,请参阅 [DOCKER_README.md](.container/DOCKER_README_en.md)
|
326 |
|
327 |
# 🚀 快速开始
|
328 |
|