Skip to content

Commit cee1b5d

Browse files
Merge branch 'laurel' into 'master'
Merge laurel release branch to main branch Closes VIYAARK-214 See merge request sassoftware/viya-ark!361
2 parents 16f03fe + 1766d42 commit cee1b5d

16 files changed

+121
-63
lines changed

CHANGELOG.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
# Changelog for SAS Viya ARK
22

33
<!-- LATEST RELEASE START -->
4+
## Viya35-ark-1.13 - March 23, 2021
5+
- **Sumary**:
6+
Bug fixes.
7+
- Issues addressed:
8+
- SAS Multi-Machine Services Utilities
9+
- VIYAARK-210 - MMSU: Document enable_svs_alternative.
10+
- VIYAARK-214 - MMSU: Task names for Postgres start/stop need to be clarified.
11+
- SAS Viya Pre-Installation Playbook
12+
- VIYAARK-204 - Make yum cachedir path customizable.
13+
- SAS Viya Deployment Report
14+
- VIYAARK-242 - Deployment Report not reporting the status of "not ready" services.
15+
<!-- LATEST RELEASE END -->
16+
417
## Viya35-ark-1.12 - February 16, 2021
518
- **Summary**:
619
RHEL8 Support and bug fixes.
@@ -22,7 +35,6 @@
2235
- VIYAARK-239 - UnicodeEncodeError: 'ascii' codec can't encode character correctly. (GitHub Issue #75)
2336
- Ansible Support: Ansible 2.8 - Ansible 2.10
2437

25-
<!-- LATEST RELEASE END -->
2638

2739
## Viya35-ark-1.11 - December 18, 2020
2840
- **Summary**:

playbooks/deployment-report/library/get_sas_host_details.py

+33-7
Original file line numberDiff line numberDiff line change
@@ -708,11 +708,13 @@ class ServicesStatusKeys(object):
708708
memory: ''
709709
710710
:cvar str DOWN: Key referencing *down* (str) in *status* (dict).
711+
:cvar str NOT_READY: Key referencing *not_ready* (str) in *status* (dict).
711712
:cvar str OTHER: Key referencing *other* (str) in *status* (dict).
712713
:cvar str UP: Key referencing *up* (str) in *status* (dict).
713714
:cvar str MEMORY: Key referencing *memory* (str) in *status* (dict).
714715
"""
715716
DOWN = 'down'
717+
NOT_READY = 'not_ready'
716718
OTHER = 'other'
717719
UP = 'up'
718720
MEMORY = 'memory'
@@ -832,10 +834,12 @@ class _ServiceStatus(object):
832834
"""
833835
Internal class for static reference to service status values.
834836
835-
:cvar str DOWN: Denotes a service's status as down.
836-
:cvar str UP: Denotes a service's status as up.
837+
:cvar str DOWN: Denotes a service's status as down.
838+
:cvar str NOT_READY: Denotes a service's status as "not ready".
839+
:cvar str UP: Denotes a service's status as up.
837840
"""
838841
DOWN = 'down'
842+
NOT_READY = 'not ready'
839843
UP = 'up'
840844

841845

@@ -1302,6 +1306,7 @@ def _get_sas_service_info(module):
13021306

13031307
total_up = 0
13041308
total_down = 0
1309+
total_not_ready = 0
13051310
total_other = 0
13061311
total_memory = 0
13071312

@@ -1318,12 +1323,30 @@ def _get_sas_service_info(module):
13181323
# remove leading/trailing whitespace and split by whitespace
13191324
status_values = status.rstrip().split()
13201325

1321-
# If line contains all 5 known values, add it to results
1322-
if len(status_values) == 5:
1326+
# If the line must contain at least 5 values to have all columns returned
1327+
if len(status_values) >= 5:
13231328

1329+
# the name will always be the first value in the array
13241330
name = status_values[0]
1325-
status = status_values[1]
1326-
pid = status_values[4]
1331+
1332+
# get the number of extra values in the array
1333+
status_length = len(status_values) - 5
1334+
1335+
# define the starting index of the status
1336+
status_start_index = 1
1337+
1338+
# there is at least 1 status value so get directly in the second position in the array
1339+
status = status_values[status_start_index]
1340+
1341+
# get any additional status values
1342+
for i in range(status_length):
1343+
status = status + " " + status_values[status_start_index + i + 1]
1344+
1345+
# the port will always be the second to last value in the array
1346+
port = status_values[-2]
1347+
1348+
# the pid will always be the last value in the array
1349+
pid = status_values[-1]
13271350

13281351
# If the service is up and running then get the memory size.
13291352
if status == _ServiceStatus.UP:
@@ -1346,7 +1369,7 @@ def _get_sas_service_info(module):
13461369

13471370
service_attributes = {
13481371
_HostDetailsKeys.SASServicesKeys.InstalledServiceKeys.ServiceAttributesKeys.STATUS: status,
1349-
_HostDetailsKeys.SASServicesKeys.InstalledServiceKeys.ServiceAttributesKeys.PORT: status_values[3],
1372+
_HostDetailsKeys.SASServicesKeys.InstalledServiceKeys.ServiceAttributesKeys.PORT: port,
13501373
_HostDetailsKeys.SASServicesKeys.InstalledServiceKeys.ServiceAttributesKeys.PID: pid,
13511374
_HostDetailsKeys.SASServicesKeys.InstalledServiceKeys.ServiceAttributesKeys.RESIDENT_MEMORY: h_read_memory
13521375
}
@@ -1356,6 +1379,8 @@ def _get_sas_service_info(module):
13561379
total_up += 1
13571380
elif status == _ServiceStatus.DOWN:
13581381
total_down += 1
1382+
elif status == _ServiceStatus.NOT_READY:
1383+
total_not_ready += 1
13591384
else:
13601385
total_other += 1
13611386

@@ -1370,6 +1395,7 @@ def _get_sas_service_info(module):
13701395
results[_HostDetailsKeys.SASServicesKeys.STATUS] = {
13711396
_HostDetailsKeys.SASServicesKeys.ServicesStatusKeys.UP: total_up,
13721397
_HostDetailsKeys.SASServicesKeys.ServicesStatusKeys.DOWN: total_down,
1398+
_HostDetailsKeys.SASServicesKeys.ServicesStatusKeys.NOT_READY: total_not_ready,
13731399
_HostDetailsKeys.SASServicesKeys.ServicesStatusKeys.OTHER: total_other,
13741400
_HostDetailsKeys.SASServicesKeys.ServicesStatusKeys.MEMORY: h_total_memory
13751401
}

playbooks/deployment-report/templates/viya_deployment_report.html.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ div.no-software-installed {
701701

702702
<!-- BEGIN: services -->
703703

704-
<h3 id="{{ host[1]._id }}-machine-details-accordion-services-header">Services &nbsp;(<b>total</b>: {{ host[1].sas_services.installed | length }} | <b>up</b>: {{ host[1].sas_services.status.up }} | <b>down</b>: {{ host[1].sas_services.status.down }} | <b>other</b>: {{ host[1].sas_services.status.other }} | <b>memory</b>: {{ host[1].sas_services.status.memory }})</h3>
704+
<h3 id="{{ host[1]._id }}-machine-details-accordion-services-header">Services &nbsp;(<b>total</b>: {{ host[1].sas_services.installed | length }} | <b>up</b>: {{ host[1].sas_services.status.up }} | <b>down</b>: {{ host[1].sas_services.status.down }} | <b>not ready</b>: {{ host[1].sas_services.status.not_ready }} | <b>other</b>: {{ host[1].sas_services.status.other }} | <b>memory</b>: {{ host[1].sas_services.status.memory }})</h3>
705705

706706
<!-- services accordion -->
707707
<div class="accordion services-accordion" id="{{ host[1]._id }}-services-accordion">

playbooks/pre-install-playbook/roles/viya-ark.preinstall/defaults/main.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@ max_hostname_length: 58 ## better number, SAS note is yet to be written.
135135
viya_version: 3.5
136136

137137
## yum related
138-
yum_cache_yn: 0 ## do you want to turn the yum cache on or off? (1=on, 0=off)
139-
yum_cache_min_space_mb: 8000 ## how many MB of free space should be in /var/yum/cache ?
138+
yum_cache_yn: 0 ## do you want to turn the yum cache on or off? (1=on, 0=off)
139+
yum_cache_min_space_mb: 8000 ## how many MB of free space should be in /var/cache/yum ?
140+
yum_cache_dir: /var/cache/yum ## edit if using a custom cache location
140141

141142
packages_nicetohave:
142143
- "{{ browser }}" ## a browser on the server can be useful

playbooks/pre-install-playbook/roles/viya-ark.preinstall/tasks/pre.yum_cache_config.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
- name: Show message telling you that you wanted YUM cache 'on'
1616
debug: msg="You want YUM cache enabled"
1717

18-
- name: Getting the amount of free disk space (in MB) in the /var/cache/yum directory.
19-
shell: df -Ph /var/cache/yum --block-size=M | tail -1 | awk '{print $4}' | sed 's/[^0-9]*\([0-9]\+\)[^0-9]*/\1/'
18+
- name: Getting the amount of free disk space (in MB) in the {{yum_cache_dir}} directory.
19+
shell: df -Ph {{yum_cache_dir}} --block-size=M | tail -1 | awk '{print $4}' | sed 's/[^0-9]*\([0-9]\+\)[^0-9]*/\1/'
2020
changed_when: False
2121
check_mode: no
2222
register: var_cache_yum_actual
2323

2424
- name: Show information about YUM cache storage
25-
debug: msg="You have {{var_cache_yum_actual.stdout}} MB free in /var/cache/yum and you need {{yum_cache_min_space_mb}} MB free"
25+
debug: msg="You have {{var_cache_yum_actual.stdout}} MB free in {{yum_cache_dir}} and you need {{yum_cache_min_space_mb}} MB free"
2626

2727

2828
- name: "Assert that there is enough space for YUM cache"
@@ -33,6 +33,7 @@
3333
There is only {{var_cache_yum_actual.stdout | int}} MB available for YUM cache.
3434
You need at least {{yum_cache_min_space_mb}} MB.
3535
Either add more space or set the yum_cache_yn to 0.
36+
If using a custom location, change the value in yum_cache_dir.
3637
Add --skip-tags skipyumspacefail to bypass.
3738
tags:
3839
- skipifbelowspecs
@@ -44,7 +45,7 @@
4445
- detectableonly
4546

4647
##
47-
## If the location of the YUM cache (/var/cache/yum) has the space for it (10-15 GB), set this to 1
48+
## If the location of the YUM cache (yum_cache_dir) has the space for it (10-15 GB), set this to 1
4849
## If not, leave this to zero
4950
##
5051
- name: Enable/disable YUM caching ({{yum_cache_yn}})

playbooks/viya-mmsu/README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,16 @@ ansible-playbook viya-ark/playbooks/viya-mmsu/viya-services-restart.yml
7272
[WARNING: All Viya services are about to be stopped!]
7373
Press 'ctl+c' to interrupt the process. If no response, playbook will continue after 10 seconds:
7474
```
75-
User may modify viya-services-vars.yml file as following to disable the pause timer or pass the variable through the command line.
75+
The user may modify viya-services-vars.yml file as following to disable the pause timer or pass the variable through the command line.
7676
```
7777
enable_pause_timer: false
7878
```
79+
* An experimental, alternative method of starting and stopping services based on server resource utilization is optionally available using the enable_svs_alternative variable.
80+
```
81+
ansible-playbook viya-ark/playbooks/viya-mmsu/viya-services-start.yml -e "enable_svs_alternative=true"
82+
ansible-playbook viya-ark/playbooks/viya-mmsu/viya-services-stop.yml -e "enable_svs_alternative=true"
83+
```
84+
Note: if an order contains Common Planning Service (CPS), you will not be able to use the alternative method.
7985

80-
Copyright (c) 2019-2020, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
86+
Copyright (c) 2019-2021, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
8187
SPDX-License-Identifier: Apache-2.0

playbooks/viya-mmsu/viya-db.yml

+2-22
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,11 @@
44
#### Author: SAS Institute Inc. ####
55
####################################################################
66
#
7-
# Copyright (c) 2019-2020, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
7+
# Copyright (c) 2019-2021, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
88
# SPDX-License-Identifier: Apache-2.0
99
#
1010

11-
- name: SAS Infrastructure Data Server - {{dbname}}
11+
- name: "{{dbaction|replace('db','')|capitalize()}} SAS Infrastructure Data Server {{dbtype}} - {{dbname}}"
1212
script: "viya-svs.sh {{dbaction}} {{dbname}} {{dbnum}} {{dbtype}}"
1313
when: not ansible_check_mode
1414

15-
- block:
16-
- name: Check SAS Infrastructure Data Server status - {{dbname}}
17-
script: "viya-svs.sh checkdb {{dbname}} {{dbnum}}"
18-
changed_when: false
19-
register: dbrc
20-
check_mode: no
21-
22-
- name: Display SAS Infrastructure Data Server status - {{dbname}}
23-
debug: var=dbrc.stdout_lines
24-
when: ansible_check_mode
25-
26-
- name: Fail task if DB is not running for start - {{dbname}}
27-
fail:
28-
msg:
29-
- "ERROR: PGPool is not running"
30-
- "This issue needs to be addressed before rerun the playbook."
31-
when: not ansible_check_mode and dbrc.stdout is search('is not running')
32-
33-
when: dbaction == 'startdb'
34-

playbooks/viya-mmsu/viya-dbcheck.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
####################################################################
2+
#### viya-db.yml ####
3+
####################################################################
4+
#### Author: SAS Institute Inc. ####
5+
####################################################################
6+
#
7+
# Copyright (c) 2019-2021, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
8+
# SPDX-License-Identifier: Apache-2.0
9+
#
10+
11+
- name: Check SAS Infrastructure Data Server status - {{dbname}}
12+
script: "viya-svs.sh checkdb {{dbname}} {{dbnum}}"
13+
changed_when: false
14+
register: dbrc
15+
check_mode: no
16+
17+
- name: Display SAS Infrastructure Data Server status - {{dbname}}
18+
debug: var=dbrc.stdout_lines
19+
when: ansible_check_mode
20+
21+
- name: Fail task if DB is not running for start - {{dbname}}
22+
fail:
23+
msg:
24+
- "ERROR: PGPool is not running"
25+
- "This issue needs to be addressed before rerun the playbook."
26+
when: not ansible_check_mode and dbrc.stdout is search('is not running')

playbooks/viya-mmsu/viya-dbct.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#### Author: SAS Institute Inc. ####
55
####################################################################
66
#
7-
# Copyright (c) 2019-2020, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
7+
# Copyright (c) 2019-2021, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
88
# SPDX-License-Identifier: Apache-2.0
99
#
10-
- name: SAS Infrastructure Data Server Consul Template - {{dbname}}
10+
- name: "{{dbaction|replace('dbct','')|capitalize()}} SAS Infrastructure Data Server Consul Template common {{dbtype}} - {{dbname}}"
1111
script: "viya-svs.sh {{dbaction}} {{dbname}} {{dbtype}}"
1212
when: not ansible_check_mode

playbooks/viya-mmsu/viya-services-disable.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#### Author: SAS Institute Inc. ####
55
####################################################################
66
#
7-
# Copyright (c) 2019-2020, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
7+
# Copyright (c) 2019-2021, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
88
# SPDX-License-Identifier: Apache-2.0
99
#
1010
---

playbooks/viya-mmsu/viya-services-restart.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#### Author: SAS Institute Inc. ####
55
####################################################################
66
#
7-
# Copyright (c) 2019-2020, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
7+
# Copyright (c) 2019-2021, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
88
# SPDX-License-Identifier: Apache-2.0
99
#
1010
---

playbooks/viya-mmsu/viya-services-start.yml

+13-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#### Author: SAS Institute Inc. ####
55
####################################################################
66
#
7-
# Copyright (c) 2019-2020, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
7+
# Copyright (c) 2019-2021, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
88
# SPDX-License-Identifier: Apache-2.0
99
#
1010
---
@@ -58,31 +58,31 @@
5858
- ../../../vars.yml
5959
tasks:
6060
- block:
61-
- name: Start SAS Infrastructure Data Server Pgpool Consul Template
61+
- name: Start SAS Infrastructure Data Server Consul Template pgpool
6262
include_tasks: viya-dbct.yml
6363
vars:
6464
dbname: "{{INVOCATION_VARIABLES[inventory_hostname]['pgpoolc'][0]['SERVICE_NAME']|default([])}}"
6565
dbaction: startdbct
6666
dbtype: pgpool
6767
when: INVOCATION_VARIABLES[inventory_hostname]['pgpoolc'] is defined and INVOCATION_VARIABLES[inventory_hostname]['pgpoolc'][0]['HA_PGPOOL_VIRTUAL_IP'] is defined
6868

69-
- name: Start SAS Infrastructure Data Server Node Consul Template
69+
- name: Start SAS Infrastructure Data Server Consul Template node
7070
include_tasks: viya-dbct.yml
7171
vars:
7272
dbname: "{{INVOCATION_VARIABLES[inventory_hostname]['sasdatasvrc'][0]['SERVICE_NAME']|default([])}}"
7373
dbaction: startdbct
7474
dbtype: node
7575
when: INVOCATION_VARIABLES[inventory_hostname]['sasdatasvrc'] is defined
7676

77-
- name: Start SAS Infrastructure Data Server Pgpool Consul Template
77+
- name: Start SAS Infrastructure Data Server Consul Template pgpool
7878
include_tasks: viya-dbct.yml
7979
vars:
8080
dbname: "{{INVOCATION_VARIABLES[inventory_hostname]['cpspgpoolc'][0]['SERVICE_NAME']|default([])}}"
8181
dbaction: startdbct
8282
dbtype: pgpool
8383
when: INVOCATION_VARIABLES[inventory_hostname]['cpspgpoolc'] is defined and INVOCATION_VARIABLES[inventory_hostname]['cpspgpoolc'][0]['HA_PGPOOL_VIRTUAL_IP'] is defined
8484

85-
- name: Start SAS Infrastructure Data Server Node Consul Template
85+
- name: Start SAS Infrastructure Data Server Consul Template node
8686
include_tasks: viya-dbct.yml
8787
vars:
8888
dbname: "{{INVOCATION_VARIABLES[inventory_hostname]['cpsdatasvrc'][0]['SERVICE_NAME']|default([])}}"
@@ -91,7 +91,10 @@
9191
when: INVOCATION_VARIABLES[inventory_hostname]['cpsdatasvrc'] is defined
9292

9393
- name: Start SAS Infrastructure Data Server
94-
include_tasks: viya-db.yml
94+
include_tasks: "{{item}}"
95+
loop:
96+
- viya-db.yml
97+
- viya-dbcheck.yml
9598
vars:
9699
dbname: "{{INVOCATION_VARIABLES[inventory_hostname]['pgpoolc'][0]['SERVICE_NAME']|default([])}}"
97100
dbaction: startdb
@@ -100,7 +103,10 @@
100103
when: INVOCATION_VARIABLES[inventory_hostname]['pgpoolc'] is defined
101104

102105
- name: Start SAS Infrastructure Data Server
103-
include_tasks: viya-db.yml
106+
include_tasks: "{{item}}"
107+
loop:
108+
- viya-db.yml
109+
- viya-dbcheck.yml
104110
vars:
105111
dbname: "{{INVOCATION_VARIABLES[inventory_hostname]['cpspgpoolc'][0]['SERVICE_NAME']|default([])}}"
106112
dbaction: startdb

playbooks/viya-mmsu/viya-services-status.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#### Author: SAS Institute Inc. ####
55
####################################################################
66
#
7-
# Copyright (c) 2019-2020, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
7+
# Copyright (c) 2019-2021, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
88
# SPDX-License-Identifier: Apache-2.0
99
#
1010
---

0 commit comments

Comments
 (0)