summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Noriega <rnoriega@redhat.com>2018-07-23 12:14:59 +0200
committerRicardo Noriega <rnoriega@redhat.com>2018-07-26 10:10:47 +0200
commit70138a393e3641d83c488ee504b7839973e6e9d5 (patch)
treedac921ed8665d8b271595832b9b8bb6e4c69a7c4
parent82a9bec67b094f6381acb035a9efeffe47b011ab (diff)
Remove obsolete Ceph tags
This patch removes the logic to use an specific tag for Ceph containers. We will use whatever docker image TripleO upstream uses. For aarch64, an ansible task will replace the tag to pull the proper container image. This patch also refactors the preparation of the local registry. In Queens, there is no need to execute twice the overcloud container image prepare command. JIRA: APEX-622 Change-Id: I947d931609e58505675bb460a59d08c1d10d1d0b Signed-off-by: Ricardo Noriega <rnoriega@redhat.com>
-rw-r--r--apex/common/constants.py3
-rw-r--r--apex/deploy.py5
-rw-r--r--apex/overcloud/deploy.py10
-rw-r--r--apex/tests/test_apex_overcloud_deploy.py3
-rw-r--r--lib/ansible/playbooks/prepare_overcloud_containers.yml45
5 files changed, 18 insertions, 48 deletions
diff --git a/apex/common/constants.py b/apex/common/constants.py
index 2a10b3b2..9c6b2a24 100644
--- a/apex/common/constants.py
+++ b/apex/common/constants.py
@@ -47,9 +47,6 @@ THT_DOCKER_ENV_DIR = {
DEFAULT_OS_VERSION = 'master'
DEFAULT_ODL_VERSION = 'oxygen'
VALID_ODL_VERSIONS = ['carbon', 'nitrogen', 'oxygen', 'master']
-CEPH_VERSION_MAP = {'pike': 'jewel',
- 'queens': 'luminous',
- 'master': 'luminous'}
PUPPET_ODL_URL = 'https://git.opendaylight.org/gerrit/integration/packaging' \
'/puppet-opendaylight'
DEBUG_OVERCLOUD_PW = 'opnfvapex'
diff --git a/apex/deploy.py b/apex/deploy.py
index 9bf9b12e..1168292e 100644
--- a/apex/deploy.py
+++ b/apex/deploy.py
@@ -430,9 +430,6 @@ def main():
docker_playbook = os.path.join(args.lib_dir, constants.ANSIBLE_PATH,
'prepare_overcloud_containers.yml')
if ds_opts['containers']:
- ceph_version = constants.CEPH_VERSION_MAP[ds_opts['os_version']]
- ceph_docker_image = "ceph/daemon:tag-build-master-" \
- "{}-centos-7".format(ceph_version)
logging.info("Preparing Undercloud with Docker containers")
if patched_containers:
oc_builder.archive_docker_patches(APEX_TEMP_DIR)
@@ -445,7 +442,7 @@ def main():
container_vars['sdn'] = ds_opts['sdn_controller']
container_vars['undercloud_ip'] = undercloud_admin_ip
container_vars['os_version'] = os_version
- container_vars['ceph_docker_image'] = ceph_docker_image
+ container_vars['aarch64'] = platform.machine() == 'aarch64'
container_vars['sdn_env_file'] = \
oc_deploy.get_docker_sdn_file(ds_opts)
try:
diff --git a/apex/overcloud/deploy.py b/apex/overcloud/deploy.py
index e1af210d..439848f8 100644
--- a/apex/overcloud/deploy.py
+++ b/apex/overcloud/deploy.py
@@ -694,15 +694,7 @@ def prep_storage_env(ds, ns, virtual, tmp_dir):
print(line)
if ds_opts['containers']:
- undercloud_admin_ip = ns['networks'][con.ADMIN_NETWORK][
- 'installer_vm']['ip']
- ceph_version = con.CEPH_VERSION_MAP[ds_opts['os_version']]
- docker_image = "{}:8787/ceph/daemon:tag-build-master-" \
- "{}-centos-7".format(undercloud_admin_ip,
- ceph_version)
- ceph_params = {
- 'DockerCephDaemonImage': docker_image,
- }
+ ceph_params = {}
# max pgs allowed are calculated as num_mons * 200. Therefore we
# set number of pgs and pools so that the total will be less:
diff --git a/apex/tests/test_apex_overcloud_deploy.py b/apex/tests/test_apex_overcloud_deploy.py
index d12b1a40..17911d59 100644
--- a/apex/tests/test_apex_overcloud_deploy.py
+++ b/apex/tests/test_apex_overcloud_deploy.py
@@ -616,9 +616,6 @@ class TestOvercloudDeploy(unittest.TestCase):
}
prep_storage_env(ds, ns, virtual=True, tmp_dir='/tmp')
ceph_params = {
- 'DockerCephDaemonImage':
- '192.0.2.1:8787/ceph/daemon:tag-build-master-luminous-centos'
- '-7',
'CephPoolDefaultSize': 2,
'CephAnsibleExtraConfig': {
'centos_package_dependencies': [],
diff --git a/lib/ansible/playbooks/prepare_overcloud_containers.yml b/lib/ansible/playbooks/prepare_overcloud_containers.yml
index 79629c2b..1651a531 100644
--- a/lib/ansible/playbooks/prepare_overcloud_containers.yml
+++ b/lib/ansible/playbooks/prepare_overcloud_containers.yml
@@ -25,7 +25,9 @@
--tag {{ container_tag }}
--push-destination {{ undercloud_ip }}:8787
-e /usr/share/openstack-tripleo-heat-templates/environments/docker.yaml
+ -e /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml
--output-images-file overcloud_containers.yml
+ --output-env-file docker-images.yaml
become: yes
become_user: stack
- name: Prepare SDN docker registry image file
@@ -36,9 +38,22 @@
--push-destination {{ undercloud_ip }}:8787
-e {{ sdn_env_file }}
--output-images-file sdn_containers.yml
+ --output-env-file sdn-images.yaml
become: yes
become_user: stack
when: sdn != false
+ - name: Update Ceph tag for aarch64 in container env file
+ lineinfile:
+ path: /home/stack/overcloud_containers.yml
+ regexp: '.*ceph.*'
+ line: '- imagename: docker.io/ceph/daemon:master-fafda7d-luminous-centos-7-aarch64'
+ when: aarch64
+ - name: Update Ceph tag for aarch64 in container image file
+ lineinfile:
+ path: /home/stack/docker-images.yaml
+ regexp: '^DockerCephDaemonImage'
+ line: 'DockerCephDaemonImage: {{ undercloud_ip }}:8787/ceph/daemon/master-fafda7d-luminous-centos-7-aarch64'
+ when: aarch64
- name: Upload docker images to local registry
shell: >
{{ stackrc }} && openstack overcloud container image upload
@@ -67,25 +82,6 @@
- patched_docker_services|length > 0
- item in (response.json)['repositories']|join(" ")
with_items: "{{ patched_docker_services }}"
- - name: Prepare deployment generic docker image file
- shell: >
- {{ stackrc }} && openstack overcloud container image prepare
- --namespace {{ undercloud_ip }}:8787/tripleo{{ os_version }}
- --tag {{ container_tag }}
- -e /usr/share/openstack-tripleo-heat-templates/environments/docker.yaml
- --output-env-file docker-images.yaml
- become: yes
- become_user: stack
- - name: Prepare deployment SDN docker image file
- shell: >
- {{ stackrc }} && openstack overcloud container image prepare
- --namespace {{ undercloud_ip }}:8787/tripleo{{ os_version }}
- --tag {{ container_tag }}
- -e {{ sdn_env_file }}
- --output-env-file sdn-images.yaml
- when: sdn != false
- become: yes
- become_user: stack
- name: Modify Images with Apex tag
replace:
path: "{{ item[0] }}"
@@ -93,13 +89,4 @@
replace: '\1:apex'
with_nested:
- [ '/home/stack/sdn-images.yaml', '/home/stack/docker-images.yaml']
- - "{{ patched_docker_services }}"
- - name: Pull Ceph docker image
- shell: docker pull {{ ceph_docker_image }}
- become: yes
- - name: Tag Ceph image for local registry
- shell: docker tag {{ ceph_docker_image }} {{ undercloud_ip }}:8787/{{ ceph_docker_image }}
- become: yes
- - name: Push Ceph docker image to local registry
- shell: docker push {{ undercloud_ip }}:8787/{{ ceph_docker_image }}
- become: yes
+ - "{{ patched_docker_services }}" \ No newline at end of file