In 2013, Docker.Inc opened source an application container engine Docker. Developers can package their applications and dependencies into a portable container and distribute them to any Linux machine with the same kernel for deployment. This containerized approach to application development and deployment reduces the pressure on developers to develop, test, and deploy software. Docker has been loved by developers since its launch in 2013.

Today we invite a guest, is a container core technology expert, he independently developed the domestic open source application container engine – Cocker, today we will listen to his story with Cocker.

Introduce yourself to the developers first

Hello everyone, my name is li hua (calvinwilliams, betonarmee, pizazzrain are all my online names ^_^), and I am currently in charge of infrastructure in the information technology department of bank of hangzhou.

I was born in Hangzhou, went to school in Hangzhou, and worked in Hangzhou. I began to learn GW-BASIC on the junior high school bully-master learning machine. After ranking among the top three in the senior high school, my father kept his promise and bought the first computer in his life (lenovo brand machine, which cost 15,000 yuan in 1998). As a result, I was addicted to Q-Basic, which led to my poor grades.

In 1999, I was admitted to the mechanical Engineering and Automation major of Zhejiang University of Technology after working hard before the college entrance examination. In 2000, I got the first place in the second level computer examination of the whole school. From then on, I formed a relationship with C language. The highest honor I won in university was the national Second Prize in data Modeling for University Students in 2001.

In 2002, I used the old PC at home to install Red Hat Linux to make a website, providing free Web space, forum services (using PHP+MySQL research).

Since graduating from university in 2003, I have been engaged in technical research and development in the banking system based on my development ability and modeling award. I have written THE C language for nearly 15 years and developed the online trading platform IB2 of the core system of the bank (6 million transactions per day), the bulk trading platform HZBAT and the pre-framework HB (more than 100 pre-systems have been implemented) independently. The production has been running steadily till now. I have written JAVA language for half a year and AS400 RPGLE language for minicomputer for one year. I like the simplicity, strong control and efficient performance of C very much, and I am obsessed with deep code cleanliness.

When did you get into container technology?

I came into contact with container technology relatively late. I learned Docker by myself when I worked as a container cloud POC in the beginning of 2018. With years of research and development experience in Linux environment, I learned it quickly. It has to be said that container technology is a revolutionary way of software deployment, it is much lighter than virtual machine, second startup speed, easy to package deployment, strong elastic scalability. I found an article here that will give you a better understanding of container technology.

What kind of opportunity inspired you to write Cocker?

Every time after a big project in the industry, I couldn’t stay idle immediately, so I had to find a small project to transition the working rhythm. After the new core system of Bank of Hangzhou was put into operation in 2012, I realized that there would be more and more front-end systems in the future, so I spent half a year to completely develop the front-end framework HB by myself and completely develop the front-end through configuration. After the distributed transformation of core system service in 2018, I continued to learn container technology. After reading up on container technology, I found that implementing a container engine was not very difficult, and I had some unique ideas, so I came up with the idea of writing a container engine.

In the process of writing Cocker, what was the biggest difficulty in writing?

It is not difficult to implement a container engine on Linux by using the kernel’s chroot, namespaces, cgroups, hierarchical file systems, iptables, pseudo-terminals, etc.

If we have to sum up the most difficult technical implementation bones, I am afraid that the container startup of chroot, namespace, hierarchical file system, system resource control, network environment, etc., orderly and accurate Settings, but I think the development of container engine is more difficult, although it has all the five elements, Writing a complete container engine product requires more consideration than just implementing a crude container initiator, such as directory file structure specifications, operation primitives for images and container objects, how to be more user-friendly, and so on. These are the numerous design and detail considerations that go into building a product. Implementation of the final output to the ground, often than just head thought again, combination which underlying interface to pay more time (also in the process to create fun), let me put it this way, the kernel provides the realization of the interface roughness can run up to a container launcher I only spent a week time to () after the kids to bed every night, But it took me another two months or so (every night after the kids went to bed) to hone it into a product of complete management capabilities.

Like my other open source projects, each one should have its own characteristics, or have stronger performance (FasterJSON, FasterXML, FasterHTTP, etc., can be compared with the fastest function library in the world). Or have a simpler implementation of the structure that others can modify and extend (poking fun at how complex open source projects tend to be).

How can developers write their own little frameworks or engines like yours?

I don’t think on the one hand, to be familiar with the framework on how to write or engine, such as writing a communication framework, only written communication procedures, the use of the underlying interface experience, to abstract the framework design, framework originally is to develop software in order to more convenient after repeatedly and summed up encapsulation, the underlying interface on pit, the more the more upper user needs experience, the stronger framework.

On the other hand, it is important to know the scale and domain advantages that the framework or engine you are developing is suitable for. There is no panacea for frame or engine, and different scale scenarios fit different frame engines. Products with good versatility have a wide range of adaptation, but in the pursuit of a certain aspect of the extreme scene is more suitable for the characteristics of the scene frame or engine.

Finally, as the maintainer of a framework or engine, it needs the perseverance and energy time of iterative repair for years and years, especially the pure personal drive, which is especially valuable in the living environment of domestic technicians.

What are the advantages of Cocker over Docker?

When I first learned Docker, I found that Docker emphasizes one container and one process, which can thin the design of container engine. If we want to support multiple processes, we need to use other technologies. The core system of the industry is built in C language, and it is common for multiple processes to cooperate into a system, ali has obviously also found this problem. One of the promotional ideas behind Pouch is that it is a “rich container.” So the first advantage of Cocker is native support multi-process mode (of course, also support a single process), developed from the Cockerinit process imitation Linux init is responsible for recycling orphan process, is also responsible for attaching the creation of pseudo-terminal, K8S can save Pod.

Cocker’s second advantage, virtual machine management, more general and more flexible. Since cockerinit can create a dummy terminal for each attach, then naturally the container becomes virtual machine management mode. The container management primitives are added to boot and shutdown, and the image construction can be done without forced batch Dockerfile mode. You can log in and interactively tinker with it.

The third advantage of Cocker is that it natively supports instantiation of application configuration files within containers. By the mirror create containers, container instantiation application configuration file, often with the help of a container scheduling engine or other third party tools, he has a management directive specifies the outside of a key value mapping file and container variational configuration files, can quickly replace one can actually use the instantiation of the configuration file. Native support means fewer dependencies and better performance and usage.

Docker is written in go language, Cocker is written in C language, I think as long as there is enough technical ability, the general underlying system software is best written without GC language is appropriate, especially in Linux platform, using C language is closer to the kernel.

Some people may note that Cocker’s advantages are not major innovations. Docker has been quite mature from the perspective of management functions. Cocker just improves the places where Docker disdants to do or does not adapt to our environment.

What is the progress of Cocker now?

At present Cocker has relatively complete implementation of the core functions of a container engine, but there is still room for transformation, such as the need to develop its own mirror library (I first implemented one based on SSH), container root process to merge into a unified service (otherwise there are many containers, The number of processes has pressure on the system), the call mode of the underlying interface should be transformed into a function mode (now there are some processing is very rough direct call external command), etc., and then will choose the machine to start the second phase, research and development of the scheduling engine (the standard Kubernetes). The big roadmap is to complete the core features first and then iterate on them.

If there are friends who want to join us, I welcome them. I am willing to listen to everyone’s opinions and promote the development of Cocker in a democratic and orderly way. Contact information I will let xiaobian at the end of the article, the need of small partners please to the end of the article.

Is Cocker currently in production environment?

Many of my open source projects (Logpipe, FasterJSON, FasterHTTP, tcpDaemon, iLOG3, G6, etc.) have matured rapidly through the experience of a production environment in the industry. Cocker doesn’t have an actual project in use yet, which is what worries me the most.

Several companies have asked about the possibility of promoting the commercialization of Cocker, and industry organizations have called to discuss the future development direction of Cocker. In the financial system, I have deeply felt the strong requirements of national regulatory bodies for independent and controllable core technology in recent years, and the banking industry is very vocal about IOE. There is no domestic container engine (except Ali Pouch), and domestic container cloud manufacturers almost fork foreign products to provide services. In my opinion, domestic and independent products can be used as the starting point, but of course, products must be stable and reliable.

For example, vue. js has a good developer ecosystem both at home and abroad. Do you plan to establish a cocker-related developer ecosystem, or do you plan to fight on your own?

As mentioned above, I want to make the second-phase scheduling engine first, and then invite everyone to participate in the iterative improvement after the core backbone is roughly complete, otherwise it will be difficult to coordinate.

Cocker will stick to the open source and community route. This is exactly where the domestic community is pushing the open source container technology gap. Alpouch is the open source route pushed by commercial companies.

What are Cocker’s development plans for 2019?

Three goals are planned for 2019: complete core features, complete the evolution of personal drive into community, and experience the first actual project.

As for Cocker Store, it will definitely be built after the confirmation of the actual project, because it is a very important link to promote communication and promotion.

From your personal perspective, how do you see the open source ecosystem in China?

For open source people, we can’t get around the living environment of domestic technical people. Now, China insists on open source, and we can give up many important things for technology. But ideal ideal, really through open source to achieve their own “goals” of little, so I advise you not to neglect their own work, with a certain income and position in order to better engaged in open source, help others. After all, the domestic environment is not enough to support the open source ideals of technical people.

For domestic open source projects, the domestic technical environment seems to have a prejudice against domestic open source projects: firstly, most of the domestic tend to the application development with quick results and high returns, and there are few talents who can specialize in core technologies, naturally, there are few original excellent works. Secondly, due to the technical environment, individuals cannot support lasting energy and capital investment. Small companies are busy to survive, while large companies do not have the sincere idea of open source sharing, so it is normal for them to fail at the end. This prejudice once formed atmosphere, seriously suppressed the vitality of China’s original open source. I remember a certain Alidanu wrote a book that said, “When a domestic open source project comes out, people will laugh at it and encourage it. When a foreign open source project comes out, no matter whether it is good or not, people will lick it first.” With the strong support of open source China for domestic open source in recent years, many excellent works have emerged. This year’s domestic open source project selection has a wide influence and gives enthusiastic feedback to more and more works. I hope that with the gradual improvement of China’s technical environment, this kind of atmosphere can be changed.

For architects, some of them are actually just proficient users of foreign mainstream software. When talking about Docker and K8S, they are always proud to be proficient in Spring Cloud when talking about communication activities. Recently, Fink came out, and I am proud of it. Few people out of curiosity to build a better “wheel” at the beginning of the (innovation), please describe the basis of distributed architecture Raft, Paxos algorithm process rather than when it comes to name every time, please describe the design and development of high performance logging library behind knowledge of computer architecture, some architecture can use technology to solve problems, It is better to solve some technical problems with architecture. It is not a dinner party to engage in technology, but to really calm down and remove impetuous. Those real masters have been working in a certain field for ten years, and they are low-key and you don’t even know their name, but their thoughtful code is indispensable to your daily work and life.

For open source costs, some companies think that the use of open source projects can copyright to slash spending, this is a kind of the idea of not enough depth, if technical managers on open pit, will understand the importance of independent control, if the company to control the risks of using open source software, or a long-term open source support team to be formed, or if not a problem ok, In the event of a production problem, it is left to chance without a team familiar with the control of open source code, which is also responsible for auditing malicious code in case of Christmas Snow.

When it comes to entrepreneurship and investment, capitalists are smarter than technologists at understanding the benefits of technology, the investment cycle that people pursue, not the ultimate success of your project, to say the least.

Finally, I would like to thank OSOURCE China for giving me an opportunity to introduce myself, for providing an interactive platform for domestic technicians to learn and communicate, and for providing powerful and free source hosting service (I have more than 40 open source projects on it). I wish Osource China better and better. Believe that a truly great product should give every user a button to ridicule. I love the taste of open source, the joy of sharing, and the achievement of helping others with my ability.

At the end of the interview, Li Hua told me that the spring recruitment of Bank of Hangzhou in 2019 has already started, and the infrastructure team of information Technology Department is in urgent need of C/JAVA technology experts and architects. If you are considering changing your job after the New Year, you can find more information on the official website of Bank of Hangzhou recruitment. The job search keyword is “software development position (architecture design direction)”. The infrastructure team is a great team that loves technology. We hope to build the future of fintech together with you.

This interview is over. If you have any questions or questions you want to discuss, please leave them in the comments section.

  • Code cloud address: gitee.com/calvinwilli…
  • Github:github.com/calvinwilli…
  • Email:[email protected]