linux ops_使用OPS在现有Linux应用程序中运行Unikernels

linux ops

Unikernels are an emerging deployment pattern that engineers are choosing over Linux and Docker because of their performance, security and size. Researchers from NEC are reporting boot times in 5ms while other users talk about how small their VMs can get – in the kilobyte range if you’re using c. Still others like OSv have measured up to a 20% performance advantage in popular databases. However they have remained out of a lot of developers reach because of their low level nature.

Unikernels是一种新兴的部署模式,工程师们由于其性能,安全性和规模而选择了Linux和Docker。 NEC的研究人员正在报告启动时间(以5毫秒为单位),而其他用户则在谈论他们的VM可以达到多小-如果使用c,则在千字节范围内。 像OSv这样的其他工具在流行数据库中的性能优势也高达20%。 但是,由于它们的低级别特性,它们仍然超出了许多开发人员的范围。

That is until we decided to open source a tool called ops.city (OPS). OPS is a new free open source tool that allows anyone, including non-developers to instantly build and run unikernels on linux or mac from their existing software. There is no complicated re-compilation. There is no LDFLAG twiddling or random patching of various libraries you’d never patch yourself. OPS goal is to democratize access to unikernels.

直到我们决定开源一个名为ops.city(OPS)的工具。 OPS是一种新的免费开放源代码工具,它使任何人(包括非开发人员)都可以从Linux或Mac上通过其现有软件立即构建并运行unikernel。 没有复杂的重新编译。 没有您从未修补过的各种库的LDFLAG混乱或随机修补。 OPS的目标是使对Unikernel的访问民主化。

Ok – enough of that – let’s build some unikernels.

好的-足够了-让我们构建一些Unikernel。

First thing you’ll want to do is download ops itself:

您要做的第一件事就是下载ops本身:

curl https://ops.city/get.sh -sSfL | sh

卷曲https://ops.city/get.sh -sSfL | SH

Let’s start with a short example:

让我们从一个简短的示例开始:

Let’s create a working directory:

让我们创建一个工作目录:

mkdir p

mkdir p

Now put this into test.php:

现在将其放入test.php:

<?php

<?php

echo ‘test\n’;

回显'test \ n';

?>

?>

From a fresh install you’ll see that there are several pre-made packages available:

从全新安装,您将看到有几个预制的软件包可用:

Running Unikernels from Existing Linux Applications with OPS 1

Let’s go ahead and download the php package. The package contains everything that you’ll need to build and run php unikernels but absolutely nothing more. The idea is not to strip things out that aren’t necessary – it’s more of only putting things in to make it work. You’ll notice if you get into the tarball you’ll find an ELF file along with some libraries. This was built for linux but your application won’t actually run on linux. Linux is now 28 years old and predates both commercialized virtualization and what has become known as “the cloud” – namely Amazon Web Services and Google Cloud – both of which heavily use virtualization underneath.

让我们继续下载php软件包。 该软件包包含构建和运行php unikernels所需的一切,但绝对没有更多。 这样做的目的不是要剔除不必要的东西,而是要放一些东西使其正常工作。 您会发现,如果进入压缩包,您会发现一个ELF文件以及一些库。 这是为Linux构建的,但是您的应用程序实际上不会在Linux上运行。 Linux现在已有28年历史了,并且早于商业化虚拟化和所谓的“云”(即Amazon Web Services和Google Cloud),两者都在底层大量使用虚拟化。

Running Unikernels from Existing Linux Applications with OPS 2

Now if you run the example you’ll see that we boot up our php application and run the code but if you are paying attention you’ll see that this not like Linux where it starts hundreds of programs before it runs yours. Again this is more than just replacing the init manager and applying seccomp. We’ve tailored your application to become it’s own little operating system – how cool is that?

现在,如果您运行示例,您将看到我们启动了php应用程序并运行了代码,但是如果您注意的话,您会发现它与Linux不同,它在运行您的程序之前会启动数百个程序。 同样,这不仅仅是替换init管理器并应用seccomp。 我们为您量身定制了应用程序,使其成为自己的小型操作系统–那有多酷?

Let’s try another one – put this into test.js :

让我们尝试另一个-将其放入test.js:

console.log(“we are all crazy programmers!”);

console.log(“我们都是疯狂的程序员!”);

This time we’ll try out node.js:

这次,我们将尝试使用node.js:

Running Unikernels from Existing Linux Applications with OPS 3

It’s important to note that we’ve only showed some basic examples here. OPS is actually capable of loading and running arbitrary ELF binaries.

重要的是要注意,我们在这里仅显示了一些基本示例。 OPS实际上能够加载和运行任意ELF二进制文件。

If you are using docker or kubernetes now you’ll definitely want to pay attention and get involved early in the unikernel ecosystem. If you are a microservices aficionado or serverless fan you should also be paying attention as a lot of people are predicting this to be the underlying infrastructure for these paradigm changing technology growths.

如果您现在使用的是docker或kubernetes,则肯定要引起注意并尽早介入unikernel生态系统。 如果您是微服务的狂热者或无服务器爱好者,那么您也应该引起注意,因为很多人都预测这将成为这些范式不断变化的技术增长的基础架构。

So what are you going to build? Go check out https://github.com/nanovms/ops – fork/star the repo and let us know!

那你要建造什么? 去看看https://github.com/nanovms/ops – fork / star这个仓库,让我们知道!

翻译自: https://www.thecrazyprogrammer.com/2019/02/running-unikernels-from-existing-linux-applications-with-ops.html

linux ops

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值