相信许多程序员在新年开始在做 code sign (数字签名)的时候可能遇到 Verisign Timestamp 服务器不好用了 http://timestamp.verisign.com/scripts/timstamp.dll 的情况。出现了如下错误:
2021 年国外 IT 公司对于 DevOps 工程师的要求有哪些?
前言
自 2020 年因疫情开始,越来越多的 IT 公司都因不得不在家办公从而彻底转为 WFH(Work From Home) 公司,因此对于 IT 从业者来说,工作机会今后将会是全球性的。
如果你有意想进入一个跨国公司工作,想与世界各地的人在一起工作,那么就不能仅仅的关注国内的这些大厂,要将眼光放眼到全世界,看看这些耳熟能详的公司对于工程师的职位要求有哪些。
今天就先来看看 DevOps 岗位的需求是什么样的,了解这些,一来可以帮助我们在2021 年树立学习方向,而来如果你有意向去这些公司,了解并提早做准备才能有机会获取你想要的岗位。
由于这些职位的介绍和要求会很长,因此我就先说结论。
主要技能
- 国外很多公司他们使用的云服务商主要是 AWS,因此熟悉和使用 AWS
- 熟练使用 DevOps 工具,如 Jenkins, Ansible(Chef), Git 等
- Docker 和 Kubernetes 是每个想从事 DevOps 需要掌握的
- 熟悉操作系统,至少要 Linux
- 大多数都是要求 Python 很熟练,高级一些的岗位会要求熟悉 Go, Java 语言
- 最后,乐于学习,积极主动,具有创造性思维是每个 DevOps 最重要的特质,因此新的技术和工具层出不穷,我们需要保持和新进同行
具体的职位要求细节,请看后面的职位介绍吧 …
How to backup Jenkins
I believe most of you have used the Jenkins configuration as code principle, so you build/test/release process will be described in code.
It looks like all is good, but not all of the configuration is in code, same of the Jenkins system configuration is store in the Jenkins service, so we also need to backup Jenkins in case of any disaster.
There are two ways to backup Jenkins, one used Jenkins plugin, the other is create shell scripts.
Using plug-in backup
I used the ThinBackup
plugin, here is my thinBackup configuration.
JaCoCo 实现原理 (JaCoCo Implementation Design)
想要对 Java 项目进行代码覆盖率的测试,很容易就找到 JaCoCo 这个开源代码覆盖率分析工具是众多工具中最后欢迎的哪一个。
本篇仅仅是在学习 JaCoCo 时对其实现设计文档 https://www.jacoco.org/jacoco/trunk/doc/implementation.html 的粗略翻译。
实现设计(Implementation Design)
这是实现设计决策的一个无序列表,每个主题都试图遵循这样的结构:
- 问题陈述
- 建议的解决方案
- 选择和讨论
覆盖率分析机制(Coverage Analysis Mechanism)
覆盖率信息必须在运行时收集。为此,JaCoCo 创建原始类定义的插装版本,插装过程发生在加载类期间使用一个叫做 Java agents 动态地完成。
有几种收集覆盖率信息的不同方法。每种方法都有不同的实现技术。下面的图表给出了 JaCoCo 使用的技术的概述:
字节码插装非常快,可以用纯 Java 实现,并且可以与每个 Java VM 一起工作。可以将带有 Java 代理钩子的动态插装添加到 JVM 中,而无需对目标应用程序进行任何修改。
Java 代理钩子至少需要 1.5 个 JVMs。用调试信息(行号)编译的类文件允许突出显示源代码。不幸的是,一些 Java 语言结构被编译成字节代码,从而产生意外的突出显示结果,特别是在使用隐式生成的代码时(如缺省构造函数或 finally 语句的控制结构)。
Ansible 实践
最近在思考如何将团队里的所有的虚拟机都很好的管理并监控起来,但是由于我们的虚拟机的操作系统繁多,包括 Windows, Linux, AIX, HP-UX, Solaris SPARC 和 Solaris x86. 到底选择哪种方式来管理比较好呢?这需要结合具体场景来考虑。
Ansible 和其他工具的对比
这里有一个关于 Chef,Puppet,Ansible 和 Saltstack 的对比文章
https://www.edureka.co/blog/chef-vs-puppet-vs-ansible-vs-saltstack/
选择合适的工具
仅管理 Windows 和 Linux
如果你的虚拟机没有这么多平台,只是 Windows 和 Linux,假如你已经有了 VMware vSphere 来管理了,那么可以通过 VMware vSphere API 来查看这些机器的状态。
这里是 VMware 官方的 API Library 供使用:
管理多个操作系统
如果你和我的情况一下,想监控很多个操作操作系统,那么就只能通过 ssh 来登录到每一台机器上去查看,比如执行 uptime
等命令。可以写 shell 脚本来完成这些登录、检测等操作。
另外就是使用 Ansible 的 Playbook。Playbook 里描述了你要做的操作,这是一个权衡,学习 Ansible 的 Playbook 需要花些时间的。
如果想了解下 Ansible 那么可以试试 Ansible Playbook。以下是我使用 Ansible 做了一些练习。
Playbook结构
+- vars |
Playbook具体代码
写给那些想使用 JFrog Artifactory 管理制品的人
我在使用 Artifactory 做持续集成已经有一段时间了,对企业级 Artifactory 也有了一些经验和总结,希望能通过本篇的分享帮助刚接触这个工具的人了解什么是Artifactory,它能做什么,为什么要选择它,以及在使用过程中应该注意什么。
什么是Artifactory
一句话概括:Artifactory 是一个存放制品(Artifacts)的工具。当前,Artifactory 是一个非常有影响力,功能非常强大的工具。
Artifactory有哪些优势
可能你的团队已经有了自己的管理制品的方式,比如 FTP 等。Artifactory 能带来什么呢?让我先来看看它有哪些优势。
注:以下优势都是针对 JFrog Aritifacvtory 企业版来介绍的。开源版,即 OSS 版本不具备以下丰富的功能。
优势1:它是一个通用管理仓库
JFrog Artifactory 企业版完全支持所有主要包格式的存储库管理器。它不但可以管理二进制文件,也可以对市面上几乎所有语言的包的依赖进行管理,如下图所示
因此,使用 Artifactory 能够将所有的二进制文件和包存储在一个地方。
程序员自我修养之Git提交信息和分支创建规范
在 GitHub 上发布一个 Python 项目需要注意哪些
本篇介绍个人或企业在 GitHub 上发布一个 Python 项目需要了解和注意哪些内容
配置setup.py
打包和发布一项都是通过准备一个 setup.py
文件来完成的。假设你的项目目录结构如下:
demo |
在使用打包命令 python setup.py sdist bdist_wheel
,将会生成在 dist 目录下生成两个文件 demo-1.0.0-py3-none-any.whl
和 demo-1.0.0.tar.gz
.whl
文件是用于执行pip install dist/demo-1.0.0-py3-none-any.whl
将其安装到...\Python38\Lib\site-packages\demo
目录时使用的文件。.tar.gz
是打包后的源代码的存档文件。而MANIFEST.in
则是用来控制这个文件里到底要有哪些内容。
About Python pip install and versioning
Backgroup
If you want to release python project on PyPI, you must need to know about PyPI usage characteristics, then I did some test about pip install command.
For example: I have a Python project called demo-pip
. and beta release would like 1.1.0.xxxx
, offical release version is 1.1.0
to see if could success upgrade when using pip
command.
Base on the below test results, I summarized as follows:
- Install a specific version of demo-pip from PyPI, with
--upgrade
option or not, they’ll all both success. - Install the latest package version of demo-pip from PyPI that version is large than the locally installed package version, with
--upgrade
option installs successfully. without--upgrade
option install failed. - Install the latest package version of demo-pip from PyPI that version is less than the locally installed package version, with
--upgrade
option or not, install failed. - 1.1.0.xxxx version naming is OK, but when the beta version is larger than 1.1.0, for example, the beta version is 1.1.0.1000, pip install with
--upgrade
not work when our official release version is 1.1.0.
a. One option is the official release version start from 1.1.0.1000, beta version starts from 1.1.0.0001, 1.1.0.0002… Or the beta version should be less than 1.1.0, maybe 1.0.0.xxxx
b. Another option is follow up python official versioning that is the best practice, then the beta release version will be 1.1.b1, 1.1.b2, 1.1.bN… (it passed No.5 test below)
My Test Case
Update Jira server account avatar with rest API
Backgroud
When you are using a server account for CI/CD, if you want to make the server account avatar to looks professional on Jira update but the server account may not allowed to log to Jira, so you can not update the avatar though GUI, you could use Jira REST API to do this.
I assume you have an account called robot
, here are the examples of how to update though REST API.
Example in Python
import http.client |
Example in Postman
Fixed "Remote session was disconnected because there are no Remote Desktop client access licenses available"
通过 generic-webhook-trigger 插件实时获取 Bitbucket Repository Events
背景
本篇讨论如何通过 Jenkins generic webhook trigger 插件来获取 Git 仓库事件(Events)。比如获取仓库的 Pull Request ID 等。
使用过 Jenkins Multi-branch pipeline Job 的用户知道,这个 Job 类型的环境变量中可以得到 Pull Request 的相关信息如下
为了获取这个变量需要创建这种类型的 Job,并且可能需要 clone 该仓库的代码,有点杀鸡宰牛的意思,看起来并不是一个特别恰当的办法。
如何通过创建一个普通的 Jenkins Job 就能实时获取 Bitbucket 仓库以及 Pull Request 事件呢?通过以下功能和插件可以实现。
Annual work summary from 2019.03 - 2020.07
Summarize what did I do from 2019.03 to 2020.07 when I became a Build Release/DevOps engineer.
Build automation
- Support all server windows platform build manual to auto.
- Support clients build from manual to auto.
- Switch Linux/Unix build from Bamboo to Jenkins.
- Support all platforms branches/Pull Request build.
- Provide auto-build as self-service for a developer, no need to involve build engineer, they could build themselves.