【管理】DevOps
本文目录 30 个章节
【管理】DevOps
创建时间:2021/7/15 10:17
- 【管理】DevOps
- 我的理解与总结
- Agile
- DevOps
- 其他解释
- 起源与发展
- DevOps 流水线
- CI/CD
- What is CI/CD?
- CI(Continuous Integration)
- 好处
- Continuous Delivery
- Continuous Deployment
- CI(Continuous Integration)
- Why CI/CD
- 从商业角度
- 从研发角度
- Reduces Risk
- Better Collaboration
- Faster iterations
- Faster feedback enables faster technological and business decisions
- Reduces overhead
- 实践中的场景
- Tools
- Practices
- main areas of the CD process
- the best practice workflow
- Continuous Delivery checklist
- Maturity of CI/CD
- 部署的触发点
- What is CI/CD?
- CI/CD, Agile and DevOps
- Ref
我的理解与总结
DevOps is a set of practices that combines software development (Dev) and IT operations (Ops).
DevOps是一套方法论,是一系列理念与实践方法的集合,旨在沟通研发与运维,缩短研发周期,提高产品质量。
CI/CD就是DevOps的实践,是DevOps流程中主要的一部分。 CI: 频繁地(一天多次)将代码集成到主干。 CD: 频繁地将软件的新版本,交付给质量团队或者用户,以供评审。
Agile
Agile is a large framework that encompasses the other two practices. It is a philosophy of software development that is implemented in various methodologies – Scrum, Kanban, Scaled Agile Framework (SAFe), etc.
DevOps
DevOps is a set of practices that combines software development (Dev) and IT operations (Ops). It aims to shorten the systems development life cycle and provide continuous delivery with high software quality. via. [wikipedia]https://en.wikipedia.org/wiki/DevOps
DevOps is a collaborative culture with a set of practices, ideas, tools, technologies, and processes that streamline the product development process.
DevOps是Development和Operations的组合,是一种 方法论 ,是一组 过程、方法与系统的统称 ,用于促进应用开发、应用运维和质量保障(QA/测试)部门之间的沟通、协作与整合。以期打破传统开发和运营之间的壁垒和鸿沟。
从目标来看,DevOps就是让开发人员和运维人员更好地沟通合作,通过自动化流程来使得软件整体过程更加快捷和可靠。



其他解释
字面意思上说 DevOps 是指“开发运维一体化”,即通过工具辅助开发完成运维的部分工作,减少成本。但深入理解了 DevOps 之后,你会发现 DevOps 其实是一种软件研发管理的思想,方法论,他追求的是一种没有隔阂的理想的研发协作的状态,可能涉及到的角色有开发、测试、产品、项目管理、运维等等。所以我们认为,为了帮助研发团队在保持质量的前提下提高交付效率的方法和方法论都隶属于 DevOps 的范畴。(https://www.zhihu.com/question/58702398/answer/608049028)
The point of DevOps is to ensure that developers and QAs are on the same page at all stages of a project
起源与发展
软件研发流程:开发,测试,布署。
软件开发人员花费数周和数月编写代码,然后将代码交给QA(质量保障)团队进行测试,然后将最终的发布版交给运维团队去布署。

瀑布(Waterfall)模型:

敏捷开发(Agile Development):

敏捷开发可以帮助更快地发现问题,产品被更快地交付到用户手中,团队可以更快地得到用户的反馈,从而进行更快地响应。而且,DevOps小步快跑的形式带来的版本变化是比较小的,风险会更小。即使出现问题,修复起来也会相对容易一些。
虽然敏捷开发大幅提升了软件开发的效率和版本更新的速度,但是它的效果仅限于开发环节。研发们发现,运维那边,依旧是铁板一块,成为了新的瓶颈。
开发者的诉求是改变,增加功能,而运维的核心诉求,就是不出问题,运维非常排斥“改变”。

在DevOps的流程下,运维人员会在项目开发期间就介入到开发过程中,了解开发人员使用的系统架构和技术路线,从而制定适当的运维方案。而开发人员也会在运维的初期参与到系统部署中,并提供系统部署的优化建议。
DevOps的实施,促进开发和运维人员的沟通,增进彼此的理解。
DevOps 流水线

CI/CD
What is CI/CD?
In software engineering, CI/CD or CICD is the combined practices of continuous integration and either continuous delivery or continuous deployment.
CI/CD is a part of the DevOps process.
DevOps是一套方法论,是一系列实践的集合,那么CI/CD就是DevOps方法论的实践,是DevOps流程中的一部分,是DevOps的主心骨。
CI/CD bridges the gaps between development and operation activities and teams by enforcing automation in building, testing and deployment of applications.
The CI/CD practice , or CI/CD pipeline , forms the backbone of modern day DevOps operations.
CI/CD is a collection of operating principles and practices that help development teams to deliver frequent code changes reliably. via. Max Shash
其他介绍: https://www.sdxcentral.com/cloud/cloud-native/definitions/what-is-ci-cd-definition/ https://resources.github.com/ci-cd/
CI(Continuous Integration)
频繁地(一天多次)将代码集成到主干。
In software engineering, continuous integration (CI) is the practice of merging all developers’ working copies to a shared mainline as early as possible, in best cases several times a day. via. Wikipedia
核心措施:代码集成到主干之前,必须通过自动化测试。
Continuous integration is the process of running your whole test suite any time you commit code to your repository. This makes sure your application works as expected and changes do not introduce unexpected behavior.
Each integration can then be verified by an automated build and automated tests .
持续集成(CI)是在源代码变更后自动检测、拉取、构建和测试的过程。持续集成的目标是快速确保开发人员新提交的变更是好的,并且适合在代码库中进一步使用。CI的流程执行和理论实践让我们可以确定新代码和原有代码能否正确地集成在一起。
CI中,开发人员将会频繁地向主干提交代码,这些新提交的代码在最终合并到主干前,需要经过编译和自动化测试流进行验证。

好处
让产品可以快速迭代,同时还能保持高质量。 (1)快速发现错误。每完成一点更新,就集成到主干,可以快速发现错误,定位错误也比较容易。 (2)防止分支大幅偏离主干。如果不是经常集成,主干又在不断更新,会导致以后集成的难度变大,甚至难以集成。
Continuous Delivery
频繁地将软件的新版本,交付给质量团队或者用户,以供评审。
Continuous delivery (CD) is a software engineering approach in which teams produce software in short cycles, ensuring that the software can be reliably released at any time and, when releasing the software, without doing so manually. via. Wikipedia
Continuous delivery is an extension of continuous integration since it automatically deploys all code changes to a testing and/or production environment after the build stage. via. STEN PITTET
Continuous Deployment
持续交付的下一步,指的是代码通过评审以后,自动部署到生产环境。

图片来源:https://www.ruanyifeng.com/blog/2015/09/continuous-integration.html
Continuous Deployment - is similar with Continuous Delivery. In Continuous Deployment software is also produced in short cycles but through automated deployments rather than manual ones.
Continuous deployment goes one step further than continuous delivery. With this practice, every change that passes all stages of your production pipeline is released to your customers. There’s no human intervention, and only a failed test will prevent a new change to be deployed to production. via. STEN PITTET
Why CI/CD
从商业角度
For all startups, moving fast, iterating quickly, and building on top of feedback from early users and customers are keys to growing into a successful company.
speed wins the marketplace
Continuous integration and delivery are two best practices to help keep up with constant change and achieve this speed boost.
从研发角度
Reduces Risk
One of the key benefits of integrating regularly is that you can detect errors quickly and locate them more easily.
“Continuous Integration doesn’t get rid of bugs, but it does make them dramatically easier to find and remove.” -Martin Fowler, Chief Scientist, ThoughtWorks
A good CI setup speeds up your workflow and encourages the team to push every change without being afraid of breaking anything.
Better Collaboration
When you have a CI process in place that is hooked into a Continuous Delivery workflow it’s easy to share your code regularly. This code sharing helps to achieve more visibility and collaboration between team members. Eventually this increases communication speed and efficiency within your organization as everybody is on the same page, always.
Faster iterations
As you release code often, the gap between the application in production and the one the developer is working on will be much smaller.
As every small change will be tested automatically and the whole team can know about these changes you will want to work on small, incremental changes when developing new features. This results in less assumptions as you can build features quicker and test and deploy them automatically for your users to see as soon as possible, thus gaining valuable feedback from them faster.
Faster feedback enables faster technological and business decisions
As you push code more often, you have more data available which you can analyze to check if the product is heading into the right direction. This continuous data flow and the timeline of metrics (like dependency, unit tests, complexity, and code smell) can also help to reflect on the progress of the project more frequently which enables faster technological and business decisions.
Reduces overhead
Reduces overhead across the development and deployment process
Reduces the time and effort for integrations of different code changes
Reduces manual testing effort
Building features more incrementally saves time on the debugging side so you can focus on adding features
实践中的场景
Tools
CloudBees CI, TravisCI, SemaphoreCI, CircleCI, Jenkins, Bamboo, Teamcity
Practices
main areas of the CD process
Source Control
Build Process
Testing & Q&A
Deployment
Visibility
the best practice workflow
Maintain a code repository
Automate your build
Make your build self-testing
Daily commits to the baseline by everyone on the team
Every commit (to the baseline) should be built
Every bug-fix commit should come with a test case
Keep your builds fast
Clone the production environment and test there
Make it easy to get the latest deliverables
Everyone on the team can see the results of your latest build
Automate build deployment
Continuous Delivery checklist
Before submitting changes, check to see if a build is currently in the “Successful” status. If not, you should assist in fixing a build before submitting new code.
If the status is currently “Successful”, you should rebase your personal workspace to this configuration.
Build and test locally to ensure the update doesn’t break functionality.
If Successful, check in new code.
Allow CI to complete with new changes.
If build fails, stop and fix on your machine. Return to step 3.
If build passes, continue to work on the next item.
Maturity of CI/CD

部署的触发点
定期触发
Git/SVN Hook 自动部署
手动触发
CI/CD, Agile and DevOps
via. https://www.browserstack.com/guide/ci-cd-vs-agile-vs-devops
Agile is a large framework that encompasses the other two practices. It is a philosophy of software development that is implemented in various methodologies – Scrum, Kanban, Scaled Agile Framework (SAFe), etc.
DevOps is an agile development practice and mindset that uses agile principles (collaboration, communication, utilizing the right tools) to streamline software building, testing, and release.
CI/CD is a DevOps tactic, which makes use of the right automated testing tools to implement agile development.
Ref
核心文章: https://www.cloudbees.com/continuous-delivery/continuous-integration https://www.ruanyifeng.com/blog/2015/09/continuous-integration.html https://medium.com/aws-activate-startup-blog/five-tips-to-get-started-with-continuous-delivery-c292cfd60970 https://www.zhihu.com/question/58702398 https://segmentfault.com/a/11900000230861221 https://www.zhihu.com/question/58702398
其他相关文章: https://devopedia.org/devops