- Notifications
You must be signed in to change notification settings - Fork135
ops - build and run nanos unikernels
License
nanovms/ops
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Ops is a tool for creating and running aNanos unikernel. It is used topackage, create, and run your application as ananos unikernel instance.
Check out theDOCS.
Most users should just download the binary from the website:
curl https://ops.city/get.sh -sSfL| sh
If you don't like this option you can also download pre-made packagesfor various systemshere and you can alsobuild from source.
Operating System | Download |
---|---|
macOS | ![]() |
Windows | ![]() |
Add the repo & install:
brew tap nanovms/homebrew-ops
brew install nanovms/ops/ops
See theformula file for details.
Add a deb src:
sudo vi /etc/apt/sources.list.d/fury.list
deb [trusted=yes] https://apt.fury.io/nanovms/ /
Update your sources && install:
sudo apt-get update && sudo apt-get install ops
Building from source is easy if you have used Go before.
This program requires GO Version 1.13.x or greater.
Installing from source follows these general steps:
Install dependencies:
make deps
Build:
make build
macOS notes:
GO111MODULE=on go build -ldflags"-w"
For protobufs/grpc we usehttps://buf.build/ .
To generate protobufs (but do not check in to vcs):
make generate
Fordetailed instructions, please consult the documentation.
Before learning more aboutops
it is a good idea to see some basic usageexamples. Below are links to simple examples using various programming platforms:
Let's run your first unikernel right now.
Throw this into hi.js:
consthttp=require('http');http.createServer((req,res)=>{res.writeHead(200,{'Content-Type':'text/plain'});res.end('Hello World\n');}).listen(8083,"0.0.0.0");console.log('Server running at http://127.0.0.1:8083/');
Then you can run it like so:
ops pkg load eyberg/node:v16.5.0 -p 8083 -n -a hi.js
Note: Since the node package is inside the unikernel you do not need toinstall node locally to use it.
Want to push your app out to the cloud? No complex orchestration likeK8S is necessary. OPS pushes all the orchestration onto the cloudprovider of choice so you don't need to manage anything. Be sure to trythis out as the next step after running a hello world locally as it willanswer many questions you might have.
You can find many more pre-made packages at the public repo:
Or via the shell:
ops pkg list
You can also upload your own with a free account.
Languages:
Various langauge examples can be found athttps://github.com/nanovms/ops-examples.In generalhttps://nanos.org supports any languages and is notlanguage specific.
You can find more examples and tutorial on youtube as well:
https://www.youtube.com/channel/UC3mqDqCVu3moVKzmP2YNmlg
OPS started out as a daemon-less cli tool to build and run unikernelslocally and to also interact with the various clouds. We will keep thatfunctionality as-is, however, ops can also run as a daemon locally forsoftware that is a composition of multiple services. The daemon expectsto have elevated privileges (currently via suid bit) in order to placethe various programs on their class c network (vs relying on user-mode).This is not necessary for 'ops run', 'ops pkg load' or 'ops instancecreate' but only for multipl services ran locally that expect tocommunicate to each other vs just the host.
For now the daemon and 'ops instance create' share metadata but that isexpected to change in the future.
The Apple M1 and M2 are ARM based. OPS is built for users primarilydeploying to x86 based servers. We now have full support for runningnative ARM applications (ELFs) on M1 and M2s natively. That meanswithout relying on Rosetta and with full hardware acceleration.
Be aware that if you wish to deploy your applications to x86 serversyou'll need to re-build your images as x86 versus the default of arm64.
ops build <app>
ops run<app># orops run -p<port><app>
ops run -p<port> -c<file><app>
To enable setops_render_config
totrue
. Both${ENV_VAR}
and$ENV_VAR
are supported.
ops_render_config=true ops run -p<port> -c<file><app># orexport ops_render_config=trueops run -p<port> -c<file><app>
{"Args":["--user","${USER}","--password","$PASSWORD" ],"Dirs":["myapp/static"]}
OPS config files are plain JSON, below is an example.
{"Args":["one","two"],"Dirs":["myapp/static"]}
New users wishing to play around in a dev environment are encouraged touse the default user-mode networking. Other production users areencouraged to utilize native cloud builds such asGoogleCloud whichhandle networking for you.
Only advanced/power users should use the bridge networking option.
The following environment variables are available to you
ops_render_config
- Set totrue
to use Golang ENV var interpolation to render your JSON configs.
Feel free to open up a pull request. It's helpful to have your OPSversion and the release channel you are using.
Also, if it doesn't work on the main release, then you can try the nightly.The main release can tail the nightly by many weeks sometimes.
ops version
If you are using a package, get the package hash:
jq'."gnatsd_1.4.1"'~/.ops/packages/manifest.json
If you have an idea for a new feature and it might take longer than afew hours or days to complete, then it's worth opening a feature request ticket toideate it first before jumping into code. There might be someone alreadyworking on the feature or plans to do something entirely different.
Feel free to email security[at]nanovms[dot]com.
If you are having trouble running a particular application please feelfree to open an issue and we can take a look. In general we'll only wantto support the latest release from a given application/project, however,if you really want/need support for something older there are paidsupport plans available - contact the folks athttps://nanovms.com.
If you need email support you will need to sign up for a support plan.
About
ops - build and run nanos unikernels