UniK uses Rumprun as a platform for compiling Go and C++ to unikernels.
Compiling Go on the rumprun platform requires the following parameters be met:
- Go installed and your
$GOPATHconfigured (see getting started with Go) - Your project should be located within your system's
$GOPATH(if you're unfamiliar with Go and the$GOPATHconvention, read more here) - One
mainpackage in the root directory of your project - Godeps installed (run
go get github.com/tools/godeponce Go is installed) - Run
GO15VENDOREXPERIMENT=1 godep save ./...from the root of your project. This will create aGodeps/Godeps.jsonfile as well as place all dependencies of your project in the./vendordirectory. This will allow UniK to compile your application entirely using only the root directory of your project.
Compiling Nodejs applications on rumprun requires the following parameters be met:
- One "main" file somewhere in your project
- All dependencies already installed to
node_moduleswithnpm install - A configuration file named
manifest.yamlin the root directory of your project.-
the
manifest.yamlfile should contain a single line of text like so:main_file: YOUR_MAIN_FILE.js runtime_args: "optional string of node arguments"
where you replace
YOUR_MAIN_FILE.jswith the relative path to your main file from the root directory of your project.for example, if your project has the following structure:
$ tree myproject/ ./myproject/ ├── manifest.yaml ├── node_modules │ └── httpdispatcher │ ├── README.md │ ├── httpdispatcher.js │ ├── node_modules │ │ └── mime │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build │ │ │ ├── build.js │ │ │ └── test.js │ │ ├── cli.js │ │ ├── mime.js │ │ ├── package.json │ │ └── types.json │ └── package.json └── server.jsyour
manifest.yamlshould read:main_file: server.js
or
main_file: ./server.js
and runtime_args is an optional string of options to pass to the node interpreter
See example node project for an example of what a Node.js project should look like.
-
Compiling Python applications on rumprun requires the following parameters be met:
- One "main" file somewhere in your project
- All dependencies installed locally to the root directory of your project.
- This can be done by running the following command for each module your project depends on:
pip install --install-option="--prefix=<PATH_TO_PROJECT_ROOT>" --ignore-installed <MODULE_NAME>
- This can be done by running the following command for each module your project depends on:
- A configuration file named
manifest.yamlin the root directory of your project.-
the
manifest.yamlfile should contain a single line of text like so:main_file: YOUR_MAIN_FILE.py runtime_args: "optional string of python runtime arguments"
where you replace
YOUR_MAIN_FILE.pywith the relative path to your main file from the root directory of your project.for example, if your project has the following structure:
$ tree myproject/ . ├── bin │ └── bottle.py ├── lib │ └── python3.5 │ └── site-packages │ ├── __pycache__ │ │ └── bottle.cpython-35.pyc │ ├── bottle-0.12.9-py3.5.egg-info │ │ ├── PKG-INFO │ │ ├── SOURCES.txt │ │ ├── dependency_links.txt │ │ ├── installed-files.txt │ │ └── top_level.txt │ └── bottle.py ├── manifest.yaml └── server.pyyour
manifest.yamlshould read:main_file: server.py
or
main_file: ./server.py
and runtime_args is an optional string of options to pass to the python interpreter
See example python project for an example of what a Python3 project should look like.
-
Compiling Java applications on rumprun requires the following parameters to be met:
-
Application compiled to a fat
.jaror.warfile -
A configuration file named
manifest.yamlin the root directory of your project.- the
manifest.yamlfile should contain a single line of text like so:
main_file: PATH_TO_MAIN_JAR.jar runtime_args: "optional string of JVM arguments"
where PATH_TO_MAIN_JAR.jar is the path to your main .jar or .war file relative to the project directory
and runtime_args is an optional string of arguments to pass to the JVM at runtime. Useful for setting properties and other language-level arguments.
- the
C/C++ support coming soon!