summaryrefslogtreecommitdiffstats
path: root/apex
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2018-05-02 12:34:38 -0400
committerTim Rozet <trozet@redhat.com>2018-05-21 10:36:05 -0400
commitd2913d4bcc0fcd25dc3d01f6604049dfd0a9217d (patch)
tree5cf7a0d04cbf8b30488bb18ba7ee79e215f08e47 /apex
parent22bc385f5b2e25694699a614268aaad2fdacbb12 (diff)
Migrates master to use direct upstream
We now move master to deploy from upstream. That means we do not need to build undercloud/overcloud images anymore. Changes-Include: - Remove bash build scripts as we do not need to build anything other than the python package anymore - Remove building images or iso from build.py - Remove building of images and iso from Makefile - Rename/refactor deploy settings files for nosdn and odl. The new convention is that the typical scenario names we use will deploy master. We also support n-1 OS, so in that case we use the branch name for the "feature" in the scenario name: os-odl-queens-noha. - Tacker/Congress are disabled in settings files until we fix that with upstream. Containers are now enabled by default. - Disable TLS for undercloud (was changed upstream to default enabled) - Fix environments docker directory for master THT (was changed upstream) - Includes fix for LP#1768901 - Includes workaround for LP#1770692 - Moves to docker.io for container images as it is more stable and should contain the same images - Removes the term 'common' from apex packaging for referencing the Python Apex package Change-Id: If6b433860b3ff882686c78d0f24a2f0c52b9b57a Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'apex')
-rw-r--r--apex/build.py17
-rw-r--r--apex/builders/common_builder.py12
-rw-r--r--apex/builders/overcloud_builder.py2
-rw-r--r--apex/builders/undercloud_builder.py9
-rw-r--r--apex/common/constants.py14
-rw-r--r--apex/deploy.py3
-rw-r--r--apex/overcloud/deploy.py6
-rw-r--r--apex/tests/test_apex_common_builder.py2
-rw-r--r--apex/tests/test_apex_overcloud_deploy.py14
-rw-r--r--apex/undercloud/undercloud.py4
10 files changed, 49 insertions, 34 deletions
diff --git a/apex/build.py b/apex/build.py
index dff25ac..6e90381 100644
--- a/apex/build.py
+++ b/apex/build.py
@@ -109,11 +109,15 @@ def unpack_cache(cache_dest, cache_dir=None):
def build(build_root, version, iso=False, rpms=False):
if iso:
- make_targets = ['iso']
+ logging.warning("iso is deprecated. Will not build iso and build rpm "
+ "instead.")
+ make_targets = ['rpm']
elif rpms:
- make_targets = ['rpms']
+ make_targets = ['rpm']
else:
- make_targets = ['images', 'rpms-check']
+ logging.warning("Nothing specified to build, and images are no "
+ "longer supported in Apex. Will only run rpm check")
+ make_targets = ['rpm-check']
if version is not None:
make_args = ['RELEASE={}'.format(version)]
else:
@@ -234,9 +238,7 @@ def main():
logging.error("Must be in an Apex git repo to execute build")
raise
apex_build_root = os.path.join(apex_root, BUILD_ROOT)
- if os.path.isdir(apex_build_root):
- cache_tmp_dir = os.path.join(apex_root, TMP_CACHE)
- else:
+ if not os.path.isdir(apex_build_root):
logging.error("You must execute this script inside of the Apex "
"local code repository")
raise ApexBuildException("Invalid path for apex root: {}. Must be "
@@ -245,10 +247,7 @@ def main():
dep_playbook = os.path.join(apex_root,
'lib/ansible/playbooks/build_dependencies.yml')
utils.run_ansible(None, dep_playbook)
- unpack_cache(cache_tmp_dir, args.cache_dir)
build(apex_build_root, args.build_version, args.iso, args.rpms)
- build_cache(cache_tmp_dir, args.cache_dir)
- prune_cache(args.cache_dir)
if __name__ == '__main__':
diff --git a/apex/builders/common_builder.py b/apex/builders/common_builder.py
index 05a81ef..0cd683c 100644
--- a/apex/builders/common_builder.py
+++ b/apex/builders/common_builder.py
@@ -25,7 +25,7 @@ from apex.virtual import utils as virt_utils
def project_to_path(project):
"""
- Translates project to absolute file path
+ Translates project to absolute file path to use in patching
:param project: name of project
:return: File path
"""
@@ -36,8 +36,12 @@ def project_to_path(project):
elif 'tripleo-heat-templates' in project:
return "/usr/share/openstack-tripleo-heat-templates"
else:
- # assume python
- return "/usr/lib/python2.7/site-packages/{}".format(project)
+ # assume python. python patches will apply to a project name subdir.
+ # For example, python-tripleoclient patch will apply to the
+ # tripleoclient directory, which is the directory extracted during
+ # python install into the PYTHONPATH. Therefore we need to just be
+ # in the PYTHONPATH directory to apply a patch
+ return "/usr/lib/python2.7/site-packages/"
def project_to_docker_image(project):
@@ -120,7 +124,7 @@ def add_upstream_patches(patches, image, tmp_dir,
"ADD {} {}".format(patch_file, project_path),
"RUN patch -p1 < {}".format(patch_file)
]
- src_img_uri = "{}:8787/{}/centos-binary-{}:" \
+ src_img_uri = "{}:8787/tripleo{}/centos-binary-{}:" \
"{}".format(uc_ip, os_version, service,
docker_tag)
oc_builder.build_dockerfile(service, tmp_dir, docker_cmds,
diff --git a/apex/builders/overcloud_builder.py b/apex/builders/overcloud_builder.py
index a84d100..d2a3100 100644
--- a/apex/builders/overcloud_builder.py
+++ b/apex/builders/overcloud_builder.py
@@ -53,7 +53,7 @@ def inject_opendaylight(odl_version, image, tmp_dir, uc_ip,
"enabled=1' > /etc/yum.repos.d/opendaylight.repo",
"RUN yum -y install opendaylight"
]
- src_img_uri = "{}:8787/{}/centos-binary-{}:" \
+ src_img_uri = "{}:8787/tripleo{}/centos-binary-{}:" \
"{}".format(uc_ip, os_version, 'opendaylight',
docker_tag)
build_dockerfile('opendaylight', tmp_dir, docker_cmds, src_img_uri)
diff --git a/apex/builders/undercloud_builder.py b/apex/builders/undercloud_builder.py
index 268bad7..f82e79d 100644
--- a/apex/builders/undercloud_builder.py
+++ b/apex/builders/undercloud_builder.py
@@ -20,11 +20,6 @@ def add_upstream_packages(image):
:return: None
"""
virt_ops = list()
- # FIXME(trozet): we have to lock to this beta ceph ansible package because
- # the current RPM versioning is wrong and an older package has a higher
- # version than this package. We should change to just 'ceph-ansible'
- # once the package/repo has been fixed. Note: luminous is fine here
- # because Apex will only support container deployment for Queens and later
pkgs = [
'openstack-utils',
'ceph-common',
@@ -34,8 +29,8 @@ def add_upstream_packages(image):
'docker-distribution',
'openstack-tripleo-validations',
'libguestfs-tools',
- 'http://mirror.centos.org/centos/7/storage/x86_64/ceph-luminous' +
- '/ceph-ansible-3.1.0-0.beta3.1.el7.noarch.rpm'
+ 'ceph-ansible',
+ 'python-tripleoclient'
]
for pkg in pkgs:
diff --git a/apex/common/constants.py b/apex/common/constants.py
index 4f72b08..7ccfcd8 100644
--- a/apex/common/constants.py
+++ b/apex/common/constants.py
@@ -39,10 +39,13 @@ VIRT_PW = '--root-password'
THT_DIR = '/usr/share/openstack-tripleo-heat-templates'
THT_ENV_DIR = os.path.join(THT_DIR, 'environments')
-THT_DOCKER_ENV_DIR = os.path.join(THT_ENV_DIR, 'services-docker')
+THT_DOCKER_ENV_DIR = {
+ 'master': os.path.join(THT_ENV_DIR, 'services'),
+ 'queens': os.path.join(THT_ENV_DIR, 'services-docker')
+}
-DEFAULT_OS_VERSION = 'pike'
-DEFAULT_ODL_VERSION = 'nitrogen'
+DEFAULT_OS_VERSION = 'master'
+DEFAULT_ODL_VERSION = 'oxygen'
VALID_ODL_VERSIONS = ['carbon', 'nitrogen', 'oxygen', 'master']
CEPH_VERSION_MAP = {'pike': 'jewel',
'queens': 'luminous',
@@ -52,7 +55,8 @@ PUPPET_ODL_URL = 'https://git.opendaylight.org/gerrit/integration/packaging' \
DEBUG_OVERCLOUD_PW = 'opnfvapex'
NET_ENV_FILE = 'network-environment.yaml'
DEPLOY_TIMEOUT = 90
-UPSTREAM_RDO = 'https://images.rdoproject.org/pike/delorean/current-tripleo/'
+UPSTREAM_RDO = 'https://images.rdoproject.org/master/delorean/current' \
+ '-tripleo-rdo/'
OPENSTACK_GERRIT = 'https://review.openstack.org'
DOCKER_TAG = 'current-tripleo-rdo'
@@ -65,4 +69,4 @@ VALID_DOCKER_SERVICES = {
'neutron-ml2-ovn.yaml': 'neutron-ovn.yaml'
}
DOCKERHUB_OOO = ('https://registry.hub.docker.com/v2/repositories'
- '/tripleoupstream/?page_size=1024')
+ '/tripleomaster/?page_size=1024')
diff --git a/apex/deploy.py b/apex/deploy.py
index bc4d078..1e384a6 100644
--- a/apex/deploy.py
+++ b/apex/deploy.py
@@ -488,6 +488,8 @@ def main():
deploy_vars['stackrc'] = 'source /home/stack/stackrc'
deploy_vars['overcloudrc'] = 'source /home/stack/overcloudrc'
deploy_vars['upstream'] = upstream
+ deploy_vars['undercloud_ip'] = undercloud_admin_ip
+ deploy_vars['ha_enabled'] = ha_enabled
deploy_vars['os_version'] = os_version
deploy_vars['http_proxy'] = net_settings.get('http_proxy', '')
deploy_vars['https_proxy'] = net_settings.get('https_proxy', '')
@@ -558,6 +560,7 @@ def main():
deploy_vars['vpn'] = ds_opts['vpn']
deploy_vars['l2gw'] = ds_opts.get('l2gw')
deploy_vars['sriov'] = ds_opts.get('sriov')
+ deploy_vars['tacker'] = ds_opts.get('tacker')
# TODO(trozet): pull all logs and store in tmp dir in overcloud
# playbook
post_overcloud = os.path.join(args.lib_dir, constants.ANSIBLE_PATH,
diff --git a/apex/overcloud/deploy.py b/apex/overcloud/deploy.py
index 03e5652..6b7c2db 100644
--- a/apex/overcloud/deploy.py
+++ b/apex/overcloud/deploy.py
@@ -144,15 +144,16 @@ def get_docker_sdn_file(ds_opts):
"""
# FIXME(trozet): We assume right now there is only one docker SDN file
docker_services = con.VALID_DOCKER_SERVICES
+ tht_dir = con.THT_DOCKER_ENV_DIR[ds_opts['os_version']]
sdn_env_list = build_sdn_env_list(ds_opts, SDN_FILE_MAP)
for sdn_file in sdn_env_list:
sdn_base = os.path.basename(sdn_file)
if sdn_base in docker_services:
if docker_services[sdn_base] is not None:
- return os.path.join(con.THT_DOCKER_ENV_DIR,
+ return os.path.join(tht_dir,
docker_services[sdn_base])
else:
- return os.path.join(con.THT_DOCKER_ENV_DIR, sdn_base)
+ return os.path.join(tht_dir, sdn_base)
def create_deploy_cmd(ds, ns, inv, tmp_dir,
@@ -430,7 +431,6 @@ def prep_image(ds, ns, img, tmp_dir, root_pw=None, docker_tag=None,
{con.VIRT_UPLOAD: "{}:/usr/lib/systemd/system/".format(tmp_losetup)
},
{con.VIRT_RUN_CMD: 'truncate /srv/data.img --size 10G'},
- {con.VIRT_RUN_CMD: 'mkfs.ext4 -F /srv/data.img'},
{con.VIRT_RUN_CMD: 'systemctl daemon-reload'},
{con.VIRT_RUN_CMD: 'systemctl enable losetup.service'},
])
diff --git a/apex/tests/test_apex_common_builder.py b/apex/tests/test_apex_common_builder.py
index d501746..fe69ca2 100644
--- a/apex/tests/test_apex_common_builder.py
+++ b/apex/tests/test_apex_common_builder.py
@@ -48,7 +48,7 @@ class TestCommonBuilder(unittest.TestCase):
path = '/etc/puppet/modules/tripleo'
self.assertEquals(c_builder.project_to_path(project), path)
project = 'openstack/nova'
- path = '/usr/lib/python2.7/site-packages/nova'
+ path = '/usr/lib/python2.7/site-packages/'
self.assertEquals(c_builder.project_to_path(project), path)
@patch('builtins.open', mock_open())
diff --git a/apex/tests/test_apex_overcloud_deploy.py b/apex/tests/test_apex_overcloud_deploy.py
index ae2e8f0..b69c44d 100644
--- a/apex/tests/test_apex_overcloud_deploy.py
+++ b/apex/tests/test_apex_overcloud_deploy.py
@@ -134,7 +134,8 @@ class TestOvercloudDeploy(unittest.TestCase):
'barometer': False,
'ceph': True,
'sdn_controller': 'opendaylight',
- 'sriov': False
+ 'sriov': False,
+ 'os_version': 'queens'
},
'global_params': MagicMock()}
@@ -158,6 +159,10 @@ class TestOvercloudDeploy(unittest.TestCase):
'storage-environment.yaml', result_cmd)
assert_in('/usr/share/openstack-tripleo-heat-templates/environments'
'/services-docker/neutron-opendaylight.yaml', result_cmd)
+ ds['deploy_options']['os_version'] = 'master'
+ result_cmd = create_deploy_cmd(ds, ns, inv, '/tmp', virt)
+ assert_in('/usr/share/openstack-tripleo-heat-templates/environments'
+ '/services/neutron-opendaylight.yaml', result_cmd)
@patch('apex.overcloud.deploy.prep_sriov_env')
@patch('apex.overcloud.deploy.prep_storage_env')
@@ -170,6 +175,8 @@ class TestOvercloudDeploy(unittest.TestCase):
'global_params': MagicMock()}
ds['global_params'].__getitem__.side_effect = \
lambda i: False if i == 'ha_enabled' else MagicMock()
+ ds['deploy_options'].__getitem__.side_effect = \
+ lambda i: 'master' if i == 'os_version' else MagicMock()
ns = {'ntp': ['ntp']}
inv = MagicMock()
inv.get_node_counts.return_value = (3, 2)
@@ -191,6 +198,8 @@ class TestOvercloudDeploy(unittest.TestCase):
mock_sdn_list.return_value = []
ds = {'deploy_options': MagicMock(),
'global_params': MagicMock()}
+ ds['deploy_options'].__getitem__.side_effect = \
+ lambda i: 'master' if i == 'os_version' else MagicMock()
ns = {}
inv = MagicMock()
inv.get_node_counts.return_value = (0, 0)
@@ -648,7 +657,8 @@ class TestOvercloudDeploy(unittest.TestCase):
'containers': False,
'barometer': True,
'ceph': False,
- 'sdn_controller': 'opendaylight'
+ 'sdn_controller': 'opendaylight',
+ 'os_version': 'queens'
}
output = get_docker_sdn_file(ds_opts)
self.assertEqual(output,
diff --git a/apex/undercloud/undercloud.py b/apex/undercloud/undercloud.py
index d76174b..3cd1e70 100644
--- a/apex/undercloud/undercloud.py
+++ b/apex/undercloud/undercloud.py
@@ -75,7 +75,6 @@ class Undercloud:
template_dir=self.template_path)
self.setup_volumes()
self.inject_auth()
- self._update_delorean_repo()
@staticmethod
def _get_ip(vm):
@@ -228,7 +227,8 @@ class Undercloud:
"network_cidr {}".format(str(ns_admin['cidr'])),
"dhcp_start {}".format(str(ns_admin['dhcp_range'][0])),
"dhcp_end {}".format(str(ns_admin['dhcp_range'][1])),
- "inspection_iprange {}".format(','.join(intro_range))
+ "inspection_iprange {}".format(','.join(intro_range)),
+ "generate_service_certificate false"
]
config['ironic_config'] = [