github.com/emc-advanced-dev/unik@v0.0.0-20190717152701-a58d3e8e33b7/docs/compilers/rump.md (about) 1 # Rumprun Unikernels 2 3 UniK uses Rumprun as a platform for compiling Go and C++ to unikernels. 4 5 --- 6 7 ### Golang 8 Compiling Go on the rumprun platform requires the following parameters be met: 9 * **Go** installed and your `$GOPATH` configured (see [getting started with Go](https://golang.org/doc/install)) 10 * Your project should be located within your system's `$GOPATH` (if you're unfamiliar with Go and the `$GOPATH` convention, read more [here](http://stackoverflow.com/questions/7970390/what-should-be-the-values-of-gopath-and-goroot)) 11 * One `main` package in the root directory of your project 12 * [Godeps](https://github.com/tools/godep) installed (run `go get github.com/tools/godep` once Go is installed) 13 * Run `GO15VENDOREXPERIMENT=1 godep save ./...` from the root of your project. This will create a `Godeps/Godeps.json` file as well as place all dependencies of your project in the `./vendor` directory. This will allow UniK to compile your application entirely using only the root directory of your project. 14 15 --- 16 17 ### Node.js 18 Compiling Nodejs applications on rumprun requires the following parameters be met: 19 * One "main" file somewhere in your project 20 * All dependencies already installed to `node_modules` with `npm install ` 21 * A configuration file named `manifest.yaml` in the root directory of your project. 22 * the `manifest.yaml` file should contain a single line of text like so: 23 ```yaml 24 main_file: YOUR_MAIN_FILE.js 25 runtime_args: "optional string of node arguments" 26 ``` 27 where you replace `YOUR_MAIN_FILE.js` with the relative path to your main file from the root directory of your project. 28 29 for example, if your project has the following structure: 30 ``` 31 $ tree myproject/ 32 ./myproject/ 33 ├── manifest.yaml 34 ├── node_modules 35 │ └── httpdispatcher 36 │ ├── README.md 37 │ ├── httpdispatcher.js 38 │ ├── node_modules 39 │ │ └── mime 40 │ │ ├── LICENSE 41 │ │ ├── README.md 42 │ │ ├── build 43 │ │ │ ├── build.js 44 │ │ │ └── test.js 45 │ │ ├── cli.js 46 │ │ ├── mime.js 47 │ │ ├── package.json 48 │ │ └── types.json 49 │ └── package.json 50 └── server.js 51 ``` 52 your `manifest.yaml` should read: 53 ```yaml 54 main_file: server.js 55 ``` 56 or 57 ```yaml 58 main_file: ./server.js 59 ``` 60 61 and runtime_args is an optional string of options to pass to the node interpreter 62 63 See [example node project](../examples/example-nodejs-app) for an example of what a Node.js project should look like. 64 65 --- 66 67 ### Python 3 68 69 70 Compiling Python applications on rumprun requires the following parameters be met: 71 * One "main" file somewhere in your project 72 * All dependencies installed locally to the root directory of your project. 73 * This can be done by running the following command for each module your project depends on: 74 ``` 75 pip install --install-option="--prefix=<PATH_TO_PROJECT_ROOT>" --ignore-installed <MODULE_NAME> 76 ``` 77 * A configuration file named `manifest.yaml` in the root directory of your project. 78 * the `manifest.yaml` file should contain a single line of text like so: 79 ```yaml 80 main_file: YOUR_MAIN_FILE.py 81 runtime_args: "optional string of python runtime arguments" 82 ``` 83 where you replace `YOUR_MAIN_FILE.py` with the relative path to your main file from the root directory of your project. 84 85 for example, if your project has the following structure: 86 ``` 87 $ tree myproject/ 88 . 89 ├── bin 90 │ └── bottle.py 91 ├── lib 92 │ └── python3.5 93 │ └── site-packages 94 │ ├── __pycache__ 95 │ │ └── bottle.cpython-35.pyc 96 │ ├── bottle-0.12.9-py3.5.egg-info 97 │ │ ├── PKG-INFO 98 │ │ ├── SOURCES.txt 99 │ │ ├── dependency_links.txt 100 │ │ ├── installed-files.txt 101 │ │ └── top_level.txt 102 │ └── bottle.py 103 ├── manifest.yaml 104 └── server.py 105 ``` 106 your `manifest.yaml` should read: 107 ```yaml 108 main_file: server.py 109 ``` 110 or 111 ```yaml 112 main_file: ./server.py 113 ``` 114 115 and runtime_args is an optional string of options to pass to the python interpreter 116 117 See [example python project](../examples/example-python3-httpd) for an example of what a Python3 project should look like. 118 119 --- 120 121 ### Java 122 123 Compiling Java applications on rumprun requires the following parameters to be met: 124 * Application compiled to a fat `.jar` or `.war` file 125 * A configuration file named `manifest.yaml` in the root directory of your project. 126 * the `manifest.yaml` file should contain a single line of text like so: 127 ```yaml 128 main_file: PATH_TO_MAIN_JAR.jar 129 runtime_args: "optional string of JVM arguments" 130 ``` 131 where PATH_TO_MAIN_JAR.jar is the path to your main .jar or .war file relative to the project directory 132 133 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. 134 135 --- 136 137 ### C/C++ 138 139 C/C++ support coming soon!