2020总结——看见与成长
黄龙国际难得在晚上8点的时候就如此冷清,提交了2020的最后一个commit和文档工作之后,自己的节奏就这样慢了下来,挂上降噪耳机过去的一年如同电影画面一帧一帧在脑海中掠过,庚子年见证历史,也是见证我自己的一年,一句话总结自己的2020——看见与成长。
黄龙国际难得在晚上8点的时候就如此冷清,提交了2020的最后一个commit和文档工作之后,自己的节奏就这样慢了下来,挂上降噪耳机过去的一年如同电影画面一帧一帧在脑海中掠过,庚子年见证历史,也是见证我自己的一年,一句话总结自己的2020——看见与成长。
黄龙国际难得在晚上8点的时候就如此冷清,提交了2020的最后一个commit和文档工作之后,自己的节奏就这样慢了下来,挂上降噪耳机过去的一年如同电影画面一帧一帧在脑海中掠过,庚子年见证历史,也是见证我自己的一年,一句话总结自己的2020——看见与成长。
黄龙国际难得在晚上8点的时候就如此冷清,提交了2020的最后一个commit和文档工作之后,自己的节奏就这样慢了下来,挂上降噪耳机过去的一年如同电影画面一帧一帧在脑海中掠过,庚子年见证历史,也是见证我自己的一年,一句话总结自己的2020——看见与成长。
当面对生活的困苦、身体的乏累、精神的折磨时,我时常在想当我成为一名父亲的时候我会为你做什么,能不能用我自己的经验和学识帮助你在经历困苦的时候稍微轻松一点、舒服一点。虽然你现在既不会说话,也听不懂我现在的呢喃,但我还是想送你一份这样的礼物。
周则夷小朋友,你好!
这是一份来自你父亲的一份迟到的礼物,本来打算在你出生的时候就送给你,一来是记录你的出生带来的欢喜和改变,二来是记录我对你的期待和祝福,可是生活就是这样——“若不是生活所迫,谁愿意把自己弄的一身才华“。你的父亲也是第一次踏上自己的人生路,他也在拼搏、也有迷茫、更有烦恼和力所不能及的事情,所以希望你可以原谅这份迟到的礼物,不过还好在魔幻的2020快结束的时候,这份礼物还是赶上了你的周岁生日。
亲爱的周则夷小朋友,虽然我们没有办法预知未来,但我希望长大的你是这样的:
最后让我们不要变成那种“都看得很明白,都活得很不明白”的人,当别人看你的时候你只要——心里有爱、眼里有光就够了!
汇率是指两个国家的货币之间的比价、兑换率。人民币汇率即人民币与外币之间的比价、兑换率。
人民币汇率代表人民币的对外价值,由国家外汇管理局在独立自主、统一性原则基础上,参照国内外物价对比水平和国际金融市场汇率浮动情况统一制订、调整,逐日向国内外公布,作为一切外汇收支结算的交换比率,它是官方汇率,没有市场汇率,其标价方法采用国际上通用的直接标价法,即以固定单位 (如100、10000、100000等) 的外币数折合若干数额的人民币,用以表示人民币对外币的汇率。固定单位的外币数大小须视各该外币的价值大小而定,除人民币对比利时法郎和意大利里拉汇率采用一万 (10000)单位、对日元汇率采用十万 (100000)单位作为折算标准外,对其他各种外币汇率均以一百(100)单位作为折算标准。
从地理上来讲,在岸汇率和离岸汇率的区别在于中国大陆和中国大陆之外的区别:
我们通常说的兑换外币,一般是在中国大陆的银行完成兑换,所以使用的汇率是按照在岸汇率作为兑换标准。
在岸汇率:
即央行授权中国外汇中心于每个工作日上午对外公布当日人民币兑换美元、欧元、日元、港币汇率的中间价作为当日银行间即期外汇市场以及银行柜台交易汇率的参考价格,这就叫在岸人民币。
离岸汇率:
即央行开放香港以及其他国家进行人民币交易的汇率就叫离岸人民币,而2010年中国香港实施的人民币离岸交易(CNH)已经是泛指海外离岸人民币交易。
2016年底,人民币对美元连连暴跌,不少人认为汇率即将破7,然而看到了在岸汇率的坚挺,结果很快离岸人民币汇率又开始上涨。
在岸汇率和离岸汇率因为不相同,所以会产生一个差,一旦这个差过大,投机者就可以通过低汇率的一岸买进,通过高汇率的一岸卖出,从而进行卖出套利。
同时,大量的套利,又会很快的让离岸和在岸的汇率的差,快速减少。
在岸人民币就指的在国内市场人民币汇率基本水平的一个价格趋势或者价格的走势。主要是在本土,就在我们国内的市场层面。
离岸人民币基本上就是在海外,在中国界外的一些市场,最早的离岸市场可能是在香港,然后又从离岸市场扩展到新加坡。现在新加坡可能是人民币报价体系比较重要的一个离岸市场,当然现在可能还会延展到芝加哥,这样就是说在海外市场人民币的报价水平就称为离岸市场。
它实际上是一个onshore(在岸)和offshore(离岸)这样一个基本概念,一个是在本土国,一个是在海外,这是一个最基本的概念。
两个市场的参与者、价格形成机制以及交易量方面都有较大的差异:
3.国际金融市场的冲击,尤其是海外投资者风险偏好的变化,对离岸市场的人民币汇率影响更大。
因其与国际金融市场的联系更紧密,而在岸市场因为存在管制,对这些冲击就不那么敏感。因此,在国际金融市场较动荡的时候,在岸和离岸汇率通常也会出现较明显的差价。
其实,离岸人民币与在岸人民币之间也会相互影响:
跨境进口企业则倾向于在在岸上交易,因为同样数额的美元进口支出在在岸市场,可用较少的人民币购买即可。进口企业在在岸市场上出售人民币、买入美元的行为又会使在岸人民币贬值。
因此交易者们不能直接在离岸和在岸人民币市场上进行套汇交易,然而,都可以在无本金交割远期外汇交易(NDF)市场上进行操作。
NDF是一种离岸金融衍生产品,在岸金融机构,可以通过在岸人民币远期市场和NDF市场进行套汇。
举个例子来说,在周边国家经济前景恶化的情况下,离岸投资者对内地经济增长的信心也可能下降(因为周边国家是中国的重要出口目的地)。
这样离岸人民币汇率可能贬值,这又会影响在岸市场对人民币的信心,从而带动在岸人民币汇率同向变化。
CICD(Continuous Integration, Continuous Delivery),作为工程人员大家都一致认可 CICD 的重要性,由于 CICD 的涉及面太过广泛,每个工程人员对 CICD 的第一反应都是不尽相同的。在设计 CICD 框架之初,希望可以对 CICD 有一个比较全面而结构化的认识,基于这样的认识进行 CICD 的思考和设计。
下面是引用自 Wikipedia 对于 CICD 的解释:
In software engineering, CI/CD or CICD generally refers to the combined practices of continuous integration and either continuous delivery or continuous deployment.
CI/CD bridges the gaps between development and operation activities and teams by enforcing automation in building, testing and deployment of applications. Modern day DevOps practices involve continuous development, continuous testing, continuous integration, continuous deployment and continuous monitoring of software applications throughout its development life cycle. The CI/CD practice or CI/CD pipeline forms the backbone of modern day DevOps operations.1
CICD 存在于软件工程实践中,它的目的是帮助开发团队更快、更可靠地发布软件迭代,从 DevOps 或者敏捷开发的角度来讲,CICD 是最佳实践,这个毋庸置疑的。从Wikipedia的解释中可以看出软件的生命周期包括:
RedHat对上述软件生命周期进行了按时序归类,如下图所示。
Continuous integration is a coding philosophy and set of practices that drive development teams to implement small changes and check in code to version control repositories frequently. Because most modern applications require developing code in different platforms and tools, the team needs a mechanism to integrate and validate its changes.
The technical goal of CI is to establish a consistent and automated way to build, package, and test applications. With consistency in the integration process in place, teams are more likely to commit code changes more frequently, which leads to better collaboration and software quality.2
CD 可以是 Continuous Delivery 的缩写,也可以是 Continuous Deployment 的缩写。CD 是 CI 的一个扩展,这个扩展可以持续地确保快速地将软件迭代版本发布到用户。
Continuous delivery picks up where continuous integration ends. CD automates the delivery of applications to selected infrastructure environments. Most teams work with multiple environments other than the production, such as development and testing environments, and CD ensures there is an automated way to push code changes to them.2
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.3
Continuous Delivery 和 Continuous Deployment 的区别如下图所示。
CI,CD 的分析表格如下所示3。
Subject | Cost | Gain |
---|---|---|
Continuous integration | – Your team will need to write automated tests for each new feature, improvement or bug fix. – You need a continuous integration server that can monitor the main repository and run the tests automatically for every new commits pushed. – Developers need to merge their changes as often as possible, at least once a day. |
– Less bugs get shipped to production as regressions are captured early by the automated tests. – Building the release is easy as all integration issues have been solved early. – Less context switching as developers are alerted as soon as they break the build and can work on fixing it before they move to another task. – Testing costs are reduced drastically – your CI server can run hundreds of tests in the matter of seconds. – Your QA team spend less time testing and can focus on significant improvements to the quality culture. |
Continuous delivery | – You need a strong foundation in continuous integration and your test suite needs to cover enough of your codebase. – Deployments need to be automated. The trigger is still manual but once a deployment is started there shouldn’t be a need for human intervention. – Your team will most likely need to embrace feature flags so that incomplete features do not affect customers in production. |
– The complexity of deploying software has been taken away. Your team doesn’t have to spend days preparing for a release anymore. – You can release more often, thus accelerating the feedback loop with your customers. – There is much less pressure on decisions for small changes, hence encouraging iterating faster. |
Continuous deployment | – Your testing culture needs to be at its best. The quality of your test suite will determine the quality of your releases. – Your documentation process will need to keep up with the pace of deployments. – Feature flags become an inherent part of the process of releasing significant changes to make sure you can coordinate with other departments (Support, Marketing, PR…). |
– You can develop faster as there’s no need to pause development for releases. Deployments pipelines are triggered automatically for every change. – Releases are less risky and easier to fix in case of problem as you deploy small batches of changes. – Customers see a continuous stream of improvements, and quality increases every day, instead of every month, quarter or year. |
对比下来 Continuous Deployment 是一个比较理想的状态,对像蚂蚁这样的复杂基础设施架构的公司来讲,CICD 的投入会非常巨大,所以暂且以 Continuous Delivery 作为CICD的目标。
通过对 CICD 的通盘了解和分析,无论是 CI 还是 CD 它的最终目的都是:
“establish a consistent and automated way to build, package, and test applications.”。
归纳一下 CICD 关键字包括 consistent
, automated
, build
, package
, test
:
经过上述的分析,我认为 CICD 就是一个自动化的 pipeline,该流水线帮助软件开发从代码提交开始就进行构建、测试、release等整个流程。
鉴于蚂蚁基础设施以及开发环境的特殊性,对 CICD 的细节做了一些调整:
通用的 CICD pipeline 如下图所示。
近两周都code review,CR中挣扎,主要还是所有的工作都被CR严重拖累,被问了太多为什么,而不是有价值的comment,每次review都会经历这样的事情,而且是非收敛式的。心里真想骂娘。
code style rules
)千万不要以committer的角度来review代码,reviewer还是需要本着尊重作者的角度来查漏补缺(逻辑,代码规范,测试,重大的设计问题)。
特别说明:这里针对的是团队内部的交付场景
#反思总结