Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Sspl resource health view fix (#84)
Browse files Browse the repository at this point in the history
* change sspl resource_health_view file path and rebase fixes

* fix rebase issues

* fix typo

* Update __metadata__.py

* Update __metadata__.py

* rename cortx-motr to motr

Co-authored-by: Yash <yashodhan.pise@seagate.com>
  • Loading branch information
2 people authored and 83bhp committed Jul 3, 2020
1 parent ba2f6db commit 6449ce9
Show file tree
Hide file tree
Showing 42 changed files with 97 additions and 97 deletions.
6 changes: 3 additions & 3 deletions api/python/provisioner/__metadata__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
__title__ = 'eos-prvsnr'
__version__ = '0.24.0'
__title__ = 'cortx-prvsnr'
__version__ = '0.25.0'
__author__ = "Seagate"
__author_email__ = 'support@seagate.com' # TODO
__maintainer__ = 'Seagate'
__maintainer_email__ = __author_email__
__url__ = 'http://gitlab.mero.colo.seagate.com/eos/provisioner/ees-prvsnr'
__url__ = 'https://github.com/Seagate/cortx-prvsnr'
__description__ = 'Provisioner API for CORTX components'
__long_description__ = __description__
__download_url__ = (
Expand Down
2 changes: 1 addition & 1 deletion api/python/provisioner/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ def run(self, targets):
config_salt_minions()

for component in (
'cortx-motr', 's3server', 'hare', 'sspl', 'csm'
'motr', 's3server', 'hare', 'sspl', 'csm'
):
_update_component(component, targets)
except Exception as exc:
Expand Down
2 changes: 1 addition & 1 deletion api/python/provisioner/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
'controller',
'corosync-pacemaker',
'elasticsearch',
'cortx-motr',
'motr',
'haproxy',
'keepalived',
'openldap',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ user_salt_roots_created:

api_installed:
pip.installed:
- name: /opt/seagate/eos-prvsnr/api/python
- name: /opt/seagate/cortx/provisioner/api/python
- bin_env: /usr/bin/pip3
- upgrade: True
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# TODO IMPROVE EOS-8473 move to pillar to make configurable
{% set install_dir = '/opt/seagate/eos-prvsnr' %}
{% set install_dir = '/opt/seagate/cortx/provisioner' %}
{% set salt_master_running = salt['service.status']('salt-master') %}

salt_master_configured:
Expand Down
16 changes: 8 additions & 8 deletions api/python/provisioner/srv/salt/provisioner/files/api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ fi

# set access rights for api users
# user file root
mkdir -p /opt/seagate/eos-prvsnr/srv_user
chown -R :prvsnrusers /opt/seagate/eos-prvsnr/srv_user
chmod -R g+rws /opt/seagate/eos-prvsnr/srv_user
setfacl -Rdm g:prvsnrusers:rwx /opt/seagate/eos-prvsnr/srv_user
mkdir -p /opt/seagate/cortx/provisioner/srv_user
chown -R :prvsnrusers /opt/seagate/cortx/provisioner/srv_user
chmod -R g+rws /opt/seagate/cortx/provisioner/srv_user
setfacl -Rdm g:prvsnrusers:rwx /opt/seagate/cortx/provisioner/srv_user
# user pillar
mkdir -p /opt/seagate/eos-prvsnr/pillar/user
chown -R :prvsnrusers /opt/seagate/eos-prvsnr/pillar/user
chmod -R g+rws /opt/seagate/eos-prvsnr/pillar/user
setfacl -Rdm g:prvsnrusers:rwx /opt/seagate/eos-prvsnr/pillar/user
mkdir -p /opt/seagate/cortx/provisioner/pillar/user
chown -R :prvsnrusers /opt/seagate/cortx/provisioner/pillar/user
chmod -R g+rws /opt/seagate/cortx/provisioner/pillar/user
setfacl -Rdm g:prvsnrusers:rwx /opt/seagate/cortx/provisioner/pillar/user
2 changes: 1 addition & 1 deletion api/python/provisioner/srv/salt/provisioner/local.sls
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# TODO IMPROVE EOS-8473 move to pillar to make configurable
{% set install_dir = '/opt/seagate/eos-prvsnr' %}
{% set install_dir = '/opt/seagate/cortx/provisioner' %}

repo_installed:
file.recurse:
Expand Down
6 changes: 3 additions & 3 deletions cli/src/common_utils/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1143,12 +1143,12 @@ function install_provisioner {
_dev_build_url="${DEV_BUILD_URL:-http://eos-jenkins.colo.seagate.com/job/Provisioner/job/ees-prvsnr-dev-branch/lastSuccessfulBuild/artifact/}"

yum install -y createrepo wget
mkdir -p /opt/seagate/eos/updates/provisioner/dev
pushd /opt/seagate/eos/updates/provisioner/dev
mkdir -p /opt/seagate/cortx/updates/provisioner/dev
pushd /opt/seagate/cortx/updates/provisioner/dev
wget --no-directories --content-disposition --restrict-file-names=nocontrol --accept rpm -e robots=off --no-parent --reject="index.html*" -r --quiet ${_dev_build_url}
createrepo .
popd
_prvsnr_version="file:///opt/seagate/eos/updates/provisioner/dev"
_prvsnr_version="file:///opt/seagate/cortx/updates/provisioner/dev"

else
_prvsnr_version="http://ci-storage.mero.colo.seagate.com/releases/eos/integration/$_os_release/last_successful"
Expand Down
4 changes: 2 additions & 2 deletions cli/src/configure
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Usage: Usage: $0 [options] component
Configures cortx services either on remote host or locally.
'component' is one of {cluster,cortx-motr,haproxy,release,s3client,s3server,sspl}.
'component' is one of {cluster,motr,haproxy,release,s3client,s3server,sspl}.
Target host is considered to be an CORTX SaltStack master.
Expand Down Expand Up @@ -65,7 +65,7 @@ function positional_args_parser {

if [[ $# -eq 1 ]]; then
case "$1" in
cluster|commons|controller|corosync-pacemaker|elasticsearch|cortx-motr|haproxy|keepalived|openldap|rabbitmq.sls|release|rsyslog.sls|s3clients|s3server|sspl|storage_enclosure.sls|system|uds)
cluster|commons|controller|corosync-pacemaker|elasticsearch|motr|haproxy|keepalived|openldap|rabbitmq.sls|release|rsyslog.sls|s3clients|s3server|sspl|storage_enclosure.sls|system|uds)
component=$1
;;
*)
Expand Down
4 changes: 2 additions & 2 deletions cli/src/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ prereq_states=(
iopath_states=(
# states to be applied in desired sequence
"misc_pkgs.lustre"
"cortx-motr"
"motr"
"s3server"
)

Expand Down Expand Up @@ -88,7 +88,7 @@ $base_options_usage
Options:
-S, --singlenode switch to single node mode setup
--prereq-states deploy only prereq states (components.misc_pkgs)
--iopath-states deploy only iopath states (cortx-motr, s3server & Hare)
--iopath-states deploy only iopath states (motr, s3server & Hare)
--ha-states deploy only ha states (corosync-pacemaker, ees_ha)
--ctrlpath-states deploy only control path states (sspl & csm)
--system-states deploy only system states
Expand Down
2 changes: 1 addition & 1 deletion cli/src/destroy
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ controlpath_states=(
iopath_states=(
# states to be applied in desired sequence
"s3server"
"cortx-motr"
"motr"
"misc_pkgs.lustre"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/src/factory_ops/boxing/prov_tasks
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export LOG_FILE="${LOG_FILE:-/var/log/seagate/provisioner/boxing_prov_tasks.log}
mkdir -p $(dirname "${LOG_FILE}")
truncate -s 0 ${LOG_FILE}

PRVSNR_ROOT="/opt/seagate/eos-prvsnr"
PRVSNR_ROOT="/opt/seagate/cortx/provisioner"
salt_opts="--no-color --out-file=${LOG_FILE} --out-file-append"

function trap_handler {
Expand Down
4 changes: 2 additions & 2 deletions cli/src/factory_ops/unboxing/init
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function help {
1. Management VIP : 10.20.100.201
2. Data network VIP : 172.19.100.100
$ sudo /opt/seagate/eos-prvsnr/cli/factory_ops/unboxing/init -M 10.20.100.201 -C 172.19.100.100
$ sudo /opt/seagate/cortx/provisioner/cli/factory_ops/unboxing/init -M 10.20.100.201 -C 172.19.100.100
Note: It is assumed that public data network IPs on both servers were assigned by DHCP.
Expand All @@ -70,7 +70,7 @@ function help {
server A: 172.19.100.110
server B: 172.19.100.120
$ sudo /opt/seagate/eos-prvsnr/cli/factory_ops/unboxing/init -M 10.20.100.201 -C 172.19.100.100 --Ia 172.19.100.110 --Ib 172.19.100.120
$ sudo /opt/seagate/cortx/provisioner/cli/factory_ops/unboxing/init -M 10.20.100.201 -C 172.19.100.100 --Ia 172.19.100.110 --Ib 172.19.100.120
Note: In this case it is assumed that there were no IPs assigned to the public data interfaces
on both servers.
Expand Down
10 changes: 5 additions & 5 deletions cli/src/recovery_ops/storage_metadata_reset
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function trigger_hare_reset {
_linfo "Starting metadata reset using Hare utility: hare-m0reset."
_linfo "*****************************************************************"

bash /opt/seagate/eos/hare/libexec/prov-m0-reset /var/lib/hare/cluster.yaml /var/lib/hare/build-ees-ha-args.yaml 2>&1 | tee -a ${LOG_FILE} || (
bash /opt/seagate/cortx/hare/libexec/prov-m0-reset /var/lib/hare/cluster.yaml /var/lib/hare/build-ees-ha-args.yaml 2>&1 | tee -a ${LOG_FILE} || (
_lerror "Script *hare-m0reset* failed to execute. Check log file: ${LOG_FILE}"
)

Expand All @@ -59,12 +59,12 @@ function trigger_hare_reset {
function trigger_s3_cleanup {

_linfo "*****************************************************************"
_linfo "Executing script: /opt/seagate/eos/s3server/reset/reset_s3.sh"
_linfo "Executing script: /opt/seagate/cortx/s3/reset/reset_s3.sh"
_linfo "*****************************************************************"

if [[ -f "/opt/seagate/eos/s3server/reset/reset_s3.sh" ]]; then
sh /opt/seagate/eos/s3server/reset/reset_s3.sh --check-motr-cleanup --cleanup-rabbitmq 2>&1 | tee -a ${LOG_FILE}|| (
_lerror "Script */opt/seagate/eos/s3server/reset/reset_s3.sh* failed to execute. Check log file: ${LOG_FILE}"
if [[ -f "/opt/seagate/cortx/s3/reset/reset_s3.sh" ]]; then
sh /opt/seagate/cortx/s3/reset/reset_s3.sh --check-motr-cleanup --cleanup-rabbitmq 2>&1 | tee -a ${LOG_FILE}|| (
_lerror "Script */opt/seagate/cortx/s3/reset/reset_s3.sh* failed to execute. Check log file: ${LOG_FILE}"
)
else
_lerror "S3 reset script not found."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
eoscore:
motr:
# Minimum rpc receive queue length
MERO_M0D_MIN_RPC_RECVQ_LEN: 512
# ioservice buffer pool configuration
Expand Down
2 changes: 1 addition & 1 deletion pillar/components/release.sls
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
eos_release:
target_build: http://ci-storage.mero.colo.seagate.com/releases/eos/integration/centos-7.7.1908/last_successful/
update:
base_dir: /opt/seagate/eos/updates
base_dir: /opt/seagate/cortx/updates
repos: {} # dictionary with (release, source) pairs,
# source should be either an url (starts with 'http://' or 'https://')
# or one of special values: 'dir', 'iso'
2 changes: 1 addition & 1 deletion pillar/components/samples/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ s3client:
secret_key: null
release:
update:
mount_base_dir: /opt/seagate/eos/updates777
mount_base_dir: /opt/seagate/cortx/updates777
repos: {}
corosync-pacemaker:
user: hacluster
Expand Down
2 changes: 1 addition & 1 deletion pillar/components/sspl.sls
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sspl:
health_map_path: /opt/seagate/eos-prvsnr/generated_configs/healthmap/
health_map_path: /opt/seagate/cortx/provisioner/generated_configs/healthmap/
health_map_file: ees-schema.json
rmq:
user: rmq
Expand Down
2 changes: 1 addition & 1 deletion pillar/top.sls
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ base:
- components.commons
- components.corosync-pacemaker
- components.elasticsearch
- components.cortx-motr
- components.motr
- components.haproxy
- components.openldap
- components.release
Expand Down
2 changes: 1 addition & 1 deletion srv/_modules/cortx.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# How to test:
# $ salt-call saltutil.clear_cache
# $ salt-call saltutil.sync_modules && salt-call eos.conf_update "/opt/seagate/s3/conf/s3config.yaml" s3server
# $ salt-call saltutil.sync_modules && salt-call cortx.conf_update "/opt/seagate/s3/conf/s3config.yaml" s3server


# def update(name: str, ref_pillar: str, type: str=None, backup: bool=True) -> bool:
Expand Down
10 changes: 5 additions & 5 deletions srv/_modules/cortxmotr.py → srv/_modules/motr.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# How to test:
# $ salt-call saltutil.clear_cache
# $ salt-call saltutil.sync_modules && salt-call cortxmotr.conf_update "/etc/sysconfig/mero" cortxmotr
# $ salt-call saltutil.sync_modules && salt-call motr.conf_update "/etc/sysconfig/motr" motr


# def _read_pillar(ref_component_pillar: str) -> dict:
Expand All @@ -15,7 +15,7 @@ def _read_pillar(ref_component_pillar):


# def update(name: str, ref_pillar: str, type: str=None, backup: bool=True) -> bool:
def conf_update(name='/etc/sysconfig/mero', ref_pillar='cortxmotr', type=None, backup=True):
def conf_update(name='/etc/sysconfig/motr', ref_pillar='motr', type=None, backup=True):
"""Update component config file.
Args :
Expand All @@ -25,11 +25,11 @@ def conf_update(name='/etc/sysconfig/mero', ref_pillar='cortxmotr', type=None, b
backup: Backup config file before modification as bool (Default: True)
"""

name = name if name else '/etc/sysconfig/mero'
ref_pillar = ref_pillar if ref_pillar else 'cortxmotr'
name = name if name else '/etc/sysconfig/motr'
ref_pillar = ref_pillar if ref_pillar else 'motr'

if not os.path.exists(name):
print("ERROR: CortxMotr config file {0} doesn't exist.".format(name))
print("ERROR: Motr config file {0} doesn't exist.".format(name))
return False

pillar_data = _read_pillar(ref_pillar)
Expand Down
21 changes: 0 additions & 21 deletions srv/components/cortx-motr/init.sls

This file was deleted.

10 changes: 0 additions & 10 deletions srv/components/cortx-motr/prepare.sls

This file was deleted.

4 changes: 2 additions & 2 deletions srv/components/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ lustre:
id: "lustre"
url: {{ salt["environ.get"]('REPO_URL', repo_url) }}

cortx_motr:
motr:
repo:
id: "cortx-moto"
id: "motr"
url: {{ salt["environ.get"]('REPO_URL', repo_url) }}
gpgkey: {{ salt["environ.get"]('REPO_URL', repo_url) }}/RPM-GPG-KEY-Seagate

Expand Down
2 changes: 1 addition & 1 deletion srv/components/ha/ees_ha/post_update.sls
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% if salt["pillar.get"]('cluster:{0}:is_primary'.format(grains['id']), false) %}
Stage - Post Update Hare:
cmd.run:
- name: __slot__:salt:setup_conf.conf_cmd('/opt/seagate/eos/hare/conf/setup-ha.yaml', 'hare:post_update')
- name: __slot__:salt:setup_conf.conf_cmd('/opt/seagate/cortx/hare/conf/setup-ha.yaml', 'hare:post_update')
{% endif %}
2 changes: 1 addition & 1 deletion srv/components/misc_pkgs/rhel_sos/files/setup.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
support_bundle:
- /opt/seagate/eos-prvsnr/cli/sos-generate
- /opt/seagate/cortx/provisioner/cli/sos-generate
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% if "physical" in grains['virtual'] %}
# Override CortxMotr config from pillar data:
# Override Motr config from pillar data:
# module.run:
# - cortxmotr.conf_update:
# - name: /etc/sysconfig/mero
# - ref_pillar: cortxmotr
# - motr.conf_update:
# - name: /etc/sysconfig/motr
# - ref_pillar: motr
# - backup: True
{% endif %}

Expand All @@ -15,6 +15,6 @@ Stage - Config Motr:
cmd.run:
- name: __slot__:salt:setup_conf.conf_cmd('/opt/seagate/cortx/motr/conf/setup.yaml', 'core:config')

Stage - Init CortxMotr:
Stage - Init Motr:
cmd.run:
- name: __slot__:salt:setup_conf.conf_cmd('/opt/seagate/cortx/motr/conf/setup.yaml', 'core:init')
21 changes: 21 additions & 0 deletions srv/components/motr/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% if not salt['file.file_exists']('/opt/seagate/cortx/provisioner/generated_configs/{0}.motr'.format(grains['id'])) %}
include:
- components.motr.prepare
- components.motr.install
- components.motr.config
# - components.motr.start
- components.motr.sanity_check

Generate motr checkpoint flag:
file.managed:
- name: /opt/seagate/cortx/provisioner/generated_configs/{{ grains['id'] }}.motr
- makedirs: True
- create: True

{%- else -%}

motr already applied:
test.show_notification:
- text: "Storage states already executed on node: {{ grains['id'] }}. Execute 'salt '*' state.apply components.motr.teardown' to reprovision these states."

{%- endif %}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Install CortxMotr:
Install Motr:
pkg.installed:
- pkgs:
- cortx-motr: latest
Expand Down
10 changes: 10 additions & 0 deletions srv/components/motr/prepare.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% import_yaml 'components/defaults.yaml' as defaults %}

Add Motr yum repo:
pkgrepo.managed:
- name: {{ defaults.motr.repo.id }}
- enabled: True
- humanname: motr
- baseurl: {{ defaults.motr.repo.url }}
- gpgcheck: 1
- gpgkey: {{ defaults.motr.repo.gpgkey }}
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 6449ce9

Please sign in to comment.