Deploy ceph cluster using cephadm For example, teuthology.yaml can contain the 'defaults' section: defaults: cephadm: containers: image: 'quay.io/ceph-ci/ceph' Using overrides makes it possible to customize it per run. The equivalent 'o
(ctx, config)
| 2013 | |
| 2014 | @contextlib.contextmanager |
| 2015 | def task(ctx, config): |
| 2016 | """ |
| 2017 | Deploy ceph cluster using cephadm |
| 2018 | |
| 2019 | For example, teuthology.yaml can contain the 'defaults' section: |
| 2020 | |
| 2021 | defaults: |
| 2022 | cephadm: |
| 2023 | containers: |
| 2024 | image: 'quay.io/ceph-ci/ceph' |
| 2025 | |
| 2026 | Using overrides makes it possible to customize it per run. |
| 2027 | The equivalent 'overrides' section looks like: |
| 2028 | |
| 2029 | overrides: |
| 2030 | cephadm: |
| 2031 | containers: |
| 2032 | image: 'quay.io/ceph-ci/ceph' |
| 2033 | registry-login: |
| 2034 | url: registry-url |
| 2035 | username: registry-user |
| 2036 | password: registry-password |
| 2037 | |
| 2038 | By default, the image tag is determined as a suite 'branch' value, |
| 2039 | or 'sha1' if provided. However, the tag value can be overridden by |
| 2040 | including ':TAG' or '@DIGEST' in the container image name, for example, |
| 2041 | for the tag 'latest', the 'overrides' section looks like: |
| 2042 | |
| 2043 | overrides: |
| 2044 | cephadm: |
| 2045 | containers: |
| 2046 | image: 'quay.io/ceph-ci/ceph:latest' |
| 2047 | |
| 2048 | :param ctx: the argparse.Namespace object |
| 2049 | :param config: the config dict |
| 2050 | :param watchdog_setup: start DaemonWatchdog to watch daemons for failures |
| 2051 | """ |
| 2052 | if config is None: |
| 2053 | config = {} |
| 2054 | |
| 2055 | assert isinstance(config, dict), \ |
| 2056 | "task only supports a dictionary for configuration" |
| 2057 | |
| 2058 | overrides = ctx.config.get('overrides', {}) |
| 2059 | teuthology.deep_merge(config, overrides.get('ceph', {})) |
| 2060 | teuthology.deep_merge(config, overrides.get('cephadm', {})) |
| 2061 | log.info('Config: ' + str(config)) |
| 2062 | |
| 2063 | # set up cluster context |
| 2064 | if not hasattr(ctx, 'ceph'): |
| 2065 | ctx.ceph = {} |
| 2066 | if 'cluster' not in config: |
| 2067 | config['cluster'] = 'ceph' |
| 2068 | cluster_name = config['cluster'] |
| 2069 | if cluster_name not in ctx.ceph: |
| 2070 | ctx.ceph[cluster_name] = argparse.Namespace() |
| 2071 | ctx.ceph[cluster_name].bootstrapped = False |
| 2072 |
nothing calls this directly
no test coverage detected