Hello community, here is the log from the commit of package sesdev for openSUSE:Factory checked in at 2020-03-26 23:34:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/sesdev (Old) and /work/SRC/openSUSE:Factory/.sesdev.new.3160 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "sesdev" Thu Mar 26 23:34:46 2020 rev:6 rq:788544 version:1.1.9+1585227448.g3a7e36e Changes: -------- --- /work/SRC/openSUSE:Factory/sesdev/sesdev.changes 2020-03-21 00:02:43.369142806 +0100 +++ /work/SRC/openSUSE:Factory/.sesdev.new.3160/sesdev.changes 2020-03-26 23:35:16.834818509 +0100 @@ -1,0 +2,18 @@ +Thu Mar 26 12:58:05 UTC 2020 - Nathan Cutler <[email protected]> + +- Update to 1.1.9+1585227448.g3a7e36e: + + upstream 1.1.9 release (2020-03-26) + * config.yaml: enable setting of repo priority in version_os_repo_mapping (PR #163) + * provision.sh: add SUSE:CA repo on ses5 (PR #166) + * Implement feature: "sesdev ssh DEP_ID NODE_ID COMMAND" (PR #175) + * Implement feature: "sesdev supportconfig DEPLOYMENT_ID NODE_ID" (PR #176) + * Implement feature: --encrypted-osds (PR #192) + * provision.sh: do not fail ses5 deployment if ntp not installed (PR #173) + * ceph_salt_deployment.sh: adapt Drive Group string to new syntax (PR #178) + * qa/health-ok.sh: wait for OSD nodes to show up (PR #180) + * Vagrantfile,sesdev.spec: require vagrant > 2.2.2 (PR #167) + * Use "filesystems:ceph:octopus:upstream" for default cephadm/container build (PR #170) + * Set "osd crush chooseleaf type = 0" via bootstrap ceph.conf in very small clusters (PR #183) + * ceph_salt_deployment.sh: Fetch github PRs when installing from src (PR #190) + +------------------------------------------------------------------- Old: ---- sesdev-1.1.8+1584097308.ga30c06e.tar.gz New: ---- sesdev-1.1.9+1585227448.g3a7e36e.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sesdev.spec ++++++ --- /var/tmp/diff_new_pack.ruq31P/_old 2020-03-26 23:35:17.222818650 +0100 +++ /var/tmp/diff_new_pack.ruq31P/_new 2020-03-26 23:35:17.226818651 +0100 @@ -16,7 +16,7 @@ # Name: sesdev -Version: 1.1.8+1584097308.ga30c06e +Version: 1.1.9+1585227448.g3a7e36e Release: 1%{?dist} Summary: CLI tool to deploy and manage SES clusters License: MIT @@ -50,7 +50,7 @@ Requires: python3-click >= 6.7 Requires: python3-pycryptodomex >= 3.4.6 Requires: python3-setuptools -Requires: vagrant +Requires: vagrant > 2.2.2 Requires: vagrant-libvirt Requires: sesdev-qa ++++++ sesdev-1.1.8+1584097308.ga30c06e.tar.gz -> sesdev-1.1.9+1585227448.g3a7e36e.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sesdev-1.1.8+1584097308.ga30c06e/CHANGELOG.md new/sesdev-1.1.9+1585227448.g3a7e36e/CHANGELOG.md --- old/sesdev-1.1.8+1584097308.ga30c06e/CHANGELOG.md 2020-03-13 12:01:48.549871656 +0100 +++ new/sesdev-1.1.9+1585227448.g3a7e36e/CHANGELOG.md 2020-03-26 13:57:28.130981849 +0100 @@ -7,6 +7,34 @@ ## [Unreleased] +## [1.1.9] - 2020-03-26 + +### Added +- config.yaml: enable setting of repo priority in version_os_repo_mapping (PR #163) +- Add a bootstrap.sh script and document how to use it (PR #165) +- provision.sh: add SUSE:CA repo on ses5 (PR #166) +- Implement feature: "sesdev ssh DEP_ID NODE_ID COMMAND" (PR #175) +- Implement feature: "sesdev supportconfig DEPLOYMENT_ID NODE_ID" (PR #176) +- Implement feature: --encrypted-osds (PR #192) + +### Fixed +- provision.sh: do not fail ses5 deployment if ntp not installed (PR #173) +- ceph_salt_deployment.sh: adapt Drive Group string to new syntax (PR #178) +- qa/health-ok.sh: wait for OSD nodes to show up (PR #180) +- bootstrap.sh: explicitly use Python 3 (PR #195) + +### Changed +- Vagrantfile,sesdev.spec: require vagrant > 2.2.2 (PR #167) +- Jenkinsfile.integration: + - Add timeout for "sesdev create" (PR #169) + - Parametrize ceph-salt repo and branch (PR #179) + - use bootstrap script and and parameter for extra repo URLs (PR #182) + - Be able to set custom job name/desc (PR #184) + - Add colorful output when running sesdev (PR #196) +- Use "filesystems:ceph:octopus:upstream" for default cephadm/container build (PR #170) +- Set "osd crush chooseleaf type = 0" via bootstrap ceph.conf in very small clusters (PR #183) +- ceph_salt_deployment.sh: Fetch github PRs when installing from src (PR #190) + ## [1.1.8] - 2020-03-13 ### Added @@ -244,7 +272,8 @@ - Minimal README with a few usage instructions. - The CHANGELOG file. -[unreleased]: https://github.com/SUSE/sesdev/compare/v1.1.8...HEAD +[unreleased]: https://github.com/SUSE/sesdev/compare/v1.1.9...HEAD +[1.1.9]: https://github.com/SUSE/sesdev/releases/tag/v1.1.9 [1.1.8]: https://github.com/SUSE/sesdev/releases/tag/v1.1.8 [1.1.7]: https://github.com/SUSE/sesdev/releases/tag/v1.1.7 [1.1.6]: https://github.com/SUSE/sesdev/releases/tag/v1.1.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sesdev-1.1.8+1584097308.ga30c06e/Jenkinsfile.integration new/sesdev-1.1.9+1585227448.g3a7e36e/Jenkinsfile.integration --- old/sesdev-1.1.8+1584097308.ga30c06e/Jenkinsfile.integration 2020-03-13 12:01:48.549871656 +0100 +++ new/sesdev-1.1.9+1585227448.g3a7e36e/Jenkinsfile.integration 2020-03-26 13:57:28.130981849 +0100 @@ -40,6 +40,25 @@ } } +def sesdev_create_cmd(ceph_salt_git_repo, ceph_salt_git_branch, extra_repo_urls) { + cmd = "source venv/bin/activate; sesdev create octopus --non-interactive" + if (!ceph_salt_git_repo.isEmpty()) { + if (ceph_salt_git_branch.isEmpty()) { + error('ceph-salt git repo set, but no ceph-salt git branch given') + } + cmd += " --ceph-salt-repo ${ceph_salt_git_repo} --ceph-salt-branch ${ceph_salt_git_branch}" + } + + if (!extra_repo_urls.isEmpty()) { + repos = extra_repo_urls.split(' ') + for (int i = 0; i < repos.size(); i++) { + cmd += " --repo ${repos[i]}" + } + } + + cmd += " --qa-test --single-node mini" + return cmd +} pipeline { agent none @@ -50,8 +69,18 @@ /* first value in the list is the default */ choice(name: 'OS_CLOUD', choices: ['ovh', 'ecp'], description: 'OpenStack Cloud to use') choice(name: 'OS', choices: ['openSUSE-Leap-15.2'], description: 'Operating system to use') + string(name: 'CEPH_SALT_GIT_REPO', defaultValue: 'https://github.com/ceph/ceph-salt.git', + description: 'ceph-salt git repository to use for installation. If empty, the RPM package is used') + string(name: 'CEPH_SALT_GIT_BRANCH', defaultValue: 'master', + description: 'ceph-salt git branch to use for installation. This parameter is only used when CEPH_SALT_GIT_REPO is set') + string(name: 'EXTRA_REPO_URLS', defaultValue: '', + description: 'Extra zypper repo url(s) that will be added to all nodes. Multiple repos must be separated by space') string(name: 'SLEEP_WHEN_FAILING', defaultValue: '1', description: 'Keep the environment available for X minutes when job failed') + string(name: 'CUSTOM_JOB_NAME', defaultValue: '', + description: 'If set, a custom job name will be set') + string(name: 'CUSTOM_JOB_DESC', defaultValue: '', + description: 'If set, a custom job description will be set') } environment { @@ -67,6 +96,14 @@ label "${jenkins_slave_base}" } steps { + script { + if (!params.CUSTOM_JOB_NAME.isEmpty()) { + currentBuild.displayName = "${params.CUSTOM_JOB_NAME}" + } + if (!params.CUSTOM_JOB_DESC.isEmpty()) { + currentBuild.description = "${params.CUSTOM_JOB_DESC}" + } + } sh 'git clone https://github.com/toabctl/jcs.git' sh 'virtualenv venv' sh "source venv/bin/activate; pip install git+https://github.com/toabctl/jcs.git#egg=jcs[openstack,obs,jenkins]" @@ -108,13 +145,13 @@ stage('Install sesdev from source and create cluster') { agent { label "${jenkins_slave_name}" } steps { - sh """ - virtualenv venv - source venv/bin/activate - pip install --editable . - """ + sh "./bootstrap.sh" sh "source venv/bin/activate; sesdev --help" - sh "source venv/bin/activate; sesdev create octopus --non-interactive --ceph-salt-repo https://github.com/ceph/ceph-salt.git --ceph-salt-branch master --qa-test --single-node mini" + timeout(time: 90, unit: 'MINUTES') { + ansiColor('xterm') { + sh sesdev_create_cmd(params.CEPH_SALT_GIT_REPO, params.CEPH_SALT_GIT_BRANCH, params.EXTRA_REPO_URLS) + } + } } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sesdev-1.1.8+1584097308.ga30c06e/README.md new/sesdev-1.1.9+1585227448.g3a7e36e/README.md --- old/sesdev-1.1.8+1584097308.ga30c06e/README.md 2020-03-13 12:01:48.553871651 +0100 +++ new/sesdev-1.1.9+1585227448.g3a7e36e/README.md 2020-03-26 13:57:28.130981849 +0100 @@ -1,4 +1,4 @@ -# sesdev - deploy and manage SES/Ceph clusters<br/> [](https://travis-ci.org/SUSE/sesdev) +# sesdev - deploy and manage SES/Ceph clusters<br/> [](https://travis-ci.org/SUSE/sesdev) [](https://ceph-ci.suse.de/job/sesdev-integration/job/master/) `sesdev` is a CLI tool to deploy Ceph clusters (both the upstream and SUSE downstream versions). @@ -33,6 +33,8 @@ * [config.yaml examples](#configyaml-examples) * [octopus from filesystems:ceph:octopus](#octopus-from-filesystemscephoctopus) * [octopus from filesystems:ceph:master:upstream](#octopus-from-filesystemscephmasterupstream) + * [ses7 from Devel:Storage:7.0](#ses7-from-develstorage70) + * [ses7 from Devel:Storage:7.0:CR](#ses7-from-develstorage70cr) * [List existing deployments](#list-existing-deployments) * [SSH access to a cluster](#ssh-access-to-a-cluster) * [Copy files into and out of a cluster](#copy-files-into-and-out-of-a-cluster) @@ -111,8 +113,8 @@ Where `<repo>` can be any of the openSUSE build targets currently enabled for the [sesdev package in the openSUSE Build Service](https://build.opensuse.org/package/show/filesystems:ceph/sesdev). -At this point, sesdev should be installed and ready to use: refer to the "Usage" -chapter, below, for further information. +At this point, sesdev should be installed and ready to use: refer to the +[Usage](#usage) chapter, below, for further information. ### Install sesdev on Fedora Linux @@ -136,8 +138,8 @@ Where `<distro>` can be any of the Fedora build targets currently enabled for the [sesdev package in the openSUSE Build Service](https://build.opensuse.org/package/show/filesystems:ceph/sesdev). -At this point, sesdev should be installed and ready to use: refer to the "Usage" -chapter, below, for further information. +At this point, sesdev should be installed and ready to use: refer to the +[Usage](#usage) chapter, below, for further information. ### Install sesdev on Debian/Ubuntu @@ -166,21 +168,32 @@ $ sudo zypper -n install gcc git-core libvirt-devel python3-devel ``` -Now you can proceed to clone the sesdev source code repo, create and activate -a virtualenv, and install sesdev's Python dependencies in it: +Now you can proceed to clone the sesdev source code repo and bootstrap it: ``` $ git clone https://github.com/SUSE/sesdev.git $ cd sesdev -$ virtualenv venv -$ source venv/bin/activate -$ pip install --editable . +$ ./bootstrap.sh ``` -Remember to re-run `pip install --editable .` after each git pull. +Before you can use `sesdev`, you need to activate the Python virtual environment +created by the `bootstrap.sh` script. The script tells you how to do this, but +we'll give the command here, anyway: -At this point, sesdev should be installed and ready to use: refer to the "Usage" -chapter, below, for further information. +``` +source venv/bin/activate +``` + +At this point, sesdev should be installed and ready to use: refer to the +[Usage](#usage) chapter, below, for further information. + +To leave the virtual environment, simply run: + +``` +deactivate +``` + +CAVEAT: Remember to re-run `./bootstrap.sh` after each git pull. #### Running the unit tests @@ -198,6 +211,7 @@ to install the dependencies, including test dependencies: ``` +source venv/bin/activate pip install --editable ./[dev] ``` @@ -346,6 +360,20 @@ - 'https://download.opensuse.org/repositories/filesystems:/ceph:/octopus/openSUSE_Leap_15.2' ``` +If you need a higher priority on one or more of the repos, +`version_os_repo_mapping` supports a "magic priority prefix" on the repo URL, +like so: + +``` +version_os_repo_mapping: + octopus: + leap-15.2: + - '96!https://download.opensuse.org/repositories/filesystems:/ceph:/octopus/openSUSE_Leap_15.2' +``` + +This would cause the zypper repo to be added at priority 96. + + #### Custom image paths In Ceph versions "octopus" and newer, the Ceph daemons run inside containers. @@ -404,12 +432,52 @@ octopus ``` -##### octopus from filesystems:ceph:master:upstream +##### octopus from filesystems:ceph:octopus:upstream No config.yaml changes are needed, because this is the default configuration. sesdev command is the same as for `filesystems:ceph:octopus`. +##### ses7 from Devel:Storage:7.0 + +This is the default, so no tweaking of config.yaml is necessary. Just: + +``` +sesdev create ses7 \ + --ceph-salt-repo https://github.com/ceph/ceph-salt.git \ + --ceph-salt-branch master \ + --qa-test \ + --single-node \ + ses7 +``` + +Note that this will work even if there is no ceph package visible at +https://build.suse.de/project/show/Devel:Storage:7.0 since it uses the +installation media repo, not the "SLE_15_SP2" repo. + +##### ses7 from Devel:Storage:7.0:CR + +Since `Devel:Storage:7.0:CR/ceph` has the same version as +`filesystems:ceph:master:upstream/ceph`, this is an unadulterated upstream +build which requires special zypper priority to get it to install correctly in +SLE-15-SP2. + +config.yaml: + +``` +version_os_repo_mapping: + ses7: + sles-15-sp2: + - 'http://download.suse.de/ibs/SUSE:/SLE-15-SP2:/Update:/Products:/SES7/images/repo/SUSE-Enterprise-Storage-7-POOL-x86_64-Media1/' + - 'http://download.suse.de/ibs/Devel:/Storage:/7.0/images/repo/SUSE-Enterprise-Storage-7-POOL-x86_64-Media1/' + - '96!http://download.suse.de/ibs/Devel:/Storage:/7.0:/CR/SLE_15_SP2/' +image_paths: + ses7: 'registry.suse.de/devel/storage/7.0/cr/containers/ses/7/ceph/ceph' +``` + +Thanks to the `config.yaml` shown above, the sesdev command line is the same as +in [ses7 from Devel:Storage:7.0](#ses7-from-develstorage70). + ### List existing deployments ``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sesdev-1.1.8+1584097308.ga30c06e/bootstrap.sh new/sesdev-1.1.9+1585227448.g3a7e36e/bootstrap.sh --- old/sesdev-1.1.8+1584097308.ga30c06e/bootstrap.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/sesdev-1.1.9+1585227448.g3a7e36e/bootstrap.sh 2020-03-26 13:57:28.130981849 +0100 @@ -0,0 +1,38 @@ +#!/bin/bash + +function abort_missing_dep { + local executable="$1" + local provided_by="$2" + if type $executable > /dev/null 2>&1 ; then + true + else + >&2 echo "ERROR: $executable not available" + >&2 echo "Please install the $provided_by package for your OS, and try again." + exit 1 + fi +} + +if [ -d ./sesdev ] ; then + true +else + >&2 echo "The working directory, $(pwd), does not look like a sesdev git clone." + >&2 echo "Bailing out!" + exit 1 +fi + +abort_missing_dep python3 python3-base +abort_missing_dep virtualenv python3-virtualenv + +if [ -d ./venv ] ; then + >&2 echo "Detected an existing virtual environment - blowing it away!" + rm -rf ./venv +fi + +virtualenv --python=python3 venv +source venv/bin/activate +pip install --editable . + +>&2 echo +>&2 echo "sesdev installation complete." +>&2 echo "Remember to do \"source venv/bin/activate\" before trying to run sesdev!" +>&2 echo "When finished, issue the \"deactivate\" command to leave the Python virtual environment." diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sesdev-1.1.8+1584097308.ga30c06e/qa/common/common.sh new/sesdev-1.1.9+1585227448.g3a7e36e/qa/common/common.sh --- old/sesdev-1.1.8+1584097308.ga30c06e/qa/common/common.sh 2020-03-13 12:01:48.553871651 +0100 +++ new/sesdev-1.1.9+1585227448.g3a7e36e/qa/common/common.sh 2020-03-26 13:57:28.130981849 +0100 @@ -146,6 +146,7 @@ } function ceph_daemon_versions_test { + local strict_versions="$1" local version_host="" local version_daemon="" echo @@ -156,8 +157,10 @@ set +x version_host="$(_extract_ceph_version "$(ceph --version)")" version_daemon="$(_extract_ceph_version "$(ceph versions | jq -r '.overall | keys[]')")" - set -x - test "$version_host" = "$version_daemon" + if [ "$strict_versions" ] ; then + set -x + test "$version_host" = "$version_daemon" + fi set +x echo "ceph_daemon_versions_test: OK" echo @@ -199,6 +202,34 @@ echo } +function maybe_wait_for_osd_nodes_test { + local expected_osd_nodes="$1" + local actual_osd_nodes="" + local minutes_to_wait="5" + echo + echo "WWWW: maybe_wait_for_osd_nodes_test" + if [ "$expected_osd_nodes" ] ; then + echo "Waiting up to $minutes_to_wait minutes for OSD nodes to show up..." + for minute in $(seq 1 "$minutes_to_wait") ; do + for i in $(seq 1 4) ; do + set -x + actual_osd_nodes="$(json_osd_nodes)" + set +x + if [ "$actual_osd_nodes" = "$expected_osd_nodes" ] ; then + break 2 + else + _grace_period 15 + fi + done + echo "Minutes left to wait: $((minutes_to_wait - minute))" + done + else + echo "No OSD nodes expected: nothing to wait for." + fi + echo "maybe_wait_for_osd_nodes_test: OK" + echo +} + function number_of_nodes_actual_vs_expected_test { echo echo "WWWW: number_of_nodes_actual_vs_expected_test" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sesdev-1.1.8+1584097308.ga30c06e/qa/health-ok.sh new/sesdev-1.1.9+1585227448.g3a7e36e/qa/health-ok.sh --- old/sesdev-1.1.8+1584097308.ga30c06e/qa/health-ok.sh 2020-03-13 12:01:48.553871651 +0100 +++ new/sesdev-1.1.9+1585227448.g3a7e36e/qa/health-ok.sh 2020-03-26 13:57:28.130981849 +0100 @@ -30,28 +30,28 @@ echo echo "Usage:" echo " $SCRIPTNAME [-h,--help] [--igw=X] [--mds=X] [--mgr=X]" - echo " [--mon=X] [--nfs-ganesha=X] [--promiscuous-versions] [--rgw=X]" + echo " [--mon=X] [--nfs-ganesha=X] [--strict-versions] [--rgw=X]" echo " [--total-nodes=X]" echo echo "Options:" - echo " --help Display this usage message" - echo " --igw-nodes expected number of nodes with iSCSI Gateway" - echo " --mds-nodes expected number of nodes with MDS" - echo " --mgr-nodes expected number of nodes with MGR" - echo " --mon-nodes expected number of nodes with MON" - echo " --nfs-ganesha-nodes expected number of nodes with NFS-Ganesha" - echo " --osd-nodes expected number of nodes with OSD" - echo " --osds expected total number of OSDs in cluster" - echo " --promiscuous-versions Do not insist that daemon versions match \"ceph --version\"" - echo " --rgw-nodes expected number of nodes with RGW" - echo " --total-nodes expected total number of nodes in cluster" + echo " --help Display this usage message" + echo " --igw-nodes expected number of nodes with iSCSI Gateway" + echo " --mds-nodes expected number of nodes with MDS" + echo " --mgr-nodes expected number of nodes with MGR" + echo " --mon-nodes expected number of nodes with MON" + echo " --nfs-ganesha-nodes expected number of nodes with NFS-Ganesha" + echo " --osd-nodes expected number of nodes with OSD" + echo " --osds expected total number of OSDs in cluster" + echo " --strict-versions Insist that daemon versions match \"ceph --version\"" + echo " --rgw-nodes expected number of nodes with RGW" + echo " --total-nodes expected total number of nodes in cluster" exit 1 } assert_enhanced_getopt TEMP=$(getopt -o h \ ---long "help,igw-nodes:,mds-nodes:,mgr-nodes:,mon-nodes:,nfs-ganesha-nodes:,osd-nodes:,osds:,promiscuous-versions,rgw-nodes:,total-nodes:" \ +--long "help,igw-nodes:,mds-nodes:,mgr-nodes:,mon-nodes:,nfs-ganesha-nodes:,osd-nodes:,osds:,strict-versions,rgw-nodes:,total-nodes:" \ -n 'health-ok.sh' -- "$@") if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi @@ -65,7 +65,7 @@ NFS_GANESHA_NODES="" OSD_NODES="" OSDS="" -PROMISCUOUS_VERSIONS="" +STRICT_VERSIONS="" RGW_NODES="" TOTAL_NODES="" while true ; do @@ -77,7 +77,7 @@ --nfs-ganesha-nodes) shift ; NFS_GANESHA_NODES="$1" ; shift ;; --osd-nodes) shift ; OSD_NODES="$1" ; shift ;; --osds) shift ; OSDS="$1" ; shift ;; - --promiscuous-versions) PROMISCUOUS_VERSIONS="$1"; shift ;; + --strict-versions) STRICT_VERSIONS="$1"; shift ;; --rgw-nodes) shift ; RGW_NODES="$1" ; shift ;; --total-nodes) shift ; TOTAL_NODES="$1" ; shift ;; -h|--help) usage ;; # does not return @@ -114,6 +114,7 @@ support_cop_out_test ceph_rpm_version_test ceph_cluster_running_test -test -z "$PROMISCUOUS_VERSIONS" && ceph_daemon_versions_test +ceph_daemon_versions_test "$STRICT_VERSIONS" ceph_health_test +maybe_wait_for_osd_nodes_test "$OSD_NODES" # it might take a long time for OSD nodes to show up number_of_nodes_actual_vs_expected_test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sesdev-1.1.8+1584097308.ga30c06e/sesdev/__init__.py new/sesdev-1.1.9+1585227448.g3a7e36e/sesdev/__init__.py --- old/sesdev-1.1.8+1584097308.ga30c06e/sesdev/__init__.py 2020-03-13 12:01:48.553871651 +0100 +++ new/sesdev-1.1.9+1585227448.g3a7e36e/sesdev/__init__.py 2020-03-26 13:57:28.134981845 +0100 @@ -85,7 +85,7 @@ click_options = [ click.option('--roles', type=str, default=None, help='List of roles for each node. Example for two nodes: ' - '[admin, client, prometheus],[storage, mon, mgr]'), + '[master, client, prometheus],[storage, mon, mgr]'), click.option('--os', type=click.Choice(['leap-15.1', 'leap-15.2', 'tumbleweed', 'sles-12-sp3', 'sles-15-sp1', 'sles-15-sp2']), default=None, help='OS (open)SUSE distro'), @@ -117,6 +117,8 @@ help='Domain name to use'), click.option('-n', '--non-interactive', is_flag=True, default=False, help='Do not ask the user if they really want to'), + click.option('--encrypted-osds', is_flag=True, default=False, + help='Deploy OSDs encrypted'), ] return _decorator_composer(click_options, func) @@ -189,7 +191,7 @@ OSDs: \b -$ sesdev create octopus --roles="[admin, mon, mgr], \\ +$ sesdev create octopus --roles="[master, mon, mgr], \\ [storage, mon, mgr, mds], [storage, mon, mds]" \\ --num-disks=4 --disk-size=10 my_octopus_cluster @@ -403,6 +405,7 @@ scc_pass, domain, non_interactive, + encrypted_osds, deepsea_cli=None, stop_before_deepsea_stage=None, deepsea_repo=None, @@ -504,6 +507,9 @@ if non_interactive: settings_dict['non_interactive'] = non_interactive + if encrypted_osds: + settings_dict['encrypted_osds'] = encrypted_osds + if ceph_salt_repo: settings_dict['ceph_salt_git_repo'] = ceph_salt_repo @@ -702,17 +708,23 @@ @cli.command() @click.argument('deployment_id') @click.argument('node', required=False) -def ssh(deployment_id, node=None): [email protected]('command', required=False, nargs=-1) +def ssh(deployment_id, node=None, command=None): """ - Opens an SSH shell to node NODE in deployment DEPLOYMENT_ID. - If the node is not specified, an SSH shell is opened on the "admin" node. + Opens an SSH shell to, or runs optional COMMAND on, node NODE in deployment + DEPLOYMENT_ID. + + If the node is not specified, it defaults to "master". Note: You can check the existing node names with the command "sesdev show <deployment_id>" """ dep = seslib.Deployment.load(deployment_id) _node = 'master' if node is None else node - dep.ssh(_node) + if command: + log_msg = "SSH command: {}".format(command) + logger.info(log_msg) + dep.ssh(_node, command) @cli.command() @@ -734,10 +746,10 @@ Note: You can check the existing node names with the command "sesdev show <deployment_id>" - For example, to copy the file /etc/os-release from the node 'admin' + For example, to copy the file /etc/os-release from the node 'master' on cluster (deployment_id) 'foo' to the current directory on the host: - sesdev scp foo admin:/etc/os-release . + sesdev scp foo master:/etc/os-release . To recursively copy the entire directory "/bar" from the host to "/root/bar" on node1 in deployment foo: @@ -753,7 +765,7 @@ sesdev scp foo -r /bar node1: """ dep = seslib.Deployment.load(deployment_id) - dep.scp(recursive, source, destination) + dep.scp(source, destination, recurse=recursive) @cli.command() @@ -769,6 +781,24 @@ @cli.command() @click.argument('deployment_id') @click.argument('node', required=False) +def supportconfig(deployment_id, node): + """ + Runs supportconfig on a node within an already-deployed cluster. Dumps the + resulting tarball in the current working directory. + + If the node is not specified, it defaults to "master". + + NOTE: supportconfig is only available in deployments running on SUSE Linux + Enterprise. + """ + dep = seslib.Deployment.load(deployment_id) + _node = 'master' if node is None else node + dep.supportconfig(_print_log, _node) + + [email protected]() [email protected]('deployment_id') [email protected]('node', required=False) def stop(deployment_id, node=None): """ Stops the VMs of the deployment DEPLOYMENT_ID. @@ -821,7 +851,7 @@ @click.argument('deployment_id') @click.argument('service', type=click.Choice(['dashboard', 'grafana', 'openattic', 'suma', 'prometheus', 'alertmanager']), required=False) [email protected]('--node', default='admin', type=str, show_default=True, [email protected]('--node', default='master', type=str, show_default=True, help='The node where we want to create the tunnel to') @click.option('--remote-port', default=None, type=int, help='The service port in the remote machine') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sesdev-1.1.8+1584097308.ga30c06e/sesdev.spec new/sesdev-1.1.9+1585227448.g3a7e36e/sesdev.spec --- old/sesdev-1.1.8+1584097308.ga30c06e/sesdev.spec 2020-03-13 12:01:48.869871295 +0100 +++ new/sesdev-1.1.9+1585227448.g3a7e36e/sesdev.spec 2020-03-26 13:57:28.450981584 +0100 @@ -16,7 +16,7 @@ # Name: sesdev -Version: 1.1.8+1584097308.ga30c06e +Version: 1.1.9+1585227448.g3a7e36e Release: 1%{?dist} Summary: CLI tool to deploy and manage SES clusters License: MIT @@ -50,7 +50,7 @@ Requires: python3-click >= 6.7 Requires: python3-pycryptodomex >= 3.4.6 Requires: python3-setuptools -Requires: vagrant +Requires: vagrant > 2.2.2 Requires: vagrant-libvirt Requires: sesdev-qa diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sesdev-1.1.8+1584097308.ga30c06e/seslib/__init__.py new/sesdev-1.1.9+1585227448.g3a7e36e/seslib/__init__.py --- old/sesdev-1.1.8+1584097308.ga30c06e/seslib/__init__.py 2020-03-13 12:01:48.557871647 +0100 +++ new/sesdev-1.1.9+1585227448.g3a7e36e/seslib/__init__.py 2020-03-26 13:57:28.134981845 +0100 @@ -3,6 +3,7 @@ import os from pathlib import Path import random +import re import shutil from xml.dom import minidom import yaml @@ -18,7 +19,7 @@ ServicePortForwardingNotSupported, DeploymentAlreadyExists, \ ServiceNotFound, ExclusiveRoles, RoleNotSupported, CmdException, \ VagrantSshConfigNoHostName, ScpInvalidSourceOrDestination, \ - TooManyMasters, SettingNotKnown + TooManyMasters, SettingNotKnown, SupportconfigOnlyOnSLE JINJA_ENV = Environment(loader=PackageLoader('seslib', 'templates'), trim_blocks=True) @@ -105,7 +106,7 @@ IMAGE_PATHS = { 'ses7': 'registry.suse.de/devel/storage/7.0/containers/ses/7/ceph/ceph', - 'octopus': 'registry.opensuse.org/filesystems/ceph/master/upstream/images/ceph/ceph', + 'octopus': 'registry.opensuse.org/filesystems/ceph/octopus/upstream/images/ceph/ceph', } VERSION_PREFERRED_OS = { @@ -178,11 +179,11 @@ 'openSUSE_Leap_15.1' ], 'leap-15.2': [ - 'https://download.opensuse.org/repositories/filesystems:/ceph:/master:/upstream/' + 'https://download.opensuse.org/repositories/filesystems:/ceph:/octopus:/upstream/' 'openSUSE_Leap_15.2' ], 'tumbleweed': [ - 'https://download.opensuse.org/repositories/filesystems:/ceph:/master:/upstream/' + 'https://download.opensuse.org/repositories/filesystems:/ceph:/octopus:/upstream/' 'openSUSE_Tumbleweed' ], }, @@ -332,6 +333,11 @@ 'help': 'Whether the user wants to be asked', 'default': False }, + 'encrypted_osds': { + 'type': bool, + 'help': 'Whether OSDs should be deployed encrypted', + 'default': False + }, 'deployment_tool': { 'type': str, 'help': 'Deployment tool to deploy the Ceph cluster. Currently only deepsea is supported', @@ -1021,6 +1027,26 @@ except KeyError: raise VersionOSNotSupported(self.settings.version, self.settings.os) + # version_repos might contain URLs with a "magic priority prefix" -- see + # https://github.com/SUSE/sesdev/issues/162 + version_repos_prio = [] + for repo in version_repos: + version_repos_dict = {} + prio_match = re.match(r'^(\d.+)!(http.*)', repo) + if prio_match: + version_repos_dict = { + "url": prio_match[2], + "priority": prio_match[1], + } + else: + version_repos_dict = { + "url": repo, + "priority": 0, + } + version_repos_prio.append(version_repos_dict) + log_msg = "generate_vagrantfile: version_repos_prio: {}".format(version_repos_prio) + logger.debug(log_msg) + if self.settings.os in self.settings.os_repos: os_base_repos = list(self.settings.os_repos[self.settings.os].items()) else: @@ -1047,7 +1073,7 @@ 'use_deepsea_cli': self.settings.use_deepsea_cli, 'stop_before_stage': self.settings.stop_before_stage, 'deployment_tool': self.settings.deployment_tool, - 'version_repos': version_repos, + 'version_repos_prio': version_repos_prio, 'os_base_repos': os_base_repos, 'repo_priority': self.settings.repo_priority, 'qa_test': self.settings.qa_test, @@ -1059,6 +1085,7 @@ 'rgw_nodes': self.node_counts["rgw"], 'storage_nodes': self.node_counts["storage"], 'total_osds': self.settings.num_disks * self.node_counts["storage"], + 'encrypted_osds': self.settings.encrypted_osds, 'scc_username': self.settings.scc_username, 'scc_password': self.settings.scc_password, 'ceph_salt_git_repo': self.settings.ceph_salt_git_repo, @@ -1290,6 +1317,7 @@ result += " - storage_disks: {}\n".format(len(v.storage_disks)) result += (" " "(device names will be assigned by vagrant-libvirt)\n") + result += " - encrypted OSDs: {}\n".format(self.settings.encrypted_osds) result += " - repo_priority: {}\n".format(self.settings.repo_priority) result += " - qa_test: {}\n".format(self.settings.qa_test) if self.settings.version in ['octopus', 'ses7'] \ @@ -1324,7 +1352,7 @@ return (address, proxycmd, dep_private_key) - def _ssh_cmd(self, name): + def _ssh_cmd(self, name, command=None): (address, proxycmd, dep_private_key) = self._vagrant_ssh_config(name) _cmd = ["ssh", "root@{}".format(address), @@ -1333,12 +1361,14 @@ "-o", "UserKnownHostsFile /dev/null", "-o", "PasswordAuthentication no"] if proxycmd is not None: _cmd.extend(["-o", "ProxyCommand={}".format(proxycmd)]) + if command: + _cmd.extend(command) return _cmd - def ssh(self, name): - tools.run_interactive(self._ssh_cmd(name)) + def ssh(self, name, command): + tools.run_interactive(self._ssh_cmd(name, command)) - def _scp_cmd(self, recursive, source, destination): + def _scp_cmd(self, source, destination, recurse=False): host_is_source = False host_is_destination = False name = None @@ -1370,7 +1400,7 @@ # build up scp command (address, proxycmd, dep_private_key) = self._vagrant_ssh_config(name) _cmd = ['scp'] - if recursive: + if recurse: _cmd.extend(['-r']) _cmd.extend(["-i", dep_private_key, "-o", "IdentitiesOnly yes", @@ -1386,8 +1416,25 @@ return _cmd - def scp(self, recursive, source, destination): - tools.run_interactive(self._scp_cmd(recursive, source, destination)) + def scp(self, source, destination, recurse=False): + tools.run_interactive(self._scp_cmd(source, destination, recurse=recurse)) + + def supportconfig(self, log_handler, name): + if self.settings.os.startswith("sle"): + log_msg = ("The OS ->{}<- is SLE, where supportconfig is available" + .format(self.settings.os)) + logger.debug(log_msg) + else: + raise SupportconfigOnlyOnSLE() + log_handler("=> Running supportconfig on deployment ID: {} (OS: {})\n".format( + self.dep_id, + self.settings.os + )) + self.ssh(name, ('supportconfig',)) + log_handler("=> Grabbing the resulting tarball from the cluster node\n") + self.scp(str(name) + ':/var/log/nts*', '.') + log_handler("=> Deleting the tarball from the cluster node\n") + self.ssh(name, ('rm', '/var/log/nts*')) def qa_test(self, log_handler): tools.run_async( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sesdev-1.1.8+1584097308.ga30c06e/seslib/exceptions.py new/sesdev-1.1.9+1585227448.g3a7e36e/seslib/exceptions.py --- old/sesdev-1.1.8+1584097308.ga30c06e/seslib/exceptions.py 2020-03-13 12:01:48.557871647 +0100 +++ new/sesdev-1.1.9+1585227448.g3a7e36e/seslib/exceptions.py 2020-03-26 13:57:28.134981845 +0100 @@ -113,3 +113,11 @@ def __init__(self, setting): super(SettingNotKnown, self).__init__( "Setting '{}' is not known - please open a bug report!".format(setting)) + + +class SupportconfigOnlyOnSLE(SesDevException): + def __init__(self): + super(SupportconfigOnlyOnSLE, self).__init__( + "sesdev supportconfig depends on the 'supportconfig' RPM, which is " + "available only on SUSE Linux Enterprise" + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sesdev-1.1.8+1584097308.ga30c06e/seslib/templates/Vagrantfile.j2 new/sesdev-1.1.9+1585227448.g3a7e36e/seslib/templates/Vagrantfile.j2 --- old/sesdev-1.1.8+1584097308.ga30c06e/seslib/templates/Vagrantfile.j2 2020-03-13 12:01:48.557871647 +0100 +++ new/sesdev-1.1.9+1585227448.g3a7e36e/seslib/templates/Vagrantfile.j2 2020-03-26 13:57:28.134981845 +0100 @@ -1,6 +1,8 @@ # -*- mode: ruby -*- # vi: set ft=ruby : +Vagrant.require_version "> 2.2.2" + Vagrant.configure("2") do |config| config.ssh.insert_key = false config.vm.box = "{{ vagrant_box }}" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sesdev-1.1.8+1584097308.ga30c06e/seslib/templates/ceph-salt/ceph_salt_deployment.sh.j2 new/sesdev-1.1.9+1585227448.g3a7e36e/seslib/templates/ceph-salt/ceph_salt_deployment.sh.j2 --- old/sesdev-1.1.8+1584097308.ga30c06e/seslib/templates/ceph-salt/ceph_salt_deployment.sh.j2 2020-03-13 12:01:48.557871647 +0100 +++ new/sesdev-1.1.9+1585227448.g3a7e36e/seslib/templates/ceph-salt/ceph_salt_deployment.sh.j2 2020-03-26 13:57:28.134981845 +0100 @@ -7,6 +7,8 @@ git clone {{ ceph_salt_git_repo }} cd ceph-salt zypper -n in autoconf gcc python3-devel python3-pip python3-curses +# fetch the available PRs from github. With that, "ceph_salt_git_branch" can be something like "origin/pr/127" to checkout a github PR +git fetch origin "+refs/pull/*/head:refs/remotes/origin/pr/*" git checkout {{ ceph_salt_git_branch }} pip install . # install ceph-salt-formula @@ -84,9 +86,14 @@ # OSDs drive groups spec for each node {% for node in nodes %} {% if node.has_role('storage') %} -ceph-salt config /Storage/Drive_Groups add value="{\"testing_dg_{{ node.name }}\": {\"host_pattern\": \"{{ node.name }}*\", \"data_devices\": {\"all\": true}}}" +ceph-salt config /Storage/Drive_Groups add value="{\"service_type\": \"osd\", \"placement\": {\"host_pattern\": \"{{ node.name }}*\"}, \"service_id\": \"testing_dg_{{ node.name }}\", \"data_devices\": {\"all\": True}}" + {% endif %} {% endfor %} +{% if storage_nodes < 3 %} +ceph-salt config /Deployment/Bootstrap_Ceph_Conf add global +ceph-salt config /Deployment/Bootstrap_Ceph_Conf/global set osd crush chooseleaf type = 0 +{% endif %} {% endif %} {# if ceph_salt_deploy_osds #} ceph-salt config /Deployment/Dashboard/username set admin diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sesdev-1.1.8+1584097308.ga30c06e/seslib/templates/deepsea/deepsea_deployment.sh.j2 new/sesdev-1.1.9+1585227448.g3a7e36e/seslib/templates/deepsea/deepsea_deployment.sh.j2 --- old/sesdev-1.1.8+1584097308.ga30c06e/seslib/templates/deepsea/deepsea_deployment.sh.j2 2020-03-13 12:01:48.557871647 +0100 +++ new/sesdev-1.1.9+1585227448.g3a7e36e/seslib/templates/deepsea/deepsea_deployment.sh.j2 2020-03-26 13:57:28.134981845 +0100 @@ -101,6 +101,11 @@ exit 0 {% endif %} +{% if encrypted_osds %} +echo " encryption: True" >> /srv/salt/ceph/configuration/files/drive_groups.yml +{% endif %} +cat /srv/salt/ceph/configuration/files/drive_groups.yml + echo "" echo "***** RUNNING stage.3 *******" {% if use_deepsea_cli %} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sesdev-1.1.8+1584097308.ga30c06e/seslib/templates/provision.sh.j2 new/sesdev-1.1.9+1585227448.g3a7e36e/seslib/templates/provision.sh.j2 --- old/sesdev-1.1.8+1584097308.ga30c06e/seslib/templates/provision.sh.j2 2020-03-13 12:01:48.561871642 +0100 +++ new/sesdev-1.1.9+1585227448.g3a7e36e/seslib/templates/provision.sh.j2 2020-03-26 13:57:28.138981842 +0100 @@ -1,7 +1,6 @@ {% include "engine/" + vm_engine + "/vagrant.provision.sh.j2" ignore missing %} -# show the user what we are doing -set -x +set -ex ls -lR /home/vagrant @@ -26,20 +25,28 @@ sed -i 's/^rpm\.install\.excludedocs.*$/# rpm.install.excludedocs = no/' /etc/zypp/zypp.conf {% for os_repo_name, os_repo_url in os_base_repos %} -zypper ar {{ os_repo_url }} {{ os_repo_name }} +zypper addrepo {{ os_repo_url }} {{ os_repo_name }} {% endfor %} -{% for _repo in version_repos %} -zypper ar {{ _repo }} {{ version }}-repo{{ loop.index }} -zypper mr -p 98 {{ version }}-repo{{ loop.index }} +{% for _repo in version_repos_prio %} +zypper addrepo +{%- if _repo.priority %} + --priority {{ _repo.priority }} +{%- elif repo_priority %} + --priority 98 +{%- endif %} + {{ _repo.url }} {{ version }}-repo{{ loop.index }} {% endfor %} -{% if version == 'ses7' %} -zypper ar -f http://download.suse.de/ibs/SUSE:/CA/SLE_15_SP2/SUSE:CA.repo +{% if os.startswith("sle") %} +zypper addrepo --refresh +{%- if version == 'ses7' %} + http://download.suse.de/ibs/SUSE:/CA/SLE_15_SP2/SUSE:CA.repo +{%- elif version == 'ses6' or version == 'caasp4' %} + http://download.suse.de/ibs/SUSE:/CA/SLE_15_SP1/SUSE:CA.repo +{%- elif version == 'ses5' %} + http://download.suse.de/ibs/SUSE:/CA/SLE_15_SP1/SUSE:CA.repo {% endif %} - -{% if version == 'ses6' or version == 'caasp4' %} -zypper ar -f http://download.suse.de/ibs/SUSE:/CA/SLE_15_SP1/SUSE:CA.repo {% endif %} zypper --gpg-auto-import-keys ref @@ -103,7 +110,7 @@ {% endif %} {% if version == 'ses5' %} -zypper -n rm ntp +zypper -n rm ntp || true {% endif %} touch /tmp/ready
