Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Use runnc directly #53

Open
ricarkol opened this issue Nov 24, 2018 · 6 comments
Open

Use runnc directly #53

ricarkol opened this issue Nov 24, 2018 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@ricarkol
Copy link
Contributor

ricarkol commented Nov 24, 2018

Trying to use runnc without going through docker, and getting this:

# ls /tmp/hello/
test_hello.nabla

# cat config.json 
{
	"ociVersion": "1.0.0",
	"process": {
		"terminal": false,
		"user": {
			"uid": 0,
			"gid": 0
		},
		"args": [
			"/test_hello.nabla"
		],
		"env": [
			"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
			"TERM=xterm"
		],
		"cwd": "/"
	},
	"root": {
		"path": "/tmp/hello",
		"readonly": true
	}
}

# runnc create abcd1234123asdfasd2
# runnc start abcd1234123asdfasd2
Running with args: [/opt/runnc/bin/runnc-cont -k8s -nabla-run /opt/runnc/bin/nabla-run -tap tapabcd1234123a -cwd / -volume /run/runnc/abcd1234123asdfasd2/rootfs.iso:/ -unikernel /tmp/hello/test_hello.nabla -env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -env TERM=xterm --]root@nabla5:~/go/src/github.com/nabla-containers/runnc# Could not create tapabcd1234123a: no master interface: Link not found
@ricarkol
Copy link
Contributor Author

ricarkol commented Nov 24, 2018

Why is it running runnc-cont with -k8s? Removing the -k8s allows one to run runnc directly.

@lumjjb
Copy link
Member

lumjjb commented Nov 25, 2018

The -k8s flag is mainly to handle the networking stuff.

In regular containers, if run directly, there would not be a network interface configured.

What would the default behavior for network be for rumprun that would be valid?

@lumjjb
Copy link
Member

lumjjb commented Nov 26, 2018

Since networking is not the job for the runnc binary, one possible idea is to use prestart hooks to set up a dummy network:

{
	"ociVersion": "1.0.0",
	"process": {
		"terminal": false,
		"user": {
			"uid": 0,
			"gid": 0
		},
		"args": [
			"/test_hello.nabla"
		],
		"env": [
			"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
			"TERM=xterm"
		],
		"cwd": "/"
	},
	"root": {
		"path": "/tmp/hello",
		"readonly": true
	},
        "hooks": {
                "prestart": [
		{
			"path": "/sbin/ip",
			"args": ["ip", "link", "add" , "eth0", "type", "dummy"]
		},
		{
			"path": "/sbin/ip",
			"args": ["ip", "addr", "add", "10.0.0.251/8", "dev", "eth0"]
		},
		{
			"path": "/sbin/ip",
			"args": ["ip", "link", "set", "eth0", "up"]
		},
		{
			"path": "/sbin/ip",
			"args": ["ip", "route", "add", "default", "via", "10.0.0.251"]
		}
		]
        }
}

@lumjjb
Copy link
Member

lumjjb commented Nov 26, 2018

TODO: if runnc-cont detects that there isnt a master IP, just create the TAP with no config and don’t pass in any NIC information into rump should work.

@lumjjb lumjjb self-assigned this Nov 26, 2018
@lumjjb lumjjb added the enhancement New feature or request label Nov 26, 2018
@ricarkol
Copy link
Contributor Author

This is fixed right?

@lumjjb
Copy link
Member

lumjjb commented Feb 26, 2019

Not yet - this is still a dummy network, it would not be able to run node still for example. We need a flag to have a --standalone-network option.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants