当前位置:网站首页>Apache Devlake 代码库导览
Apache Devlake 代码库导览
2022-06-09 05:11:00 【DevLake技术组】
本文作者:abeizn
GitHub 地址:https://github.com/abeizn
Apache DevLake 是什么?
研发数据散落在软件研发生命周期的不同阶段、不同工作流、不同 DevOps 工具中,且标准化程度低,导致效能数据难以留存、汇集并转化为有效洞见。为了解决这一痛点,Apache DevLake 应运而生。Apache DevLake 是一款开源的研发数据平台,它通过提供自动化、一站式的数据收集、分析以及可视化能力,帮助研发团队更好地理解开发过程,挖掘关键瓶颈与提效机会。
Apache DevLake架构概述

<center>Apache DevLake 架构图</center> <br/>
- Config UI: 人如其名,配置的可视化,其主要承载 Apache DevLake 的配置工作。通过 Config UI,用户可以建立数据源连接,并实现数据的收集范围,部分数据的转换规则,以及收集频率等任务。
- Api Sever:Apache DevLake 的 Api 接口,是前端调用后端数据的通道。
- Runner:Apache DevLake 运行的底层支撑机制。
- Plugins:具体执行的插件业务,主要承载 Apache DevLake 的后端数据收集、扩展和转换的工作。除dbt插件外的插件产出 Apache DevLake 的预置数据,预置数据主要包括三层;
- raw layer:负责储存最原始的 api response json。
- tool layer:根据 raw layer 提取出此插件所需的数据。
- domain layer:根据 tool layer 层抽象出共性的数据,这些数据会被使用在 Grafana 图表中,用于多种研发指标的展示。
- RDBS: 关系型数据库。目前 Apache DavLake 支持 MySQL 和 PostgreSQL,后期还会继续支持更多的数据库。
- Grafana Dashboards: 其主要承载 Apache DevLake 的前端展示工作。根据 Apache DevLake 收集的数据,通过 sql语句来生成团队需要的交付效率、质量、成本、能力等各种研发效能指标。
目录结构Tree
├── api│ ├── blueprints│ ├── docs│ ├── domainlayer│ ├── ping│ ├── pipelines│ ├── push│ ├── shared│ ├── task│ └── version├── config├── config-ui├── devops│ └── lake-builder├── e2e├── errors├── grafana│ ├── _archive│ ├── dashboards│ ├── img│ └── provisioning│ ├── dashboards│ └── datasources├── img├── logger├── logs├── migration├── models│ ├── common│ ├── domainlayer│ │ ├── code│ │ ├── crossdomain│ │ ├── devops│ │ ├── didgen│ │ ├── ticket│ │ └── user│ └── migrationscripts│ └── archived├── plugins│ ├── ae│ │ ├── api│ │ ├── models│ │ │ └── migrationscripts│ │ │ └── archived│ │ └── tasks│ ├── core│ ├── dbt│ │ └── tasks│ ├── feishu│ │ ├── apimodels│ │ ├── models│ │ │ └── migrationscripts│ │ │ └── archived│ │ └── tasks│ ├── gitextractor│ │ ├── models│ │ ├── parser│ │ ├── store│ │ └── tasks│ ├── github│ │ ├── api│ │ ├── models│ │ │ └── migrationscripts│ │ │ └── archived│ │ ├── tasks│ │ └── utils│ ├── gitlab│ │ ├── api│ │ ├── e2e│ │ │ └── tables│ │ ├── impl│ │ ├── models│ │ │ └── migrationscripts│ │ │ └── archived│ │ └── tasks│ ├── helper│ ├── jenkins│ │ ├── api│ │ ├── models│ │ │ └── migrationscripts│ │ │ └── archived│ │ └── tasks│ ├── jira│ │ ├── api│ │ ├── models│ │ │ └── migrationscripts│ │ │ └── archived│ │ └── tasks│ │ └── apiv2models│ ├── refdiff│ │ ├── tasks│ │ └── utils│ └── tapd│ ├── api│ ├── models│ │ └── migrationscripts│ │ └── archived│ └── tasks├── releases│ ├── lake-v0.10.0│ ├── lake-v0.10.0-beta1│ ├── lake-v0.10.1│ ├── lake-v0.7.0│ ├── lake-v0.8.0│ └── lake-v0.9.0├── runner├── scripts├── services├── test│ ├── api│ │ └── task│ └── example├── testhelper├── utils├── version├── worker├── Dockerfile├── docker-compose.yml├── docker-compose-temporal.yml├── k8s-deploy.yaml├── Makefile└── .env.exemple 目录导览
- 后端部分:
- config:对.env 配置文件的读、写以及修改的操作。
- logger:log 日志的 level、format 等设置。
- errors:Error 的定义。
- utils:工具包,它包含一些基础通用的函数。
- runner:提供基础执行服务,包括数据库,cmd,pipelines,tasks以及加载编译后的插件等基础服务。
- models:定义框架级别的实体。
- common:基础 struct 定义。
- domainlayer:领域层是来自不同工具数据的通用抽象。
- ticket:Issue Tracking,即问题跟踪领域。
- code:包括 Source Code 源代码关联领域。以及 Code Review 代码审查领域。
- devops:CI/CD,即持续集成、持续交付和持续部署领域。
- crossdomain:跨域实体,这些实体用于关联不同领域之间的实体,这是建立全方面分析的基础。
- user:对用户的抽象领域,user 也属于 crossdomain 范畴。
- migrationscripts:初始化并更新数据库。
- plugins:
- core:插件通用接口的定义以及管理。
- helper:插件通用工具的集合,提供插件所需要的辅助类,如 api 收集,数据 ETL,时间处理等。
- 网络请求 Api Client 工具。
- 收集数据 Collector 辅助类,我们基于 api 相同的处理模式,统一了并发,限速以及重试等功能,最终实现了一套通用的框架,极大地减少了开发和维护成本。
- 提取数据 Extractor 辅助类,同时也内建了批量处理机制。
- 转换数据 Convertor 辅助类。
- 数据库处理工具。
- 时间处理工具。
- 函数工具。
- ae:分析引擎,用于导入 merico ae 分析引擎的数据。
- feishu:收集飞书数据,目前主要是获取一段时间内组织内会议使用的 top 用户列表的数据。
- github:收集 Github 数据并计算相关指标。(其他的大部分插件的目录结构和实现功能和 github 大同小异,这里以 github 为例来介绍)。
- github.go:github 启动入口。
- tasks:具体执行的4类任务。
- *_collector.go:收集数据到 raw layer 层。
- *_extractor.go:提取所需的数据到 tool layer 层。
- *_convertor.go:转换所需的数据到 domain layer 层。
- *_enricher.go:domain layer 层更进一步的数据计算转换。
- models:定义 github 对应实体 entity。
- api:api 接口。
- utils:github 提取的一些基本通用函数。
- gitextractor:git 数据提取工具,该插件可以从远端或本地 git 仓库提取 commit 和 reference 信息,并保存到数据库或 csv 文件。用来代替 github 插件收集commit 信息以减少 api 请求的数量,提高收集速度。
- refdiff:在分析开发工作产生代码量时,经常需要知道两个版本之间的 diff。本插件基于数据库中存储的 commits 父子关系信息,提供了计算ref(branch/tag)之间相差 commits 列表的能力。
- gitlab:收集 Gitlab 数据并计算相关指标。
- jenkins:收集 jenkins 的 build 和 job 相关指标。
- jira:收集 jira 数据并计算相关指标。
- tapd:收集 tapd 数据并计算相关指标。
- dbt:(data build tool)是一款流行的开源数据转换工具,能够通过SQL实现数据转化,将命令转化为表或者视图,提升数据分析师的工作效率。Apache DevLake 增加了 dbt 插件,用于数据定制的需要。
- services:创建、管理 Apache DevLake 各种服务,包含 notifications、blueprints、pipelines、tasks、plugins 等。
- api:使用 Gin 框架搭建的一个通用 Apache DevLake API 服务。
- 前端部分:
- congfig-ui:主要是 Apache DevLake 的插件配置信息的可视化。一些术语的解释
- 常规模式
- blueprints 的配置。
- data connections 的配置。
- transformation rules 的配置。
- 高级模式:主要是通过 json 的方式来请求 api,可选择对应的插件,对应的 subtasks,以及插件所需要的其他信息。
- 常规模式
- Grafana:其主要承载 Apache DevLake 的前端展示工作。根据收集的数据,通过 sql 语句来生成团队需要的各种数据。目前 sql 主要用 domain layer 层的表来实现通用数据展示需求。
- congfig-ui:主要是 Apache DevLake 的插件配置信息的可视化。一些术语的解释
- migration:数据库迁移工具。
- migration:数据库迁移工具 migration 的具体实现。
- models/migrationscripts:domian layer 层的数据库迁移脚本。
- plugins/xxx/models/migrationscripts:插件的数据库迁移脚本。主要是_raw_和_tool_开头的数据库的迁移。
- 测试部分:
- testhelper 和 plugins 下的*_test.go 文件:即单元测试,属于白盒测试范畴。针对目标对象自身的逻辑,执行路径的正确性进行测试,如果目标对象有依赖其它资源或对够用,采用注入或者 mock 等方式进行模拟,可以比较方便地制造一些难以复现的极端情况。
- test:集成测试,灰盒测试范畴。在单元测试的基础上,将所有模块按照设计要求(如根据结构图)组装成为子系统或系统,进行集成测试。
- e2e: 端到端测试,属于黑盒测试范畴。相对于单元测试更注重于目标自身,e2e 更重视目标与系统其它部分互动的整体正确性,相对于单元测试着重逻辑测试,e2e 侧重于输出结果的正确性。
- 编译,发布部分:
- devops/lake-builder: mericodev/lake-builder 的 docker 构建。
- Dockerfile:主要用于构建 devlake 镜像。
- docker-compose.yml:是用于定义和运行多容器 Docker 应用程序的工具,用户可以使用YML文件来配置 Apache DevLake 所需要的服务组件。
- docker-compose-temporal.yml:Temporal 是一个微服务编排平台,以分布式的模式来部署 Apache DevLake,目前处于试验阶段,仅供参考。
- worker:Temporal 分布式部署形式中的 worker 实现,目前处于试验阶段,仅供参考。
- k8s-deploy.yaml:Kubernetes 是一个可移植、可扩展的开源平台,用于管理容器化的工作负载和服务,可促进声明式配置和自动化。目前 Apache DevLake已支持在 k8s 集群上部署。
- Makefile:是一个工程文件的编译规则,描述了整个工程的编译和链接等规则。
- releases:Apache DevLake 历史 release 版本的配置文件,包括 docker-compose.yml 和 env.example。
- scripts:shell 脚本,包括编译 plugins 脚本。
- 其他:
- img:logo、社区微信二维码等图像信息。
- version:实现版本显示的支持,在正式的镜像中会显示对应 release 的版本。
- .env.exemple:配置文件实例,包括 DB URL, LOG 以及各插件的配置示例信息。
如何联系我们
- Github地址:https://github.com/apache/incubator-devlake
- 官网地址:https://devlake.apache.org/
- Slack: 通过Slack联系https://devlake-io.slack.com/join/shared_invite/zt-18uayb6ut-cHOjiYcBwERQ8VVPZ9cQQw#/shared-invite/email
- 加入社群:点击加入 Slack 或点击下方代码仓库地址 > Readme > 扫描微信群二维码
- DevLake Podling Website:https://incubator.apache.org/projects/devlake.html
- 如何参与贡献:https://github.com/apache/incubator-devlake#how-to-contribute
- 订阅邮件列表了解动态:[email protected]
- 微信公众号正在建设中:欢迎关注 “DevLake 社区”
边栏推荐
- 2021 national vocational skills competition Liaoning "Cyberspace Security Competition" and its analysis (ultra detailed)
- Where will the money go in the SaaS industry in 2022?
- 2022 "Cyberspace Security" event module B of Jiangxi secondary vocational group - SQL injection test
- Program implementation of inserting, updating and deleting in Oracle Internet cafe design
- Differences between tinyint and int
- MQ message loss, message consistency, repeated consumption solution
- Typescript learning [8] enumeration type
- 2022 safety officer-b certificate work certificate title and online simulation examination
- P1779 小胡同学的跳板
- Latest list of 955 companies that do not work overtime (2022 Edition)
猜你喜欢
![[006] [ESP32開發筆記] 使用Flash下載工具燒錄固件步驟](/img/a0/5d5e6c076d267c0ffe4c1e8f10e408.png)
[006] [ESP32開發筆記] 使用Flash下載工具燒錄固件步驟

2022 welder (elementary) special operation certificate examination question bank and simulation examination

SQL summary statistics: use cube and rollup in SQL to realize multidimensional data summary

1030. 距离顺序排列矩阵单元格●
![[004] [ESP32开发笔记] 音频开发框架ADF环境搭建——基于ESP-IDF](/img/55/9eb286bc56ec991837fc014b42fc20.png)
[004] [ESP32开发笔记] 音频开发框架ADF环境搭建——基于ESP-IDF

Hengyuan cloud (gpushare)_ Beyond the model of pre training NLP

The latest JMeter pressure test in the whole network is not much to say. I just want to teach you to use JMeter to write script pressure test as soon as possible

Practice and some ideas on the transformation of sonarlint code specification

. Net core 3.0 grpc custom service

2022 tea artist (intermediate) examination question simulation examination question bank and simulation examination
随机推荐
Brain: an interpretable deep learning framework for Alzheimer's disease (AD) classification
Make in-depth research and summary, go to a higher level, and make new year's resolutions
Product weekly report issue 28 | CSDN editor upgrade, adding the function of inserting existing videos
2022 R2 mobile pressure vessel filling test simulation 100 questions and simulation test
宇邦新材深交所上市:市值47亿 第一季扣非净利降18%
Sword finger: duplicate number in array (JS)
[006] [ESP32開發筆記] 使用Flash下載工具燒錄固件步驟
Marathon环境下fastdfs和vsftpd和miniIo文件服务器搭建的方式
readme. md
Troubleshooting: MySQL containers in alicloud lightweight application servers stop automatically
聊聊保证线程安全的10个小技巧
ASP. Net core build scheduling service - use generic host with quartz Net
Smart curly bracket escape
2022焊工(初级)特种作业证考试题库及模拟考试
Cloud computing technology
pytest_ Introduction to allure priority and fixture scope parameters
Caching mechanism in transformer
Cuijian hasn't changed. BAIC Jihu should make a change
Debugging -- debugging objects and events
Basic cluster deployment - kubernetes simple