diff options
-rw-r--r-- | ansible/roles/nginx/defaults/main.yml | 2 | ||||
-rw-r--r-- | ansible/roles/package-repository/defaults/main.yml | 2 | ||||
-rw-r--r-- | ansible/roles/package-repository/molecule/default/tests/test_infrastructure-server.py | 2 | ||||
-rw-r--r-- | ansible/roles/package-repository/molecule/default/tests/test_kubernetes-node-1.py | 2 | ||||
-rw-r--r-- | ansible/test/roles/prepare-package-repository/tasks/main.yml | 10 | ||||
-rw-r--r-- | ansible/test/roles/prepare-package-repository/vars/main.yml | 2 | ||||
-rwxr-xr-x | build/build_nexus_blob.sh | 15 | ||||
-rwxr-xr-x | build/create_repo.sh | 6 | ||||
-rwxr-xr-x | build/docker-entrypoint.sh | 4 | ||||
-rwxr-xr-x | build/package.py | 8 | ||||
-rwxr-xr-x | config/application_configuration.yml (renamed from ansible/config/application_configuration.yml) | 0 | ||||
-rw-r--r-- | docs/BuildGuide.rst | 16 | ||||
-rw-r--r-- | docs/InstallGuide.rst | 6 |
13 files changed, 33 insertions, 42 deletions
diff --git a/ansible/roles/nginx/defaults/main.yml b/ansible/roles/nginx/defaults/main.yml index 8bf44197..c2f1e05c 100644 --- a/ansible/roles/nginx/defaults/main.yml +++ b/ansible/roles/nginx/defaults/main.yml @@ -16,7 +16,7 @@ nginx: - "{{ app_data_path }}/certs:/etc/nginx/certs:ro" - "{{ app_data_path }}/git-repo:/srv/git:rw" - "{{ app_data_path }}/http:/srv/http:rw" - - "{{ app_data_path }}/pkg/rhel:/srv/http/repo.infra-server/rhel:rw" + - "{{ app_data_path }}/pkg/rpm:/srv/http/repo.infra-server/rpm:rw" - "{{ app_data_path }}/pkg/ubuntu/xenial:/srv/http/repo.infra-server/ubuntu/xenial:rw" - /var/log/nginx:/var/log/nginx:rw # Default rule for tarball naming translation diff --git a/ansible/roles/package-repository/defaults/main.yml b/ansible/roles/package-repository/defaults/main.yml index 678b6bd4..0557eda3 100644 --- a/ansible/roles/package-repository/defaults/main.yml +++ b/ansible/roles/package-repository/defaults/main.yml @@ -3,6 +3,6 @@ package_repositories: - name: "{{ app_name }}" file: "{{ app_name | lower }}" description: "{{ app_name | upper }} offline repository" - baseurl: "{{ 'http://repo.infra-server/rhel' if 'infrastructure' not in group_names else 'file://' + app_data_path + '/pkg/rhel' }}" + baseurl: "{{ 'http://repo.infra-server/rpm' if 'infrastructure' not in group_names else 'file://' + app_data_path + '/pkg/rpm' }}" gpgcheck: false enabled: true diff --git a/ansible/roles/package-repository/molecule/default/tests/test_infrastructure-server.py b/ansible/roles/package-repository/molecule/default/tests/test_infrastructure-server.py index 63588e26..9fb1a4f9 100644 --- a/ansible/roles/package-repository/molecule/default/tests/test_infrastructure-server.py +++ b/ansible/roles/package-repository/molecule/default/tests/test_infrastructure-server.py @@ -9,7 +9,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( def test_onap_repo(host): fc = host.file('/etc/yum.repos.d/moleculetestapp.repo').content_string expected_content = """[moleculetestapp] -baseurl = file:///opt/moleculetestapp/pkg/rhel +baseurl = file:///opt/moleculetestapp/pkg/rpm enabled = 1 gpgcheck = 0 name = MOLECULETESTAPP offline repository""" diff --git a/ansible/roles/package-repository/molecule/default/tests/test_kubernetes-node-1.py b/ansible/roles/package-repository/molecule/default/tests/test_kubernetes-node-1.py index eab7d065..fda85e8d 100644 --- a/ansible/roles/package-repository/molecule/default/tests/test_kubernetes-node-1.py +++ b/ansible/roles/package-repository/molecule/default/tests/test_kubernetes-node-1.py @@ -9,7 +9,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( def test_onap_repo(host): fc = host.file('/etc/yum.repos.d/moleculetestapp.repo').content_string expected_content = """[moleculetestapp] -baseurl = http://repo.infra-server/rhel +baseurl = http://repo.infra-server/rpm enabled = 1 gpgcheck = 0 name = MOLECULETESTAPP offline repository""" diff --git a/ansible/test/roles/prepare-package-repository/tasks/main.yml b/ansible/test/roles/prepare-package-repository/tasks/main.yml index 66f81d6d..983e9766 100644 --- a/ansible/test/roles/prepare-package-repository/tasks/main.yml +++ b/ansible/test/roles/prepare-package-repository/tasks/main.yml @@ -12,15 +12,15 @@ name: createrepo state: present -- name: "Ensure {{ rhel_pkg_dir }} exists" +- name: "Ensure {{ pkg_dir }} exists" file: - path: "{{ rhel_pkg_dir }}" + path: "{{ pkg_dir }}" state: directory - name: Download rpm packages - command: "yumdownloader --destdir={{ rhel_pkg_dir }} --resolve {{ packages | join(' ') }}" + command: "yumdownloader --destdir={{ pkg_dir }} --resolve {{ packages | join(' ') }}" - name: Index repository - command: "createrepo {{ rhel_pkg_dir }}" + command: "createrepo {{ pkg_dir }}" args: - creates: "{{ rhel_pkg_dir }}/repodata" + creates: "{{ pkg_dir }}/repodata" diff --git a/ansible/test/roles/prepare-package-repository/vars/main.yml b/ansible/test/roles/prepare-package-repository/vars/main.yml index 80944284..195ad0f1 100644 --- a/ansible/test/roles/prepare-package-repository/vars/main.yml +++ b/ansible/test/roles/prepare-package-repository/vars/main.yml @@ -1,5 +1,5 @@ --- -rhel_pkg_dir: "{{ app_data_path }}/pkg/rhel" +pkg_dir: "{{ app_data_path }}/pkg/rpm" packages: - "docker-ce-18.09.5" - container-selinux diff --git a/build/build_nexus_blob.sh b/build/build_nexus_blob.sh index 72dda540..688410ef 100755 --- a/build/build_nexus_blob.sh +++ b/build/build_nexus_blob.sh @@ -212,32 +212,33 @@ push_docker () { while [ "${1}" != "" ]; do case ${1} in -d | --docker ) shift - NXS_DOCKER_IMG_LISTS+=("${1}") + NXS_DOCKER_IMG_LISTS+=("$(realpath ${1})") ;; -i | --input-directory ) shift - DATA_DIR="${1}" + DATA_DIR="$(realpath ${1})" ;; -ld | --load-docker-images ) DOCKER_LOAD="true" ;; -n | --npm ) NPM_PUSH="true" COMMANDS+=(expect npm) shift - NXS_NPM_LISTS+=("${1}") + NXS_NPM_LISTS+=("$(realpath ${1})") ;; -o | --output-directory ) shift - NEXUS_DATA_DIR="${1}" + NEXUS_DATA_DIR="$(realpath ${1})" ;; -p | --pypi ) PYPI_PUSH="true" COMMANDS+=(twine) shift - NXS_PYPI_LISTS+=("${1}") + NXS_PYPI_LISTS+=("$(realpath ${1})") ;; -rl | --resource-list-directory ) shift - LISTS_DIR="${1}" + LISTS_DIR="$(realpath ${1})" ;; -h | --help ) usage ;; *) usage + ;; esac shift done @@ -445,4 +446,4 @@ if [ -f ~/.docker/${DOCKER_CONF_BACKUP} ]; then fi echo "Nexus blob is built" -exit 0
\ No newline at end of file +exit 0 diff --git a/build/create_repo.sh b/build/create_repo.sh index b6db6ad2..eaf0ee30 100755 --- a/build/create_repo.sh +++ b/build/create_repo.sh @@ -12,7 +12,7 @@ container_repo_volume="/mnt/repo/" # Docker image name and version docker_image="centos:centos7.6.1810" # Expected directory for RPM packages -expected_dir="resources/pkg/rhel" +expected_dir="resources/pkg/rpm" help () { echo "Script for run docker container with RPM repository" @@ -56,10 +56,10 @@ do shift;shift done -# Check if path contains expected path "resources/pkg/rhel" +# Check if path contains expected path "resources/pkg/rpm" if ! [[ "/$volume_repo_directory/" = *"/$expected_dir/"* ]]; then # Create repo folder if it not exists - volume_repo_directory="$volume_repo_directory"/resources/pkg/rhel + volume_repo_directory="$volume_repo_directory"/resources/pkg/rpm [ ! -d "$volume_repo_directory" ] && mkdir -p $volume_repo_directory fi diff --git a/build/docker-entrypoint.sh b/build/docker-entrypoint.sh index 1b4ec53c..14f6aaa7 100755 --- a/build/docker-entrypoint.sh +++ b/build/docker-entrypoint.sh @@ -14,7 +14,7 @@ help () { echo -e "-l --list: set path where rpm list is stored in container\n" echo "Both paths have to be set with shared volume between" echo "container and host computer. Default path in container is: /tmp/" - echo "Repository will be created at: /<path>/resources/pkg/rhel/" + echo "Repository will be created at: /<path>/resources/pkg/rpm/" echo "RMP list is stored at: ./data_list/" } @@ -52,7 +52,7 @@ do done # Testing if directory parametter was used -# If not variable is sets to default value /tmp/repo/resources/pkg/rhel +# If not variable is sets to default value /tmp/repo/resources/pkg/rpm if test -z "$OFFLINE_REPO_DIR" then OFFLINE_REPO_DIR="/tmp/repo/" diff --git a/build/package.py b/build/package.py index f3b42eb0..47f78b87 100755 --- a/build/package.py +++ b/build/package.py @@ -112,7 +112,6 @@ def build_offline_deliverables(build_version, application_charts_dir, application_configuration, application_patch_role, - inventory_file, output_dir, resources_directory, aux_directory, @@ -129,7 +128,6 @@ def build_offline_deliverables(build_version, :param application_charts_dir: path to directory under application repository containing helm charts :param application_configuration: path to application configuration file (helm override configuration) :param application_patch_role: path to application patch role (executed just before helm deploy) - :param inventory_file: path to ansible inventory file :param output_dir: Destination directory for saving packages :param resources_directory: Path to resource directory :param aux_directory: Path to aux binary directory @@ -164,7 +162,6 @@ def build_offline_deliverables(build_version, os.path.join(offline_repository_dir, 'ansible'): 'ansible', application_configuration: 'ansible/application/application_configuration.yml', application_patch_role: 'ansible/application/onap-patch-role', - inventory_file: 'ansible/application/hosts.yml', os.path.join(application_dir, application_charts_dir): 'ansible/application/helm_charts', info_file: 'package.info' } @@ -245,12 +242,10 @@ def run_cli(): default='kubernetes') parser.add_argument('--application-configuration', help='path to application configuration file (helm override configuration)', - default=os.path.join(offline_repository_dir, 'ansible/config/application_configuration.yml')) + default=os.path.join(offline_repository_dir, 'config/application_configuration.yml')) parser.add_argument('--application-patch-role', help='path to application patch role file (ansible role) to be executed right before installation', default='') - parser.add_argument('--inventory-file', help="path to ansible inventory file", - default=os.path.join(offline_repository_dir, 'ansible/inventory/hosts.yml')) parser.add_argument('--output-dir', '-o', default=os.path.join(offline_repository_dir, '../packages'), help='Destination directory for saving packages') parser.add_argument('--resources-directory', default=os.path.join(offline_repository_dir, '../resources'), @@ -281,7 +276,6 @@ def run_cli(): args.application_charts_dir, args.application_configuration, args.application_patch_role, - args.inventory_file, args.output_dir, args.resources_directory, args.aux_directory, diff --git a/ansible/config/application_configuration.yml b/config/application_configuration.yml index 0c082867..0c082867 100755 --- a/ansible/config/application_configuration.yml +++ b/config/application_configuration.yml diff --git a/docs/BuildGuide.rst b/docs/BuildGuide.rst index d0a558ba..27c0835e 100644 --- a/docs/BuildGuide.rst +++ b/docs/BuildGuide.rst @@ -128,18 +128,14 @@ so one might try following command to download most of the required artifacts in :: # following arguments are provided - # all data lists are taken from ./build/data_lists/ folder + # all data lists are taken in ./build/data_lists/ folder # all resources will be stored in expected folder structure within ../resources folder ./build/download/download.py --docker ./build/data_lists/infra_docker_images.list ../resources/offline_data/docker_images_infra \ - --http ./build/data_lists/infra_bin_utils.list ../resources/downloads - - # following docker images does not neccessary need to be stored under resources as they load into repository in next part - # if second argument for --docker is not present, images are just pulled and cached. - # Warning: script must be run twice separately, for more details run download.py --help - ./build/download/download.py --docker ./build/data_lists/rke_docker_images.list \ + --docker ./build/data_lists/rke_docker_images.list \ --docker ./build/data_lists/k8s_docker_images.list \ --docker ./build/data_lists/onap_docker_images.list \ + --http ./build/data_lists/infra_bin_utils.list ../resources/downloads Alternatively, step-by-step procedure is described in Appendix 1. @@ -152,7 +148,7 @@ Part 3. Populate local nexus Prerequisites: - All data lists and resources which are pushed to local nexus repository are available -- Following ports are not occupied by another service: 80, 8081, 8082, 10001 +- Following ports are not occupied buy another service: 80, 8081, 8082, 10001 - There's no docker container called "nexus" .. note:: In case you skipped the Part 2 for the artifacts download, please ensure that the onap docker images are cached and copy of resources data are untarred in *./onap-offline/../resources/* @@ -189,13 +185,13 @@ From onap-offline directory run: :: - ./build/package.py <helm charts repo> --build-version <version> --application-repository_reference <commit/tag/branch> --output-dir <target\_dir> --resources-directory <target\_dir> + ./build/package.py <helm charts repo> --build_version "" --application-repository_reference <commit/tag/branch> --output-dir <target\_dir> --resources-directory <target\_dir> For example: :: - ./build/package.py https://gerrit.onap.org/r/oom --application-repository_reference master --output-dir /tmp/packages --resources-directory /tmp/resources + ./build/package.py https://gerrit.onap.org/r/oom --build_version "" --application-repository_reference master --output-dir /tmp/packages --resources-directory /tmp/resources In the target directory you should find tar files: diff --git a/docs/InstallGuide.rst b/docs/InstallGuide.rst index 947cd727..9239cad9 100644 --- a/docs/InstallGuide.rst +++ b/docs/InstallGuide.rst @@ -233,7 +233,7 @@ After all the changes, the ``'hosts.yml'`` should look similar to this:: infrastructure: hosts: infrastructure-server: - ansible_host: 10.8.8.100 + ansible_host: 10.8.8.13 #IP used for communication between infra and kubernetes nodes, must be specified. cluster_ip: 10.8.8.100 @@ -326,7 +326,7 @@ Second one controls time zone setting on host. It's value should be time zone na Final configuration can resemble the following:: resources_dir: /data - resources_filename: resources_package.tar + resources_filename: resources-package.tar app_data_path: /opt/onap app_name: onap timesync: @@ -432,7 +432,7 @@ Part 4. Post-installation and troubleshooting After all of the playbooks are run successfully, it will still take a lot of time until all pods are up and running. You can monitor your newly created kubernetes cluster for example like this:: - $ ssh -i ~/.ssh/offline_ssh_key root@10.8.8.100 # tailor this command to connect to your infra-node + $ ssh -i ~/.ssh/offline_ssh_key root@10.8.8.4 # tailor this command to connect to your infra-node $ watch -d -n 5 'kubectl get pods --all-namespaces' Alternatively you can monitor progress with ``helm_deployment_status.py`` script located in offline-installer directory. Transfer it to infra-node and run:: |