Skip to content

Commit

Permalink
Vesion 0.4.2 (vmware#70)
Browse files Browse the repository at this point in the history
- wait for network to be available
- fix issue when creating Ubuntu template and DHCP is not available
- installation of go, glide and download of harbor is commented out until future usage
- fixed amqp connection issue
- create amqp exchange during the install if necessary
- upgrade to kubernetes 1.9.3 in ubuntu
- improved guest password configuration. It is recommended to set new password in the templates in `config.yaml` and re-create the templates
- updated dependencies
- this version of the PhotonOS template doesn't upgrade the OS to the latest version, since there is a problem with the latest version of `open-vm-tools`
- updated license files
- improved installation and validation of the AMQP settings

Signed-off-by: Paco Gomez <contact@pacogomez.com>
  • Loading branch information
pacogomez authored Feb 15, 2018
1 parent 19154ad commit 3a77f22
Showing 14 changed files with 378 additions and 140 deletions.
138 changes: 128 additions & 10 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,109 @@
container-service-extension
LICENSE

Copyright 2017 VMware, Inc. All rights reserved
container-service-extension 1.0 GA

The BSD-2 license (the 'License') set forth below applies to all parts of the
container-service-extension project. You may not use this file except in compliance
with the License.
Copyright 2018 VMware, Inc. All rights reserved.

The BSD-2 license (the “License”) set forth below applies to all parts of the container-service-extension 1.0
project. You may not use this file except in compliance with the License. 

BSD-2 License

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
• Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
• Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

===========================================================================

container-service-extension 1.0 includes a number of components with separate copyright notices and license terms. This product does not necessarily use all the open source components referred to below. Your use of the source code for these components is subject to the terms and conditions of the following licenses.

=============== TABLE OF CONTENTS =============================

The following is a listing of the open source components
detailed in this document. This list is provided for your
convenience; please read further if you wish to review
the copyright notice(s) and the full text of the license
associated with each component.


SECTION 1: BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES

>>> cachetools-2.0.1
>>> humanfriendly-4.8
>>> pika-0.11.0


--------------- SECTION 1: BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES ----------

BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES are applicable to the following component(s).


>>> cachetools-2.0.1

The MIT License (MIT)

Copyright (c) 2014-2017 Thomas Kemmer

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


>>> humanfriendly-4.8

Copyright (c) 2018 Peter Odding

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


>>> pika-0.11.0

Copyright (c) 2009-2017, Tony Garnock-Jones, Gavin M. Roy, Pivotal and others.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Pika project nor the names of its contributors may be used
to endorse or promote products derived from this software without specific
prior written permission.

in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
@@ -27,3 +114,34 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


ADDITIONAL LICENSE INFORMATION:

> BSD

pika-0.11.0.tar.gz\dist\pika-0.11.0.tar\pika-0.11.0\setup.py

License :: OSI Approved :: BSD License



======================================================================

To the extent any open source components are licensed under the GPL
and/or LGPL, or other similar licenses that require the source code
and/or modifications to source code to be made available (as would be
noted above), you may obtain a copy of the source code corresponding to
the binaries for such open source components and modifications thereto,
if any, (the "Source Files"), by downloading the Source Files from
VMware's website at http://www.vmware.com/download/open_source.html, or
by sending a request, with your name and address to: VMware, Inc., 3401
Hillview Avenue, Palo Alto, CA 94304, United States of America. All such
requests should clearly specify: OPEN SOURCE FILES REQUEST, Attention
General Counsel. VMware shall mail a copy of the Source Files to you on
a CD or equivalent physical medium. This offer to obtain a copy of the
Source Files is valid for three years from the date you acquired this
Software product. Alternatively, the Source Files may accompany the
VMware service.

[CONTAINERSERVICEEXTENSION10GAVS020618]
12 changes: 4 additions & 8 deletions NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
container-service-extension
container-service-extension 1.0 GA

Copyright 2017 VMware, Inc. All Rights Reserved.
Copyright (c) 2018 VMware, Inc. All Rights Reserved.

This product is licensed to you under the BSD-2 license (the "License").
You may not use this product except in compliance with the BSD-2 License.
This product is licensed to you under the BSD-2 license (the "License"). You may not use this product except in compliance with the BSD-2 License.

This product may include a number of subcomponents with separate copyright
notices and license terms.
Your use of these subcomponents is subject to the terms and conditions of
the subcomponent's license, as noted in the LICENSE file.
This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file.
2 changes: 1 addition & 1 deletion container_service_extension/broker.py
Original file line number Diff line number Diff line change
@@ -99,7 +99,7 @@
'admin_password':
'guest_os_admin_password',
'description':
'Ubuntu 16.04\nDocker 17.12.0~ce\nKubernetes 1.9.1\nweave 2.1.3'
'Ubuntu 16.04\nDocker 17.12.0~ce\nKubernetes 1.9.3\nweave 2.1.3'
}

SAMPLE_CONFIG = {
5 changes: 4 additions & 1 deletion container_service_extension/client/cluster.py
Original file line number Diff line number Diff line change
@@ -23,7 +23,10 @@ def _process_response(self, response):
message = obj.get('message')
raise Exception(message)
decoded = response.content.decode("utf-8")
content = json.loads(decoded)
if len(decoded) > 0:
content = json.loads(decoded)
else:
content = {}
if response.status_code in [
requests.codes.ok, requests.codes.created,
requests.codes.accepted
59 changes: 31 additions & 28 deletions container_service_extension/cluster.py
Original file line number Diff line number Diff line change
@@ -115,20 +115,21 @@ def add_nodes(qty, template, node_type, config, client, org, vdc, vapp, body):
then
""" # NOQA
cust_script_common = ''
if 'ssh_key' in body:
cust_script_end = \
"""
fi
""" # NOQA
if 'ssh_key' in body and body['ssh_key'] is not None:
cust_script_common += \
"""
mkdir -p /root/.ssh
echo '{ssh_key}' >> /root/.ssh/authorized_keys
chmod -R go-rwx /root/.ssh
""".format(ssh_key=body['ssh_key']) # NOQA
cust_script_end = \
"""
fi
""" # NOQA
cust_script = cust_script_init
cust_script += cust_script_common
cust_script += cust_script_end
if cust_script_common is '':
cust_script = None
else:
cust_script = cust_script_init + cust_script_common + cust_script_end
for n in range(qty):
name = None
while True:
@@ -144,9 +145,10 @@ def add_nodes(qty, template, node_type, config, client, org, vdc, vapp, body):
'target_vm_name': name,
'hostname': name,
'network': body['network'],
'ip_allocation_mode': 'pool',
'cust_script': cust_script
'ip_allocation_mode': 'pool'
}
if cust_script is not None:
spec['cust_script'] = cust_script
if storage_profile is not None:
spec['storage_profile'] = storage_profile
specs.append(spec)
@@ -177,16 +179,14 @@ def add_nodes(qty, template, node_type, config, client, org, vdc, vapp, body):
vapp.reload()
for spec in specs:
vm_resource = vapp.get_vm(spec['target_vm_name'])
script = \
"""#!/usr/bin/env bash
echo "root:{password}" | chpasswd
""".format(password=template['admin_password']) # NOQA
command = '/bin/echo "root:{password}" | chpasswd'.format(
password=template['admin_password'])
nodes = [vm_resource]
execute_script_in_nodes(
config,
vapp,
password,
script,
command,
nodes,
check_tools=True,
wait=False)
@@ -226,6 +226,7 @@ def get_init_info(config, vapp, password):


def get_master_ip(config, vapp, template):
LOGGER.debug('getting master IP for vapp: %s' % vapp.resource.get('name'))
script = \
"""#!/usr/bin/env bash
ip route get 1 | awk '{print $NF;exit}'
@@ -238,7 +239,10 @@ def get_master_ip(config, vapp, template):
script,
nodes,
check_tools=False)
return result[0][1].content.decode().split()[0]
master_ip = result[0][1].content.decode().split()[0]
LOGGER.debug('getting master IP for vapp: %s, ip: %s' %
(vapp.resource.get('name'), master_ip))
return master_ip


def get_cluster_config(config, vapp, password):
@@ -337,8 +341,8 @@ def execute_script_in_nodes(config,
vs.wait_until_tools_ready(
vm, sleep=5, callback=wait_for_tools_ready_callback)
wait_until_ready_to_exec(vs, vm, password)
LOGGER.debug('about to execute script on %s, wait=%s' %
(node.get('name'), wait))
LOGGER.debug('about to execute script on %s (vm=%s), wait=%s' %
(node.get('name'), vm, wait))
if wait:
result = vs.execute_script_in_guest(
vm,
@@ -354,16 +358,15 @@ def execute_script_in_nodes(config,
result_stdout = result[1].content.decode()
result_stderr = result[2].content.decode()
else:
result = vs.execute_script_in_guest(
vm,
'root',
password,
script,
target_file=None,
wait_for_completion=False,
get_output=False,
delete_script=False,
callback=wait_for_guest_execution_callback)
result = [
vs.execute_program_in_guest(
vm,
'root',
password,
script,
wait_for_completion=False,
get_output=False)
]
result_stdout = ''
result_stderr = ''
LOGGER.debug(result[0])
Loading

0 comments on commit 3a77f22

Please sign in to comment.