Skip to content

Commit

Permalink
Merge remote-tracking branch 'stackhpc/stackhpc/2023.1' into HEAD
Browse files Browse the repository at this point in the history
Change-Id: Id1ff60ad2617680d0c74ae6ccba10c779630a884
  • Loading branch information
jovial committed Oct 27, 2023
2 parents c3e3a3d + e36b263 commit 1ff7072
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ansible/roles/deploy-containers/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ deploy_containers_defaults:
restart_policy: "unless-stopped"

deploy_containers_docker_api_timeout: 120

deploy_containers_registry_attempt_login: "{{ kolla_docker_registry_username is truthy and kolla_docker_registry_password is truthy }}"
3 changes: 1 addition & 2 deletions ansible/roles/deploy-containers/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
password: "{{ kolla_docker_registry_password }}"
reauthorize: yes
when:
- kolla_docker_registry_username is truthy
- kolla_docker_registry_password is truthy
- deploy_containers_registry_attempt_login | bool

- name: Deploy containers (loop)
include_tasks: deploy.yml
Expand Down
23 changes: 23 additions & 0 deletions doc/source/configuration/reference/seed-custom-containers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,26 @@ List of Kayobe applied defaults to required docker_container variables:
.. literalinclude:: ../../../../ansible/roles/deploy-containers/defaults/main.yml
:language: yaml


Docker registry
===============

Seed containers can be pulled from a docker registry deployed on the seed,
since the docker registry deployment step precedes the custom container
deployment step.

It is also possible to deploy a custom containerised docker registry as a
custom seed container. In this case, basic authentication login attempts can be
disabled by setting

.. code-block:: yaml
:caption: ``kolla.yml``
deploy_containers_registry_attempt_login: false
Without this setting, the login will fail because the registry has not yet been
deployed.

More information on deploying a docker registry can be found :ref:`here
<configuration-docker-registry>`.

3 changes: 2 additions & 1 deletion kayobe/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,8 @@ class OvercloudDeprovision(KayobeAnsibleMixin, VaultMixin, Command):

def take_action(self, parsed_args):
self.app.LOG.debug("Deprovisioning overcloud")
playbooks = _build_playbook_list("overcloud-deprovision")
playbooks = _build_playbook_list("kolla-bifrost-hostvars",
"overcloud-deprovision")
self.run_kayobe_playbooks(parsed_args, playbooks)


Expand Down
2 changes: 2 additions & 0 deletions kayobe/tests/unit/cli/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,8 @@ def test_overcloud_deprovision(self, mock_run):
mock.call(
mock.ANY,
[
utils.get_data_files_path(
"ansible", "kolla-bifrost-hostvars.yml"),
utils.get_data_files_path(
"ansible", "overcloud-deprovision.yml"),
],
Expand Down
22 changes: 22 additions & 0 deletions kayobe/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
import base64
from collections import defaultdict
import glob
from importlib.metadata import Distribution
import graphlib
import json
import logging
import os
import shutil
Expand Down Expand Up @@ -50,10 +52,30 @@ def _detect_install_prefix(path):
return prefix_path


def _get_direct_url(dist):
direct_url = os.path.join(dist._path, 'direct_url.json')
if os.path.isfile(direct_url):
with open(direct_url, 'r') as f:
direct_url_content = json.loads(f.readline().strip())
url = direct_url_content['url']
prefix = 'file://'
if url.startswith(prefix):
return url[len(prefix):]

return None


def _get_base_path():
override = os.environ.get("KAYOBE_DATA_FILES_PATH")
if override:
return os.path.join(override)

kayobe_dist = list(Distribution.discover(name="kayobe"))
if kayobe_dist:
direct_url = _get_direct_url(kayobe_dist[0])
if direct_url:
return direct_url

egg_glob = os.path.join(
sys.prefix, 'lib*', 'python*', '*-packages', 'kayobe.egg-link'
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
fixes:
- |
Fixes failure to run ``kayobe overcloud deprovision`` after Bifrost is
redeployed.
`LP#2038889 <https://bugs.launchpad.net/kolla-ansible/+bug/2038889>`__
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
fixes:
- |
Fixes detection of data file path when using editable installations with a
recent pip.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
features:
- |
Attempts to log in to the kolla docker registry can be skipped by setting
``deploy_containers_registry_attempt_login`` to false.
This is required for deployments using a non-standard registry
deployed on the seed during the deploy-container step, since it takes
place after the registry login attempt.

0 comments on commit 1ff7072

Please sign in to comment.