GitLab全方位

GitLab全方位

建模

愿景

愿景.png

业务建模

业务用例图

交付软件

业务用例图

业务序列图

业务序列图

需求建模

系统用例图

系统用例图

领域建模

系统用例 持续集成/CI

CI

Job

Script

Command

控制类:PipeLine

内容收集

历史

GitLab is a web-based Git-repository manager providing wiki, issue-tracking and CI/CD pipeline[6] features, using an open-source license, developed by GitLab Inc. The software was created by Dmitriy Zaporozhets and Valery Sizov,[7][not in citation given] and is used by several large tech companies including IBM, Sony, Jülich Research Center, NASA, Alibaba, Invincea, O’Reilly Media, Leibniz-Rechenzentrum (LRZ), CERN,[8][9][10] European XFEL, GNOME Foundation, Boeing, Autodata, and SpaceX.[11]

The code was originally written in Ruby, with some parts later rewritten in Go, initially as a source code management solution to collaborate with his team on software development. It later evolved to an integrated solution covering the software development life cycle, and then to the whole DevOps lifecycle. The current technology stack includes Ruby on Rails and Vue.js

It follows an open-core development model where the core functionality is released under an open source (MIT) license while the additional functionality is under a proprietary license.

收购

  • Gitorious: GitLab acquired open source hosting and on-premise enterprise Git management service provider Gitorious in March 2015.
  • Gitter: In March 2017, GitLab acquired Gitter, an instant messaging platform for developers and declared to open source Gitter codebase.
  • Gemnasium: In January 2018, GitLab acquired Gemnasium, a company providing software and services to mitigate security vulnerabilities.

Comparison of source code hosting facilities

愿景

“GitLab supports development teams with a well-documented installation and configuration processes, an easy-to-follow UI, and a flexible per-seat pricing model that supports self service. GitLab’s vision is to serve enterprise-scale, integrated software development teams that want to spend more time writing code and less time maintaining their tool chain.” - CI Wave Report, FORRESTER

GitLab is a "Strong Performer" in The Forrester New Wave: Value Stream Management Tools, Q3 2018. According to the report, “GitLab combines end-to-end capability with the power of open source. GitLab offers a DevOps tool for each step of the software development process. Top-level views sitting across these tools provide its VSM functionalities." - VSM Report, FORRESTER

2018年底,愿景

GitLab认为DevOps开发工具的范围应当在一个应用中包括开发者、运维人员和安全团队。这样能显著减少挫折感,增加合作,启动一个有竞争力的优势。带着上下文转换Doing Aways并且在一个地方就有必要的信息,能够闭环,并且使得团队之间相互更好的理解成为可能。

GitLab reimagines the scope of DevOps tooling to include developers, operations, and security teams in one single application. This dramatically reduces friction, increases collaboration, and drives a competitive advantage. Doing away with context switching and having all of the necessary information in one place closes the loop and enables a better understanding of each team's needs.

目标:200%更快的DevOps生命周期

从项目计划和源代码管理到CI/CD和监控,GitLab是整个DevOps生命周期的单一应用。只有GitLab允许并行的DevOpes,使得软件生命周期200%更快。

2018愿景
产品类别

用例

https://about.gitlab.com/direction/#vision

管理/Manage

计划/Plan

创建/Create

验证/Verify

打包/Package

发布/Release

配置/Configure

监控/Monitor

安全/Secure

特性

可视/Visible

看到任何重要的事情/See everything that matters

  • 保持在流程中/Stay in your flow
  • 不因同步而等待/Don’t wait on syncing
  • 管理项目,而不是工具/Manage projects, not tools
  • 改进周期时间?/Improve cycle time.

高效/Efficient

无需等待地合作/Collaborate without waiting

  • 立即开始/Start immediately
  • 并行工作/Work concurrently
  • 没有多余的传递/No more handoffs

治理/Governed

自信地开发和运维/Develop and operate with confidence

  • 内置的安全和合规/Security and compliance already built-in
  • 简化用户管理/Simplify user management
  • 顺畅的审计/Expedite auditing
  • 有把握地行动/Act with certaint

业务建模

业务用例:交付软件,运维系统

定义

Continuous integration (CI) systems provide automation of the software build and validation process driven in a continuous way by running a configured sequence of operations every time a software change is checked into the source code management repository. These are closely associated with agile development practices and closely related to the emerging DevOps toolsets.

来自 https://blogs.gartner.com/it-glossary/continuous-integration-ci/

DevOps

DevOps represents a change in IT culture, focusing on rapid IT service delivery through the adoption of agile, lean practices in the context of a system-oriented approach. DevOps emphasizes people (and culture), and seeks to improve collaboration between operations and development teams. DevOps implementations utilize technology — especially automation tools that can leverage an increasingly programmable and dynamic infrastructure from a life cycle perspective.

来自:https://blogs.gartner.com/it-glossary/?s=devops

业务序列图

软件生命周期的各个阶段:

软件生命周期

管理

Gain visibility and insight into how your business is performing.
GitLab helps teams manage and optimize their software delivery lifecycle with metrics and value stream insight in order to streamline and increase their delivery velocity. Learn more about how GitLab helps to manage your end to end value stream.

Reporting & Analytics

计划/Plan

The Plan stage is about capturing ideas, organizing issues and epics, scheduling work, and communicating plans.

GitLab enables portfolio planning and management through epics, groups (programs) and milestones to organize and track progress. Regardless of your methodology from Waterfall to DevOps, GitLab’s simple and flexible approach to planning meets the needs of small teams to large enterprises. GitLab helps teams organize, plan, align and track project work to ensure teams are working on the right things at the right time and maintain end to end visibility and traceability of issues throughout the delivery lifecycle from idea to production.

  • Chat integration
  • Project and portfolio management

创建/Create

GitLab is used to create, collaborate, review and manage content; often source code, by many businesses. We want to make it possible for everyone to be able to contribute content and feedback using GitLab.

  • Source code management
  • Merge requests
  • Web IDE
  • Geo

验证/Verify

The Verify stage is all about making sure that your code does what you expected it to do, meets quality standards, and is secure; all via automated testing. We bring best practices from top development teams, and make them the easy, default way to work. But of course you can build on those defaults and customize as needed for your company.

  • Continuous Integration (CI)

GitLab CI provides an explicit build stage and the concept of build artifacts, but we might need to separate out the build artifacts from test artifacts. For example, you might want your test runner to create a JUnit-style output file which is available for external consumption, but not included in the build image sent to production. Creation of an explicit build aligns well with Docker where the result of the build stage is a Docker image which is stored in a registry and later pulled for testing and deployment.

打包/Package

- Container Registry
- Binary repository for Maven MVC Premium

发布/Release

  • Continuous Delivery (CD) / Release Automation

A key part of CD is being able to deploy. We currently have the ability via scripts in the deploy stage in .gitlab-ci.yml. We will go further.

配置/Configure

  • Application Control Panel
  • Infrastructure Configuration
  • Operations
  • Feature Management

There's a big benefit to decoupling deployment of code from delivery of a feature, mostly using feature flags. Continuous integration helps improve the speed of development, but feature flags take it to another level, giving you the confidence to integrate code even more often while providing a gradual and granular method for delivery.

监控/Monitor

Performance is a critical aspect of the user experience, and ensuring your application is responsive and available is everyone's responsibility. We want to help address this need for development teams, by integrating key performance analytics and feedback into the tool developers already use every day.

  • Application Performance Monitoring (APM)
  • Infrastructure Monitoring
  • Production Monitoring
  • Error Tracking
  • Logging

安全/Secure

  • Security Testing
  • License Management

非生命周期

性能/Performance

分发/Distribution

GitLab is the engine that powers many companies' software businesses so it is important to ensure it is as easy as possible to deploy, maintain, and stay up to date.

  • Omnibus
  • Cloud Native Installation

CI

范例:How to deploy Maven projects to Artifactory with GitLab CI/CD

参考

CI: GitLab Runner

使用Docker镜像

什么是镜像?

镜像关键字是Docker执行器将要运行的Docker镜像名字,以执行CI任务。

The image keyword is the name of the Docker image the Docker executor will run to perform the CI tasks.

什么是服务?

服务关键字定义了另一个Docker镜像,它将在任务期间运行,并连接到image关键字所指定的Docker镜像。这样,你就可以在构建期访问服务镜像。

The services keyword defines just another Docker image that is run during your job and is linked to the Docker image that the image keyword defines. This allows you to access the service image during build time.

Runner是如何启动CI任务中所要使用的Docker镜像:

  1. Runner使用定义好的entrypoint启动一个Docker镜像。(默认来自于Dockerfile,可能会在.gitlab-ci.yml中被重写)
  2. Runner将自身附加到运行的容器;
  3. Runner准备好脚本(before_script, script, after_script的组合);
  4. Runner将脚本发送到容器shell的STDIN然后接受输出。

在构建期Docker所执行的步骤:

  1. 创建any服务容器:mysql, postgresql, monodb, redis;
  2. 创建缓存容器以存储所有在config.toml定义的卷,以及构建镜像的Dockerfile(上面的例子为ruby:2.1);
  3. 创建构建镜像,然后将any服务镜像连接到构建镜像;
  4. 启动构建镜像,并将任务脚本发送至该容器;
  5. 运行任务脚本;
  6. 迁出/builds/group-name/project-name/的代码;
  7. 执行.gitlab-ci.yml所定义的any每一步;
  8. 检查构建脚本的退出状态;
  9. 删除构建镜像和所有创建的服务镜像;

来源:https://git.iec.io/help/ci/docker/using_docker_images.md

参考:

定义来自私人仓库的镜像

image
image

自动化DevOps

与PaaS比较

Auto DevOps受到Heroku的创新工作的启发,并有所超越:

  1. Auto DevOps使用any Kubernetes集群;
  2. 没有额外的成本,你可以使用自己搭建的Kubernetes集群或者公有云上的Container as a Service;
  3. Auto DevOps还包括安全测试、性能测试和代码质量测试;
  4. 提供增量incremental graduation path。

特性

最佳实践,阶段

  1. Auto Build
  2. Auto Test
  3. Auto Code Quality [STARTER]
  4. Auto SAST (Static Application Security Testing) [ULTIMATE]
  5. Auto Dependency Scanning [ULTIMATE]
  6. Auto License Management [ULTIMATE]
  7. Auto Container Scanning
  8. Auto Review Apps
  9. Auto DAST (Dynamic Application Security Testing) [ULTIMATE]
  10. Auto Deploy
  11. Auto Browser Performance Testing [PREMIUM]
  12. Auto Monitoring

所依赖的组件:

  • Kubernetes
  • Helm
  • Docker
  • GitLab Runner
  • Prometheus

来源:https://git.iec.io/help/topics/autodevops/index.md

参考

  • Auto DevOps
  • Multiple Kubernetes clusters [PREMIUM]
  • Incremental rollout to production [PREMIUM]
  • Disable jobs you don't need with environment variables
  • Use a static IP for your cluster
  • Use your own buildpacks to build your application
  • Prometheus monitoring

延伸阅读

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 206,126评论 6 481
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 88,254评论 2 382
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 152,445评论 0 341
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 55,185评论 1 278
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 64,178评论 5 371
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,970评论 1 284
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,276评论 3 399
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,927评论 0 259
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 43,400评论 1 300
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,883评论 2 323
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,997评论 1 333
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,646评论 4 322
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,213评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,204评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,423评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,423评论 2 352
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,722评论 2 345