- Notifications
You must be signed in to change notification settings - Fork77
DevOps Service is the core service of Choerodon. It integrated several open source tools to automate the DevOps process of planning, coding, building, testing, and deployment, operation, monitoring.
open-hand/devops-service
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
DevOps Service
DevOps Service是Choerodon平台实现持续交付的基础. 当前版本为:1.1.0
DevOps Service通过自主整合的DevOps工具链,集成相关的开源工具,以此形成了计划、编码、测试、部署、运维以及监控的DevOps闭环。并且只需通过简单的配置,您便能获得最佳的开发体验。
注意:原本的前端代码已经移动到这里
DevOps Service
含有以下功能:
应用服务管理
:对应用服务进行管理应用服务版本管理
:对持续集成
(Continuous Integration)过程中产生的可以直接在Kubernetes
集群中进行部署的服务版本进行管理代码管理及版本控制
:对服务的代码进行版本控制和管理分支管理
:能够对服务的Git
分支进行相应的操作代码质量监测
:在CI
过程中进行代码质量数据收集,集成sonarqube
对代码质量进行监测持续集成概览
:查看服务的持续集成过程部署管理
:对持续集成所产生的服务版本通过GitOps
进行部署持续部署流水线管理
:使用工作流实现持续部署资源管理
:对部署的资源(如:网络,域名,密文等)进行管理集群管理
:管理Kubernetes
集群
- JAVA:
DevOps Service
基于Java8进行开发 - GitLab:
DevOps Service
使用GitLab
进行代码的托管。同时,通过基于GitLab Runner
实现持续集成以完成代码编译,单元测试执行,代码质量分析,docker镜像生成,helm chart打包,服务版本发布等自动化过程 - Harbor:企业级Docker registry 服务,用于存放服务版本所对应的docker镜像
- Kubernetes:容器编排管理工具,用于部署服务版本所对应的helm chart包
- ChartMuseum:Helm Chart仓库,用于存放服务版本所对应的helm chart包
- Sonarqube:管理代码质量的开放平台,用于管理服务的代码质量
- MySQL:主流数据库之一,用于
DevOps Service
的数据持久化 - Redis:内存数据库,用于数据缓存和部分非持久化数据存储
choerodon-register
: 注册中心,在线上环境代替本地的eureka-server
choerodon-iam
:用户服务,与用户有关的操作依赖与此服务choerodon-gateway
: 网关服务choerodon-oauth
: 授权服务choerodon-asgard
: 事务一致性服务choerodon-message
: 通知服务gitlab-service
:gitlab服务workflow-service
:工作流服务agile-service
:敏捷服务,查询与分支有关的敏捷Issue需要依赖此服务
bootstrap.yml
:server:port:8060spring:application:name:devops-servicecloud:config:failFast:trueretry:maxAttempts:6multiplier:1.5maxInterval:2000uri:localhost:8010enabled:falsemvc:static-path-pattern:/**resources:static-locations:classpath:/static,classpath:/public,classpath:/resources,classpath:/META-INF/resources,file:/distmanagement:server:port:8061endpoints:web:exposure:include:'*'
application.yml
:spring:datasource:url:jdbc:mysql://localhost/devops_service?useUnicode=true&characterEncoding=utf-8&useSSL=falseusername:choerodonpassword:choerodonhikari:maximum-pool-size:15# 数据库连接池连接数redis:host:localhostdatabase:${SPRING_REDIS_DATABASE:1}http:encoding:charset:UTF-8force:trueenabled:trueservices:harbor:baseUrl:"harbor.example.com"# harbor地址username:"123456"# harbor用户名password:"123456"# 对应harbor用户名的密码insecureSkipTlsVerify:falsegitlab:url:"gitlab.example.com"# gitlab地址sshUrl:"gitlab.example.com"# 用于ssh操作的gitlab地址projectLimit:100# gitlab用户可以创建的项目的数量限制helm:url:"helm.example.com"# 存放helm chart包的仓库地址gateway:url:"http://api.example.com"# 网关地址hzero:service:platform:name:choerodon-platformoauth:name:choerodon-oauthiam:name:choerodon-iamfile:name:choerodon-filemessage:name:choerodon-messageadmin:name:choerodon-adminswagger:name:choerodon-swaggergateway:name:choerodon-gatewaymonitor:name:choerodon-monitorwebsocket:# 用于连接websocket的路径websocket:/websocket# 与当前服务的redis数据库一致redisDb:${SPRING_REDIS_DATABASE:1}# 后端长连通信密钥secretKey:devops_wschoerodon:saga:consumer:core-thread-num:20max-thread-num:20# 消费线程数poll-interval:3# 拉取消息的间隔(秒),默认1秒enabled:true# 是否启用消费端schedule:consumer:enabled:true# 启用任务调度消费端thread-num:1# 任务调度消费线程数poll-interval-ms:1000# 拉取间隔,默认1000毫秒resource:jwt:ignore:/workflow/**, /sonar/**, /ci, /sonar/info, /v2/api-docs, /agent/**, /ws/**, /gitlab/email, /webhook/**, /v2/choerodon/**, /choerodon/**, /actuator/**, /prometheus, /devops/**, /pre_stop, /websocketagent:version:"0.5.0"# devops-service此版本所预期的 choerodon-agent 的版本serviceUrl:"agent.example.com"# 用于 choerodon-agent 连接 devops-service 的地址certManagerUrl:"agent.example.com"# 存放CertManager的地址,用于安装repoUrl:"helm.example.com"# 存放agent的地址,用于安装mybatis:mapperLocations:classpath*:/mapper/*.xmlconfiguration:mapUnderscoreToCamelCase:truefeign:hystrix:shareSecurityContext:truecommand:default:execution:isolation:thread:timeoutInMilliseconds:30000ribbon:ConnectTimeout:50000ReadTimeout:50000asgard-servie:ribbon:ConnectTimeout:50000ReadTimeout:50000devops:ansible:image:registry.cn-shanghai.aliyuncs.com/c7n/kubeadm-ha:0.1.0# helm 下载地址helm:download-url:https://file.choerodon.com.cn/kubernetes-helm/v3.2.4/helm-v3.2.4-linux-amd64.tar.gz# 流水线生成Gitlab Ci文件中默认的runner 镜像地址ci:default:image:registry.cn-shanghai.aliyuncs.com/c7n/cibase:0.9.1pipeline:sync:executor:# 核心线程池大小corePoolSize:5# 最大线程池大小maxPoolSize:8unterminated:# ci流水线对未终结的流水线进行数据补偿的时间阈值, 单位: 毫秒 (默认600秒)thresholdMilliSeconds:600000pending:# ci流水线对pending的流水线进行数据补偿的时间阈值, 单位: 毫秒 (默认600秒)thresholdMilliSeconds:600000jobEmpty:# ci流水线对非跳过状态的且没有job信息流水线进行数据补偿的时间阈值, 单位: 毫秒 (默认600秒)thresholdMilliSeconds:600000refresh:# redisKey的过期时间, 用于控制同一条流水线的刷新间隔, 减少对gitlab的访问次数periodSeconds:60# 批量部署的请求条数限制batch:deployment:maxSize:20# websocket的最大缓冲区大小,单位字节bytewebsocket:buffer:maxTextMessageSize:4194304maxBinaryMessageSize:4194304
创建数据库
devops_service
,创建用户choerodon
,并为用户分配权限:CREATEUSER 'choerodon'@'%' IDENTIFIED BY"choerodon";CREATEDATABASEdevops_service DEFAULT CHARACTERSET utf8;GRANT ALL PRIVILEGESON devops_service.* TO choerodon@'%';FLUSH PRIVILEGES;
拉取
DevOps Service
代码到本地:git clone https://github.com/choerodon/devops-service.git
在项目根目录执行命令:
mvn clean package spring-boot:repackage -Dmaven.test.skip=true && bash init-database.sh
使用下列命令运行或直接在集成环境中运行
DevopsServiceApplication
mvn clean spring-boot:run
如果您发现任何缺陷或bug,请及时issue告知我们 。
欢迎参与我们的项目,了解更多有关如何参与贡献的信息。
About
DevOps Service is the core service of Choerodon. It integrated several open source tools to automate the DevOps process of planning, coding, building, testing, and deployment, operation, monitoring.