Skip to content
This repository was archived by the owner on Jan 24, 2023. It is now read-only.

Commit fbf1957

Browse files
authored
Merge pull request #103 from open-ness/openness_release_2103
Openness release 2103
2 parents b3ad503 + 2db57fa commit fbf1957

File tree

452 files changed

+4892
-7571
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

452 files changed

+4892
-7571
lines changed

.ansible-lint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ exclude_paths:
1717
- roles/telemetry/opentelemetry/controlplane/charts
1818
- roles/bb_config/charts
1919
- cloud
20+
- inventory.yml

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/biosfw/
22
/logs/
33
*.pyc
4-
/group_vars/*/30_*_flavor.yml
4+
/inventory/default/group_vars/*/30_*_flavor.yml
5+
/inventory/automated/

Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright (c) 2021 Intel Corporation
3+
4+
# Provide `ANSIBLE_LINT_VERBOSITY=-v make ansible-lint` to enable verbose output.
5+
# Switch required to verify CI.
6+
ANSIBLE_LINT_ARGS?=
7+
PIPENV_INSTALL_ARGS?=--user
8+
PIPENV_VERSION?=2020.11.15
9+
10+
install-dependencies:
11+
pip install $(PIPENV_INSTALL_ARGS) pipenv==$(PIPENV_VERSION)
12+
pipenv sync
13+
14+
lint: ansible-lint pylint shellcheck
15+
16+
ansible-lint:
17+
@pipenv run ansible-lint --version || (echo "pipenv is required, please run 'make install-dependencies'"; exit 1)
18+
pipenv run ansible-lint network_edge*.yml single_node_network_edge.yml --parseable-severity -c .ansible-lint $(ANSIBLE_LINT_VERBOSITY)
19+
20+
pylint:
21+
@pipenv run pylint --version || (echo "pipenv is required, please run 'make install-dependencies'"; exit 1)
22+
find . -type f -name "*.py" | xargs pipenv run pylint
23+
24+
shellcheck:
25+
@shellcheck --version || (echo "shellcheck is required, please install it from https://github.com/koalaman/shellcheck/releases/download/v0.7.1/shellcheck-v0.7.1.linux.x86_64.tar.xz"; exit 1)
26+
find . -type f -name "*.sh" | xargs shellcheck

Pipfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright (c) 2021 Intel Corporation
3+
4+
[[source]]
5+
url = "https://pypi.python.org/simple"
6+
verify_ssl = true
7+
name = "pypi"
8+
9+
[packages]
10+
ansible = "==2.9.18"
11+
ansible-lint = "==4.2.0"
12+
jinja2 = "==2.11.3"
13+
pylint = "==2.7.2"
14+
netaddr = "==0.7.18"
15+
sh = "==1.14.1"
16+
# Force 3.2 due to security vulnabilities in 3.4.6
17+
cryptography = "==3.2"
18+
19+
[requires]
20+
python_version = "3.6"

Pipfile.lock

Lines changed: 395 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ SPDX-License-Identifier: Apache-2.0
33
Copyright (c) 2019 Intel Corporation
44
```
55

6-
For documentation please refer to https://github.com/open-ness/specs/blob/master/doc/getting-started/openness-experience-kits.md
6+
For documentation please refer to https://github.com/open-ness/specs/blob/master/doc/getting-started/converged-edge-experience-kits.md

action_plugins/yum.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def get_variable(self, arg):
5050
return def_val.get('value')
5151

5252
def run(self, tmp=None, task_vars=None):
53-
super(ActionModule, self).run(tmp, task_vars)
53+
# NOTE: pylint disable used here to keep the Python 2 support.
54+
super(ActionModule, self).run(tmp, task_vars) # pylint: disable=bad-option-value,super-with-arguments
5455
self.module_args = self._task.args.copy()
5556
self.task_vars = task_vars
5657

ansible.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
[defaults]
55
host_key_checking = False
66
show_custom_stats = True
7+
callback_whitelist = profile_roles
78
stdout_callback = debug
9+
roles_path = ./roles
10+
timeout = 60
811

912
[connection]
1013
pipelining = True

deploy_ne.sh renamed to auto_val.sh

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
# Usage:
77
# Regular Network Edge mode:
8-
# ./deploy_ne.sh [-f <flavor>] deploy both controller & nodes
9-
# ./deploy_ne.sh [-f <flavor>] c[ontroller] deploy only controller
10-
# ./deploy_ne.sh [-f <flavor>] n[odes] deploy only nodes
8+
# ./auto_val.sh -f <flavor> deploy both controller & nodes
9+
# ./auto_val.sh -f <flavor> c[ontroller] deploy only controller
10+
# ./auto_val.sh -f <flavor> n[odes] deploy only nodes
1111
#
1212
# Single-node cluster:
13-
# ./deploy_ne.sh [-f <flavor>] s[ingle] deploy single-node cluster playbook
13+
# ./auto_val.sh -f <flavor> s[ingle] deploy single-node cluster playbook
1414

15-
set -eu
15+
set -euxo pipefail
1616

1717
source scripts/ansible-precheck.sh
1818
source scripts/task_log_file.sh
@@ -33,11 +33,13 @@ done
3333
shift $((OPTIND-1))
3434

3535
# Remove all previous flavors
36-
find "${PWD}/group_vars/" -type l -name "30_*_flavor.yml" -delete
36+
find "${PWD}/inventory/default/group_vars/" -type l -name "30_*_flavor.yml" -delete
3737

3838
if [[ -z "${flavor}" ]]; then
39-
echo "No flavor provided"
40-
echo -e " $0 [-f <flavor>] <filter>. Available flavors: $(ls -m flavors)"
39+
echo "No flavor provided, please choose specific flavor"
40+
echo -e " $0 -f <flavor> <filter>"
41+
echo "Available flavors: minimal, $(ls -m flavors -I minimal)"
42+
exit 1
4143
else
4244
flavor_path="${PWD}/flavors/${flavor}"
4345
if [[ ! -d "${flavor_path}" ]]; then
@@ -48,10 +50,10 @@ else
4850
for f in "${flavor_path}"/*.yml
4951
do
5052
fname=$(basename "${f}" .yml)
51-
dir="${PWD}/group_vars/${fname}"
53+
dir="${PWD}/inventory/default/group_vars/${fname}"
5254
if [[ ! -d "${dir}" ]]; then
5355
echo "${f} does not match a directory in group_vars:"
54-
ls "${PWD}/group_vars/"
56+
ls "${PWD}/inventory/default/group_vars/"
5557
exit 1
5658
fi
5759
ln -sfn "${f}" "${dir}/30_${flavor}_flavor.yml"
@@ -61,19 +63,19 @@ fi
6163
limit=""
6264
filter="${1:-}"
6365

66+
playbook="network_edge.yml"
67+
6468
if [[ "${filter}" == s* ]]; then
6569
playbook="single_node_network_edge.yml"
6670
elif [[ "${flavor}" == central_orchestrator ]]; then
67-
playbook="network_edge_orchestrator.yml"
6871
limit=$(get_limit "c")
6972
else
70-
playbook="network_edge.yml"
7173
limit=$(get_limit "${filter}")
7274
fi
7375

7476
eval ansible-playbook -vv \
7577
"${playbook}" \
76-
--inventory inventory.ini "${limit}"
78+
--inventory inventory/default/inventory.ini "${limit}"
7779

7880
if ! python3 scripts/log_all.py; then
7981
echo "[Warning] Log collection failed"

cleanup_ne.sh renamed to auto_val_cleanup.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
# SPDX-License-Identifier: Apache-2.0
44
# Copyright (c) 2019-2020 Intel Corporation
55

6+
# Usage:
7+
# Regular Network Edge mode:
8+
# ./auto_val_cleanup.sh -f <flavor> cleanup both controller & nodes
9+
# ./auto_val_cleanup.sh -f <flavor> c[ontroller] cleanup only controller
10+
# ./auto_val_cleanup.sh -f <flavor> n[odes] cleanup only nodes
11+
612
source scripts/ansible-precheck.sh
713
source scripts/task_log_file.sh
814
source scripts/parse_args.sh
@@ -22,11 +28,13 @@ done
2228
shift $((OPTIND-1))
2329

2430
# Remove all previous flavors
25-
find "${PWD}/group_vars/" -type l -name "30_*_flavor.yml" -delete
31+
find "${PWD}/inventory/default/group_vars/" -type l -name "30_*_flavor.yml" -delete
2632

2733
if [[ -z "${flavor}" ]]; then
2834
echo "No flavor provided"
29-
echo -e " $0 [-f <flavor>] <filter>. Available flavors: $(ls -m flavors)"
35+
echo -e " $0 -f <flavor> <filter>"
36+
echo "Available flavors: minimal, $(ls -m flavors -I minimal)"
37+
exit 1
3038
else
3139
flavor_path="${PWD}/flavors/${flavor}"
3240
if [[ ! -d "${flavor_path}" ]]; then
@@ -37,7 +45,7 @@ else
3745
for f in "${flavor_path}"/*.yml
3846
do
3947
fname=$(basename "${f}" .yml)
40-
dir="${PWD}/group_vars/${fname}"
48+
dir="${PWD}/inventory/default/group_vars/${fname}"
4149
if [[ -f "${dir}/30_${flavor}_flavor.yml" ]]; then
4250
rm -f "${dir}/30_${flavor}_flavor.yml"
4351
fi
@@ -47,14 +55,14 @@ fi
4755
limit=""
4856
filter="${1:-}"
4957

58+
playbook="network_edge_cleanup.yml"
59+
5060
if [[ "${flavor}" == central_orchestrator ]]; then
51-
playbook="network_edge_orchestrator_cleanup.yml"
5261
limit=$(get_limit "c")
5362
else
54-
playbook="network_edge_cleanup.yml"
5563
limit=$(get_limit "${filter}")
5664
fi
5765

5866
eval ansible-playbook -vv \
5967
"${playbook}" \
60-
--inventory inventory.ini "${limit}"
68+
--inventory inventory/default/inventory.ini "${limit}"

0 commit comments

Comments
 (0)