feat: Add Temporal and Windmill services with configuration files
- Implemented Temporal service with Docker Compose, including PostgreSQL setup and environment variables for configuration. - Added Temporal README and Chinese translation for documentation. - Introduced Windmill service with Docker Compose, including PostgreSQL setup and environment variables for configuration. - Added Windmill README and Chinese translation for documentation. - Updated MongoDB configurations to use host.docker.internal for better compatibility.
This commit is contained in:
42
src/conductor/.env.example
Normal file
42
src/conductor/.env.example
Normal file
@@ -0,0 +1,42 @@
|
||||
# Conductor Configuration
|
||||
|
||||
# Versions
|
||||
POSTGRES_VERSION=16-alpine
|
||||
ELASTICSEARCH_VERSION=8.11.0
|
||||
|
||||
# Port Configuration
|
||||
CONDUCTOR_SERVER_PORT_OVERRIDE=8080
|
||||
CONDUCTOR_UI_PORT_OVERRIDE=5000
|
||||
CONDUCTOR_GRPC_PORT=8090
|
||||
|
||||
# PostgreSQL Configuration
|
||||
POSTGRES_DB=conductor
|
||||
POSTGRES_USER=conductor
|
||||
POSTGRES_PASSWORD=conductor
|
||||
|
||||
# Logging
|
||||
CONDUCTOR_LOG_LEVEL=INFO
|
||||
|
||||
# Elasticsearch Configuration
|
||||
ELASTICSEARCH_HEAP_SIZE=512m
|
||||
|
||||
# Timezone
|
||||
TZ=UTC
|
||||
|
||||
# Resource Limits - Conductor Server
|
||||
CONDUCTOR_CPU_LIMIT=2.0
|
||||
CONDUCTOR_CPU_RESERVATION=0.5
|
||||
CONDUCTOR_MEMORY_LIMIT=2G
|
||||
CONDUCTOR_MEMORY_RESERVATION=512M
|
||||
|
||||
# Resource Limits - PostgreSQL
|
||||
POSTGRES_CPU_LIMIT=1.0
|
||||
POSTGRES_CPU_RESERVATION=0.25
|
||||
POSTGRES_MEMORY_LIMIT=1G
|
||||
POSTGRES_MEMORY_RESERVATION=256M
|
||||
|
||||
# Resource Limits - Elasticsearch
|
||||
ELASTICSEARCH_CPU_LIMIT=2.0
|
||||
ELASTICSEARCH_CPU_RESERVATION=0.5
|
||||
ELASTICSEARCH_MEMORY_LIMIT=2G
|
||||
ELASTICSEARCH_MEMORY_RESERVATION=1G
|
||||
169
src/conductor/README.md
Normal file
169
src/conductor/README.md
Normal file
@@ -0,0 +1,169 @@
|
||||
# Conductor
|
||||
|
||||
Netflix Conductor is a workflow orchestration engine that runs in the cloud. It allows you to orchestrate microservices and workflows with a visual workflow designer.
|
||||
|
||||
## Features
|
||||
|
||||
- **Visual Workflow Designer**: Drag-and-drop interface for building complex workflows
|
||||
- **Microservice Orchestration**: Coordinate multiple services with decision logic
|
||||
- **Task Management**: Built-in retry mechanisms and error handling
|
||||
- **Scalable Architecture**: Designed for high-throughput scenarios
|
||||
- **REST API**: Full REST API with SDKs for Java, Python, Go, C#
|
||||
- **Monitoring**: Real-time monitoring and metrics via Prometheus
|
||||
|
||||
## Quick Start
|
||||
|
||||
1. Copy `.env.example` to `.env`:
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
2. (Optional) Edit `.env` to customize database passwords and other settings
|
||||
|
||||
3. Start Conductor (note: first run will build the image, may take several minutes):
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
4. Wait for services to be healthy (check with `docker compose ps`)
|
||||
|
||||
5. Access Conductor UI at `http://localhost:5000`
|
||||
|
||||
6. API is available at `http://localhost:8080`
|
||||
|
||||
## Default Configuration
|
||||
|
||||
| Service | Port | Description |
|
||||
| ---------------- | ---- | ---------------------------- |
|
||||
| Conductor Server | 8080 | REST API |
|
||||
| Conductor UI | 5000 | Web UI |
|
||||
| PostgreSQL | 5432 | Database (internal) |
|
||||
| Elasticsearch | 9200 | Search & indexing (internal) |
|
||||
|
||||
**Authentication**: No authentication is configured by default. Add an authentication layer (reverse proxy with OAuth2, LDAP, etc.) in production.
|
||||
|
||||
## Environment Variables
|
||||
|
||||
Key environment variables (see `.env.example` for full list):
|
||||
|
||||
| Variable | Description | Default |
|
||||
| -------------------------------- | --------------------- | ----------- |
|
||||
| `CONDUCTOR_SERVER_PORT_OVERRIDE` | Host port for API | `8080` |
|
||||
| `CONDUCTOR_UI_PORT_OVERRIDE` | Host port for UI | `5000` |
|
||||
| `POSTGRES_DB` | Database name | `conductor` |
|
||||
| `POSTGRES_USER` | Database user | `conductor` |
|
||||
| `POSTGRES_PASSWORD` | Database password | `conductor` |
|
||||
| `ELASTICSEARCH_VERSION` | Elasticsearch version | `8.11.0` |
|
||||
| `CONDUCTOR_LOG_LEVEL` | Log level | `INFO` |
|
||||
| `TZ` | Timezone | `UTC` |
|
||||
|
||||
## Resource Requirements
|
||||
|
||||
**Minimum**:
|
||||
|
||||
- CPU: 1 core
|
||||
- RAM: 1.5GB
|
||||
- Disk: 5GB
|
||||
|
||||
**Recommended**:
|
||||
|
||||
- CPU: 4+ cores
|
||||
- RAM: 4GB+
|
||||
- Disk: 20GB+
|
||||
|
||||
## Volumes
|
||||
|
||||
- `postgres_data`: PostgreSQL database data
|
||||
- `elasticsearch_data`: Elasticsearch indices
|
||||
- `conductor_logs`: Conductor server logs
|
||||
|
||||
## Using Conductor
|
||||
|
||||
### Creating a Workflow
|
||||
|
||||
1. Access the UI at `http://localhost:5000`
|
||||
2. Go to "Definitions" > "Workflow Defs"
|
||||
3. Click "Define Workflow" and use the visual editor
|
||||
4. Define tasks and their execution logic
|
||||
5. Save and execute your workflow
|
||||
|
||||
### Using the API
|
||||
|
||||
Example: Get server information
|
||||
|
||||
```bash
|
||||
curl http://localhost:8080/api/
|
||||
```
|
||||
|
||||
Example: List workflows
|
||||
|
||||
```bash
|
||||
curl http://localhost:8080/api/metadata/workflow
|
||||
```
|
||||
|
||||
### SDKs
|
||||
|
||||
Conductor provides official SDKs:
|
||||
|
||||
- Java: <https://github.com/conductor-oss/conductor/tree/main/java-sdk>
|
||||
- Python: <https://github.com/conductor-oss/conductor/tree/main/python-sdk>
|
||||
- Go: <https://github.com/conductor-oss/conductor/tree/main/go-sdk>
|
||||
- C#: <https://github.com/conductor-oss/conductor/tree/main/csharp-sdk>
|
||||
|
||||
## Security Considerations
|
||||
|
||||
1. **Authentication**: Configure authentication for production use
|
||||
2. **Database Passwords**: Use strong passwords for PostgreSQL
|
||||
3. **Network Security**: Use firewall rules to restrict access
|
||||
4. **SSL/TLS**: Enable HTTPS with a reverse proxy
|
||||
5. **Elasticsearch**: Consider enabling X-Pack security for production
|
||||
|
||||
## Upgrading
|
||||
|
||||
To upgrade Conductor:
|
||||
|
||||
1. Update version in `.env` file (if using versioned tags)
|
||||
2. Pull latest image and restart:
|
||||
|
||||
```bash
|
||||
docker compose pull
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
3. Check logs for any migration messages:
|
||||
|
||||
```bash
|
||||
docker compose logs -f conductor-server
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**Service won't start:**
|
||||
|
||||
- Check logs: `docker compose logs conductor-server`
|
||||
- Ensure database is healthy: `docker compose ps postgres`
|
||||
- Verify Elasticsearch: `docker compose ps elasticsearch`
|
||||
|
||||
**UI not accessible:**
|
||||
|
||||
- Check if port 5000 is available: `netstat -an | findstr 5000`
|
||||
- Verify service is running: `docker compose ps conductor-server`
|
||||
|
||||
**Performance issues:**
|
||||
|
||||
- Increase resource limits in `.env`
|
||||
- Monitor Elasticsearch heap size
|
||||
- Check database connection pool settings
|
||||
|
||||
## References
|
||||
|
||||
- Official Website: <https://conductor-oss.org>
|
||||
- Documentation: <https://docs.conductor-oss.org>
|
||||
- GitHub: <https://github.com/conductor-oss/conductor>
|
||||
- Community: <https://github.com/conductor-oss/conductor/discussions>
|
||||
|
||||
## License
|
||||
|
||||
Conductor is licensed under Apache-2.0. See [LICENSE](https://github.com/conductor-oss/conductor/blob/main/LICENSE) for more information.
|
||||
169
src/conductor/README.zh.md
Normal file
169
src/conductor/README.zh.md
Normal file
@@ -0,0 +1,169 @@
|
||||
# Conductor
|
||||
|
||||
Netflix Conductor 是一个在云端运行的工作流编排引擎,允许您通过可视化工作流设计器来编排微服务和工作流。
|
||||
|
||||
## 功能特点
|
||||
|
||||
- **可视化工作流设计器**:通过拖放界面构建复杂工作流
|
||||
- **微服务编排**:使用决策逻辑协调多个服务
|
||||
- **任务管理**:内置重试机制和错误处理
|
||||
- **可扩展架构**:为高吞吐量场景而设计
|
||||
- **REST API**:完整的 REST API,提供 Java、Python、Go、C# SDK
|
||||
- **监控**:通过 Prometheus 进行实时监控和指标收集
|
||||
|
||||
## 快速开始
|
||||
|
||||
1. 复制 `.env.example` 到 `.env`:
|
||||
|
||||
```bash
|
||||
copy .env.example .env
|
||||
```
|
||||
|
||||
2. (可选)编辑 `.env` 自定义数据库密码和其他设置
|
||||
|
||||
3. 启动 Conductor(注意:首次运行将构建镜像,可能需要几分钟):
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
4. 等待服务健康检查通过(使用 `docker compose ps` 检查)
|
||||
|
||||
5. 访问 Conductor UI:`http://localhost:5000`
|
||||
|
||||
6. API 地址:`http://localhost:8080`
|
||||
|
||||
## 默认配置
|
||||
|
||||
| 服务 | 端口 | 说明 |
|
||||
| ---------------- | ---- | ------------------ |
|
||||
| Conductor Server | 8080 | REST API |
|
||||
| Conductor UI | 5000 | Web UI |
|
||||
| PostgreSQL | 5432 | 数据库(内部) |
|
||||
| Elasticsearch | 9200 | 搜索与索引(内部) |
|
||||
|
||||
**身份验证**:默认未配置身份验证。在生产环境中应添加身份验证层(使用 OAuth2、LDAP 等的反向代理)。
|
||||
|
||||
## 环境变量
|
||||
|
||||
主要环境变量(完整列表请参阅 `.env.example`):
|
||||
|
||||
| 变量 | 说明 | 默认值 |
|
||||
| -------------------------------- | ------------------ | ----------- |
|
||||
| `CONDUCTOR_SERVER_PORT_OVERRIDE` | API 的主机端口 | `8080` |
|
||||
| `CONDUCTOR_UI_PORT_OVERRIDE` | UI 的主机端口 | `5000` |
|
||||
| `POSTGRES_DB` | 数据库名称 | `conductor` |
|
||||
| `POSTGRES_USER` | 数据库用户 | `conductor` |
|
||||
| `POSTGRES_PASSWORD` | 数据库密码 | `conductor` |
|
||||
| `ELASTICSEARCH_VERSION` | Elasticsearch 版本 | `8.11.0` |
|
||||
| `CONDUCTOR_LOG_LEVEL` | 日志级别 | `INFO` |
|
||||
| `TZ` | 时区 | `UTC` |
|
||||
|
||||
## 资源需求
|
||||
|
||||
**最低要求**:
|
||||
|
||||
- CPU:1 核心
|
||||
- 内存:1.5GB
|
||||
- 磁盘:5GB
|
||||
|
||||
**推荐配置**:
|
||||
|
||||
- CPU:4+ 核心
|
||||
- 内存:4GB+
|
||||
- 磁盘:20GB+
|
||||
|
||||
## 数据卷
|
||||
|
||||
- `postgres_data`:PostgreSQL 数据库数据
|
||||
- `elasticsearch_data`:Elasticsearch 索引
|
||||
- `conductor_logs`:Conductor 服务器日志
|
||||
|
||||
## 使用 Conductor
|
||||
|
||||
### 创建工作流
|
||||
|
||||
1. 访问 UI:`http://localhost:5000`
|
||||
2. 进入 "Definitions" > "Workflow Defs"
|
||||
3. 点击 "Define Workflow" 并使用可视化编辑器
|
||||
4. 定义任务及其执行逻辑
|
||||
5. 保存并执行您的工作流
|
||||
|
||||
### 使用 API
|
||||
|
||||
示例:获取服务器信息
|
||||
|
||||
```bash
|
||||
curl http://localhost:8080/api/
|
||||
```
|
||||
|
||||
示例:列出工作流
|
||||
|
||||
```bash
|
||||
curl http://localhost:8080/api/metadata/workflow
|
||||
```
|
||||
|
||||
### SDK
|
||||
|
||||
Conductor 提供官方 SDK:
|
||||
|
||||
- Java:<https://github.com/conductor-oss/conductor/tree/main/java-sdk>
|
||||
- Python:<https://github.com/conductor-oss/conductor/tree/main/python-sdk>
|
||||
- Go:<https://github.com/conductor-oss/conductor/tree/main/go-sdk>
|
||||
- C#:<https://github.com/conductor-oss/conductor/tree/main/csharp-sdk>
|
||||
|
||||
## 安全注意事项
|
||||
|
||||
1. **身份验证**:生产环境中配置身份验证
|
||||
2. **数据库密码**:为 PostgreSQL 使用强密码
|
||||
3. **网络安全**:使用防火墙规则限制访问
|
||||
4. **SSL/TLS**:通过反向代理启用 HTTPS
|
||||
5. **Elasticsearch**:生产环境中考虑启用 X-Pack 安全功能
|
||||
|
||||
## 升级
|
||||
|
||||
升级 Conductor:
|
||||
|
||||
1. 在 `.env` 文件中更新版本(如果使用版本标签)
|
||||
2. 拉取最新镜像并重启:
|
||||
|
||||
```bash
|
||||
docker compose pull
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
3. 检查日志查看迁移消息:
|
||||
|
||||
```bash
|
||||
docker compose logs -f conductor-server
|
||||
```
|
||||
|
||||
## 故障排除
|
||||
|
||||
**服务无法启动:**
|
||||
|
||||
- 检查日志:`docker compose logs conductor-server`
|
||||
- 确保数据库健康:`docker compose ps postgres`
|
||||
- 验证 Elasticsearch:`docker compose ps elasticsearch`
|
||||
|
||||
**UI 无法访问:**
|
||||
|
||||
- 检查端口 5000 是否可用:`netstat -an | findstr 5000`
|
||||
- 验证服务运行状态:`docker compose ps conductor-server`
|
||||
|
||||
**性能问题:**
|
||||
|
||||
- 在 `.env` 中增加资源限制
|
||||
- 监控 Elasticsearch 堆大小
|
||||
- 检查数据库连接池设置
|
||||
|
||||
## 参考资料
|
||||
|
||||
- 官方网站:<https://conductor-oss.org>
|
||||
- 文档:<https://docs.conductor-oss.org>
|
||||
- GitHub:<https://github.com/conductor-oss/conductor>
|
||||
- 社区:<https://github.com/conductor-oss/conductor/discussions>
|
||||
|
||||
## 许可证
|
||||
|
||||
Conductor 使用 Apache-2.0 许可证。详情请参阅 [LICENSE](https://github.com/conductor-oss/conductor/blob/main/LICENSE)。
|
||||
141
src/conductor/docker-compose.yaml
Normal file
141
src/conductor/docker-compose.yaml
Normal file
@@ -0,0 +1,141 @@
|
||||
# Conductor - Netflix Workflow Orchestration Engine
|
||||
# https://github.com/conductor-oss/conductor
|
||||
#
|
||||
# Conductor is a platform for orchestrating microservices and workflows. It was
|
||||
# originally developed by Netflix to manage their microservices architecture.
|
||||
#
|
||||
# Key Features:
|
||||
# - Visual workflow designer with drag-and-drop interface
|
||||
# - Support for complex workflows with decision logic
|
||||
# - Task retry and error handling mechanisms
|
||||
# - Scalable architecture for high-throughput scenarios
|
||||
# - REST API and multiple language SDKs
|
||||
#
|
||||
# Default Credentials:
|
||||
# - Access UI at http://localhost:5000
|
||||
# - No authentication by default (add reverse proxy with auth in production)
|
||||
#
|
||||
# Security Notes:
|
||||
# - Add authentication layer in production (OAuth2, LDAP, etc.)
|
||||
# - Use strong database passwords
|
||||
# - Enable SSL/TLS in production
|
||||
# - Restrict network access to Conductor services
|
||||
#
|
||||
# License: Apache-2.0 (https://github.com/conductor-oss/conductor/blob/main/LICENSE)
|
||||
|
||||
x-default: &default
|
||||
restart: unless-stopped
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: 100m
|
||||
max-file: "3"
|
||||
|
||||
services:
|
||||
conductor-server:
|
||||
<<: *default
|
||||
image: conductor:server
|
||||
build:
|
||||
context: https://github.com/conductor-oss/conductor.git#main:docker/server
|
||||
dockerfile: Dockerfile
|
||||
container_name: conductor-server
|
||||
ports:
|
||||
- "${CONDUCTOR_SERVER_PORT_OVERRIDE:-8080}:8080"
|
||||
- "${CONDUCTOR_UI_PORT_OVERRIDE:-5000}:5000"
|
||||
environment:
|
||||
# Database configuration
|
||||
- spring.datasource.url=jdbc:postgresql://postgres:5432/${POSTGRES_DB}
|
||||
- spring.datasource.username=${POSTGRES_USER}
|
||||
- spring.datasource.password=${POSTGRES_PASSWORD}
|
||||
|
||||
# Elasticsearch configuration
|
||||
- conductor.elasticsearch.url=http://elasticsearch:9200
|
||||
- conductor.indexing.enabled=true
|
||||
|
||||
# Server configuration
|
||||
- conductor.grpc-server.port=${CONDUCTOR_GRPC_PORT:-8090}
|
||||
- conductor.metrics-prometheus.enabled=true
|
||||
- LOG_LEVEL=${CONDUCTOR_LOG_LEVEL:-INFO}
|
||||
- TZ=${TZ:-UTC}
|
||||
|
||||
volumes:
|
||||
- conductor_logs:/app/logs
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
elasticsearch:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 60s
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: "${CONDUCTOR_CPU_LIMIT:-2.0}"
|
||||
memory: "${CONDUCTOR_MEMORY_LIMIT:-2G}"
|
||||
reservations:
|
||||
cpus: "${CONDUCTOR_CPU_RESERVATION:-0.5}"
|
||||
memory: "${CONDUCTOR_MEMORY_RESERVATION:-512M}"
|
||||
|
||||
postgres:
|
||||
<<: *default
|
||||
image: postgres:${POSTGRES_VERSION:-16-alpine}
|
||||
container_name: conductor-postgres
|
||||
environment:
|
||||
- POSTGRES_DB=${POSTGRES_DB:-conductor}
|
||||
- POSTGRES_USER=${POSTGRES_USER:-conductor}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-conductor}
|
||||
- POSTGRES_INITDB_ARGS=--encoding=UTF8
|
||||
- TZ=${TZ:-UTC}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-conductor} -d ${POSTGRES_DB:-conductor}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: "${POSTGRES_CPU_LIMIT:-1.0}"
|
||||
memory: "${POSTGRES_MEMORY_LIMIT:-1G}"
|
||||
reservations:
|
||||
cpus: "${POSTGRES_CPU_RESERVATION:-0.25}"
|
||||
memory: "${POSTGRES_MEMORY_RESERVATION:-256M}"
|
||||
|
||||
elasticsearch:
|
||||
<<: *default
|
||||
image: elasticsearch:${ELASTICSEARCH_VERSION:-8.11.0}
|
||||
container_name: conductor-elasticsearch
|
||||
environment:
|
||||
- discovery.type=single-node
|
||||
- xpack.security.enabled=false
|
||||
- ES_JAVA_OPTS=-Xms${ELASTICSEARCH_HEAP_SIZE:-512m} -Xmx${ELASTICSEARCH_HEAP_SIZE:-512m}
|
||||
- TZ=${TZ:-UTC}
|
||||
volumes:
|
||||
- elasticsearch_data:/usr/share/elasticsearch/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -f http://localhost:9200/_cluster/health || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 60s
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: "${ELASTICSEARCH_CPU_LIMIT:-2.0}"
|
||||
memory: "${ELASTICSEARCH_MEMORY_LIMIT:-2G}"
|
||||
reservations:
|
||||
cpus: "${ELASTICSEARCH_CPU_RESERVATION:-0.5}"
|
||||
memory: "${ELASTICSEARCH_MEMORY_RESERVATION:-1G}"
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
driver: local
|
||||
elasticsearch_data:
|
||||
driver: local
|
||||
conductor_logs:
|
||||
driver: local
|
||||
Reference in New Issue
Block a user