AgentSkillsCN

deploy-devlake

将 Apache DevLake 部署至 Azure,或通过 Docker 在本地运行。支持官方发布镜像,也支持从源码构建的自定义版本。当您需要部署 DevLake、为 DevLake 创建 Azure 资源、搭建本地 DevLake,或对 DevLake 部署进行故障排查时,可使用此技能。触发短语包括:“部署 DevLake”、“搭建 DevLake”、“DevLake Azure”、“DevLake 本地”、“安装 DevLake”。

SKILL.md
--- frontmatter
name: deploy-devlake
description: Deploy Apache DevLake to Azure or run locally with Docker. Supports Official release images or Custom builds from source. Use when deploying DevLake, creating Azure resources for DevLake, setting up local DevLake, or troubleshooting DevLake deployments. Trigger phrases include "deploy devlake", "set up devlake", "devlake azure", "devlake local", "install devlake".

Deploy DevLake

Deploy Apache DevLake with two paths: Official (local or Azure) or Custom (build from source → local or Azure).

Deployment Paths

code
═══════════════════════════════════════════════════════════════
              DEVLAKE DEPLOYMENT - SELECT PATH
═══════════════════════════════════════════════════════════════
1️⃣  Official Apache DevLake (latest release, official images)
    a) Local Docker - quick setup on your machine
    b) Deploy to Azure - ACI containers with managed MySQL

2️⃣  Custom DevLake (build from source)
    Step 1: Choose source
      a) Clone a remote fork (e.g., ewega/incubator-devlake)
      b) Use a local repository path
    Step 2: Choose target
      1) Local Docker - build & run locally
      2) Deploy to Azure - push to ACR, deploy to ACI

☁️  Cloud support: Azure only (AWS/GCP coming soon)
═══════════════════════════════════════════════════════════════

Prerequisites

DeploymentRequirements
Local DockerDocker installed and running
AzureAzure CLI logged in (az account show), Docker, Active subscription

Path 1a: Official DevLake → Local Docker

Quick local setup using official release images.

powershell
# Download and set up official DevLake
.\local\deploy-local.ps1

# Or specify a target directory and version
.\local\deploy-local.ps1 -TargetDirectory "C:\devlake" -Version "v1.0.2"

# Then start DevLake
cd C:\devlake
docker compose up -d

Endpoints:


Path 1b: Official DevLake → Azure

Deploy official release images to Azure. No build required, no ACR needed.

powershell
.\azure\deploy.ps1 -ResourceGroupName "devlake-rg" -Location "eastus" -UseOfficialImages

Cost: ~$30-50/month (no ACR)


Path 2-Local: Custom Build → Local Docker

Build from source and run locally.

Clone (if using remote fork)

powershell
git clone https://github.com/<owner>/<repo>.git
cd <repo>

Build Images

powershell
cd backend; docker build -t devlake-backend:local .
cd ../config-ui; docker build -t devlake-config-ui:local .
cd ../grafana; docker build -t devlake-dashboard:local .

Run

powershell
docker compose -f docker-compose-dev.yml up -d

Endpoints: Same as Path 1a.


Path 2-Azure: Custom Build → Azure

Build from source and deploy to Azure with ACR.

From Local Repository

powershell
.\azure\deploy.ps1 -ResourceGroupName "devlake-rg" -Location "eastus"

From Remote Fork

powershell
.\azure\deploy.ps1 -ResourceGroupName "devlake-rg" -Location "eastus" -RepoUrl "https://github.com/ewega/incubator-devlake"

Cost: ~$50-75/month (includes ACR)


Script Reference

ScriptPurpose
local/deploy-local.ps1Download official docker-compose and set up locally
azure/deploy.ps1Deploy to Azure (official or custom images)
azure/cleanup.ps1Delete Azure resources using state file
azure/main.bicepBicep template for custom builds (with ACR)
azure/main-official.bicepBicep template for official images (no ACR)

Reference Documentation

FileContent
environment-variables.mdRequired env vars & DB_URL format
troubleshooting.mdCommon issues & fixes
cleanup.mdTeardown and resource deletion

Critical Requirements (Azure)

RequirementWhy
parseTime=True&loc=UTC&tls=true in DB_URLDatetime fields fail without it
ENCRYPTION_SECRET (32 chars)Backend panics without it
Key Vault RBAC role"Forbidden" when storing secrets
Start MySQL after creationAzure auto-stops Burstable tier

See references/environment-variables.md for details.


State File (Azure)

Azure deployments create .devlake-azure.json in the current directory containing:

  • Resource names and IDs
  • Endpoints
  • Secrets (for reference)

Use for tracking deployments and cleanup. Add to .gitignore.


Cleanup

Azure (using script)

powershell
.\azure\cleanup.ps1

Azure (manual)

bash
az group delete --name <resource-group> --yes --no-wait

Local Docker

powershell
cd <devlake-directory>
docker compose down

Cost Estimate

PathMonthly CostIncludes
Local DockerFreeLocal resources only
Official (Azure)~$30-50MySQL B1ms + 3 containers + Key Vault
Custom (Azure)~$50-75MySQL B1ms + 3 containers + ACR Basic + Key Vault