Merge pull request #95 from GNS3/docker

Docker container support
This commit is contained in:
Jeremy Grossmann 2016-05-11 12:57:30 -06:00
commit 63d8d67aa1
8 changed files with 157 additions and 65 deletions

17
appliances/chromium.gns3a Normal file
View File

@ -0,0 +1,17 @@
{
"name": "Chromium",
"category": "guest",
"description": "The chromium browser",
"vendor_name": "Chromium",
"vendor_url": "http://openvswitch.org/",
"product_name": "Chromium",
"registry_version": 3,
"status": "stable",
"maintainer": "GNS3 Team",
"maintainer_email": "developers@gns3.net",
"docker": {
"adapters": 1,
"console_type": "vnc",
"image": "gns3/chromium"
}
}

19
appliances/ntopng.gns3a Normal file
View File

@ -0,0 +1,19 @@
{
"name": "ntopng",
"category": "guest",
"description": "ntopng is the next generation version of the original ntop, a network traffic probe that shows the network usage, similar to what the popular top Unix command does. ntopng is based on libpcap and it has been written in a portable way in order to virtually run on every Unix platform, MacOSX and on Windows as well. ntopng users can use a a web browser to navigate through ntop (that acts as a web server) traffic information and get a dump of the network status. In the latter case, ntopng can be seen as a simple RMON-like agent with an embedded web interface.",
"vendor_name": "ntop",
"vendor_url": "http://www.ntop.org/",
"product_name": "ntopng",
"registry_version": 3,
"status": "stable",
"maintainer": "GNS3 Team",
"maintainer_email": "developers@gns3.net",
"docker": {
"adapters": 1,
"console_type": "http",
"console_http_port": 3000,
"console_http_path": "/",
"image": "lucaderi/ntopng-docker:latest"
}
}

View File

@ -0,0 +1,17 @@
{
"name": "OpenDaylight",
"category": "router",
"description": "OpenDaylight is an open source SDN controller",
"vendor_name": "OpenDaylight foundation",
"vendor_url": "https://www.opendaylight.org",
"documentation_url": "https://www.opendaylight.org/start",
"product_name": "OpenDaylight",
"registry_version": 3,
"status": "stable",
"maintainer": "GNS3 Team",
"maintainer_email": "developers@gns3.net",
"docker": {
"adapters": 1,
"image": "opendaylight/odl"
}
}

View File

@ -0,0 +1,19 @@
{
"name": "Open vSwitch management",
"category": "multilayer_switch",
"description": "Open vSwitch is a production quality, multilayer virtual switch licensed under the open source Apache 2.0 license. It is designed to enable massive network automation through programmatic extension, while still supporting standard management interfaces and protocols (e.g. NetFlow, sFlow, IPFIX, RSPAN, CLI, LACP, 802.1ag). In addition, it is designed to support distribution across multiple physical servers similar to VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V. This is a version of the appliance with a management interface on eth0.",
"vendor_name": "Open vSwitch",
"vendor_url": "http://openvswitch.org/",
"documentation_url": "http://openvswitch.org/support/",
"product_name": "Open vSwitch",
"registry_version": 3,
"status": "stable",
"maintainer": "GNS3 Team",
"maintainer_email": "developers@gns3.net",
"usage": "The eth0 is the management interface. By default all other interfaces are connected to the br0",
"docker": {
"adapters": 16,
"image": "gns3/openvswitch",
"environment": "MANAGEMENT_INTERFACE=1"
}
}

View File

@ -3,37 +3,16 @@
"category": "multilayer_switch",
"description": "Open vSwitch is a production quality, multilayer virtual switch licensed under the open source Apache 2.0 license. It is designed to enable massive network automation through programmatic extension, while still supporting standard management interfaces and protocols (e.g. NetFlow, sFlow, IPFIX, RSPAN, CLI, LACP, 802.1ag). In addition, it is designed to support distribution across multiple physical servers similar to VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V.",
"vendor_name": "Open vSwitch",
"vendor_url": "http://openvswitch.net/",
"documentation_url": "http://openvswitch.net/support",
"vendor_url": "http://openvswitch.org/",
"documentation_url": "http://openvswitch.org/support/",
"product_name": "Open vSwitch",
"registry_version": 1,
"registry_version": 3,
"status": "stable",
"maintainer": "GNS3 Team",
"maintainer_email": "developers@gns3.net",
"qemu": {
"adapter_type": "e1000",
"adapters": 24,
"ram": 128,
"arch": "x86_64",
"console_type": "telnet",
"kvm": "allow"
},
"images": [
{
"filename": "openvswitch-3.16.6-tinycore64.img",
"version": "3.16.6",
"md5sum": "88b777ef930c1a3849b6a40c0d3fd102",
"filesize": 70254592,
"download_url": "https://sourceforge.net/projects/gns-3/files/Qemu%20Appliances/",
"direct_download_url": "http://downloads.sourceforge.net/project/gns-3/Qemu%20Appliances/openvswitch-3.16.6-tinycore64.img"
}
],
"versions": [
{
"name": "3.16.6",
"images": {
"hda_disk_image": "openvswitch-3.16.6-tinycore64.img"
}
}
]
"usage": "By default all interfaces are connected to the br0",
"docker": {
"adapters": 16,
"image": "gns3/openvswitch"
}
}

View File

@ -35,26 +35,27 @@ def check_appliance(appliance):
appliance_json = json.load(f)
jsonschema.validate(appliance_json, schema)
for image in appliance_json['images']:
if image['filename'] in images:
print('Duplicate image filename ' + image['filename'])
sys.exit(1)
if image['md5sum'] in md5sums:
print('Duplicate image md5sum ' + image['md5sum'])
sys.exit(1)
images.add(image['filename'])
md5sums.add(image['md5sum'])
for version in appliance_json['versions']:
for image in version['images'].values():
found = False
for i in appliance_json['images']:
if i['filename'] in image:
found = True
if not found:
print('Missing relation ' + i['filename'] + ' ' + ' in ' + appliance)
if 'images' in appliance_json:
for image in appliance_json['images']:
if image['filename'] in images:
print('Duplicate image filename ' + image['filename'])
sys.exit(1)
if image['md5sum'] in md5sums:
print('Duplicate image md5sum ' + image['md5sum'])
sys.exit(1)
images.add(image['filename'])
md5sums.add(image['md5sum'])
for version in appliance_json['versions']:
for image in version['images'].values():
found = False
for i in appliance_json['images']:
if i['filename'] in image:
found = True
if not found:
print('Missing relation ' + i['filename'] + ' ' + ' in ' + appliance)
sys.exit(1)
def check_packer(packer):

View File

@ -58,20 +58,22 @@ for appliance in glob.glob('appliances/*.gns3a'):
if isinstance(val, dict):
config[key] = OrderedDict(sorted(val.items(), key=lambda t: sort_key_using_schema(schema['properties'][key], t[0])))
images = []
for image in config['images']:
clean_urls(image)
images.append(OrderedDict(sorted(image.items(), key=lambda t: sort_key_using_schema(schema['properties']['images']['items'], t[0]))))
images = sorted(images, key=lambda t: t['version'], reverse=True)
config['images'] = images
if 'images' in config:
images = []
for image in config['images']:
clean_urls(image)
images.append(OrderedDict(sorted(image.items(), key=lambda t: sort_key_using_schema(schema['properties']['images']['items'], t[0]))))
images = sorted(images, key=lambda t: t['version'], reverse=True)
config['images'] = images
versions = []
for version in config['versions']:
version = OrderedDict(sorted(version.items(), key=lambda t: sort_key_using_schema(schema['properties']['versions']['items'], t[0])))
version['images'] = OrderedDict(sorted(version['images'].items(), key=lambda t: sort_key_using_schema(schema['properties']['versions']['items']['properties']['images'], t[0])))
versions.append(version)
versions = sorted(versions, key=lambda t: t['name'], reverse=True)
config['versions'] = versions
if 'versions' in config:
versions = []
for version in config['versions']:
version = OrderedDict(sorted(version.items(), key=lambda t: sort_key_using_schema(schema['properties']['versions']['items'], t[0])))
version['images'] = OrderedDict(sorted(version['images'].items(), key=lambda t: sort_key_using_schema(schema['properties']['versions']['items']['properties']['images'], t[0])))
versions.append(version)
versions = sorted(versions, key=lambda t: t['name'], reverse=True)
config['versions'] = versions
# Validate our changes
jsonschema.validate(config, schema)

View File

@ -55,7 +55,7 @@
"title": "An optional product url on vendor website"
},
"registry_version": {
"enum": [1, 2],
"enum": [1, 2, 3],
"title": "Version of the registry compatible with this appliance"
},
"status": {
@ -96,6 +96,46 @@
"title": "False if you don't want to use a single image for all nodes"
},
"docker": {
"type": "object",
"title": "Docker specific options",
"properties": {
"adapters": {
"type": "integer",
"title": "Number of ethernet adapters"
},
"image": {
"type": "string",
"title": "Docker image in the Docker Hub"
},
"start_command": {
"type": "string",
"title": "Command executed when the container start. Empty will use the default"
},
"environment": {
"type": "string",
"title": "One KEY=VAR environment by line"
},
"console_type": {
"enum": ["telnet", "vnc", "http", "https"],
"title": "Type of console connection for the administration of the appliance"
},
"console_http_port": {
"description": "Internal port in the container of the HTTP server",
"type": "integer"
},
"console_http_path": {
"description": "Path of the web interface",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"adapters",
"image"
]
},
"iou": {
"type": "object",
"title": "IOU specific options",
@ -400,8 +440,6 @@
"registry_version",
"status",
"maintainer",
"maintainer_email",
"images",
"versions"
"maintainer_email"
]
}