-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[2.0.1] Adaptive mode for downloading requirements (#3188)
* Split available_roles and roles_mapping into separate yaml documents (#3097) (#3119) * available_roles splitted into feature-mappings and features documents * feature-mappings added to the Init by default * Add manifest file parsing (#3105) (#3130) * Add `-m/--manifest` flag to accept manifest.yml produced by `epicli init/prepare` * Add `-v/--verbose` mode for printing out parsed manifest data * Add ManifestReader class used for paring the manifest.yml file * Move src/command/*.py to debian/redhat subdirs where needed * Optimize Grafana dashboards downloading (#3131) (#3150) * Optimize files downloading (#3116) (#3156) * Add image-registry configuration reading (#3106) (#3159)
- Loading branch information
Showing
67 changed files
with
2,717 additions
and
717 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from typing import Any, Dict, List | ||
|
||
|
||
class FilterModule: | ||
""" Filters for Python's container types """ | ||
|
||
def filters(self): | ||
return { | ||
'dict_to_list': self.dict_to_list | ||
} | ||
|
||
def dict_to_list(self, data: Dict, only_values: bool = False, only_keys: bool = False) -> List: | ||
""" | ||
Convert dict to list without using Ansible's loop mechanism with dict2items filter. | ||
:param data: to be converted into a list | ||
:param only_values: construct list with only dict's values | ||
:param only_keys: construct list with only dict's keys | ||
:return: data transformed into a list | ||
""" | ||
if only_values: | ||
return list(data.values()) | ||
|
||
if only_keys: | ||
return list(data.keys()) | ||
|
||
return list(data.items()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
# This playbook is empty by purpose, just to enable repository role in configuration/feature-mapping | ||
# This playbook is empty by purpose, just to enable repository role in configuration/features | ||
# to populate defaults/configuration to Ansible vars | ||
- hosts: "!all" | ||
tasks: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,9 @@ | ||
--- | ||
- name: Get file listing | ||
uri: | ||
method: GET | ||
url: "{{ repository_url }}/files/?F=0" # F=0 formats the listing as a simple list (not FancyIndexed) | ||
body_format: raw | ||
return_content: true | ||
validate_certs: "{{ validate_certs | default(false, true) | bool }}" # handling "undefined", "null", "empty" and "boolean" values all at once | ||
register: uri_list_files | ||
until: uri_list_files is success | ||
retries: 3 | ||
delay: 2 | ||
become: false | ||
- name: Get files list from the repository | ||
include_tasks: list_requirements.yml | ||
vars: | ||
_requirements: files | ||
|
||
# TODO: make it work with yaml or json (instead of html, sic!). | ||
- name: Parse html response and return file listing | ||
- name: Set files in repository as fact | ||
set_fact: | ||
list_files_result: >- | ||
{{ lines | select('match', regexp) | ||
| reject('match', '.*Parent Directory.*') | ||
| map('regex_replace', regexp, '\1') | ||
| list }} | ||
vars: | ||
lines: "{{ uri_list_files.content.splitlines() }}" | ||
regexp: '.*<li><a href="([^"]+)".*' | ||
list_files_result: "{{ list_requirements_result }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
- name: Get images list from the repository | ||
include_tasks: list_requirements.yml | ||
vars: | ||
_requirements: images | ||
|
||
- name: Set images in repository as fact | ||
set_fact: | ||
list_images_result: "{{ list_requirements_result }}" |
25 changes: 25 additions & 0 deletions
25
ansible/playbooks/roles/download/tasks/list_requirements.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
- name: Get requirements listing | ||
uri: | ||
method: GET | ||
url: "{{ repository_url }}/{{ _requirements }}/?F=0" # F=0 formats the listing as a simple list (not FancyIndexed) | ||
body_format: raw | ||
return_content: true | ||
validate_certs: "{{ validate_certs | default(false, true) | bool }}" # handling "undefined", "null", "empty" and "boolean" values all at once | ||
register: uri_list_files | ||
until: uri_list_files is success | ||
retries: 3 | ||
delay: 2 | ||
become: false | ||
|
||
# TODO: make it work with yaml or json (instead of html, sic!). | ||
- name: Parse html response and return requirements listing | ||
set_fact: | ||
list_requirements_result: >- | ||
{{ lines | select('match', regexp) | ||
| reject('match', '.*Parent Directory.*') | ||
| map('regex_replace', regexp, '\1') | ||
| list }} | ||
vars: | ||
lines: "{{ uri_list_files.content.splitlines() }}" | ||
regexp: '.*<li><a href="([^"]+)".*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,4 +59,3 @@ certificates: | |
ports: | ||
http: 9200 | ||
transport: 9300 | ||
log4j_file_name: apache-log4j-2.17.1-bin.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
download_requirements_dir: "/var/tmp/epi-download-requirements" | ||
download_requirements_script: "{{ download_requirements_dir }}/download-requirements.py" | ||
download_requirements_flag: "{{ download_requirements_dir }}/download-requirements-done.flag" | ||
download_requirements_manifest: "{{ download_requirements_dir }}/manifest.yml" | ||
download_requirements_script: "{{ download_requirements_dir }}/download-requirements.py" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 45 additions & 43 deletions
88
...le/playbooks/roles/repository/files/download-requirements/requirements/aarch64/images.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,64 @@ | ||
--- | ||
images: | ||
'haproxy:2.2.2-alpine': | ||
sha1: 2fd3bd554ee6e126a1b1e5055ed0349beac81ffc | ||
haproxy: | ||
'haproxy:2.2.2-alpine': | ||
sha1: 2fd3bd554ee6e126a1b1e5055ed0349beac81ffc | ||
|
||
'kubernetesui/dashboard:v2.3.1': | ||
sha1: 5dc90f59af4643952d5a728213983e6f3d884895 | ||
image-registry: | ||
'registry:2.8.0': | ||
sha1: c6cdd738fbdd2efaef9588b439fc3a7c0c090368 | ||
allow_mismatch: true | ||
|
||
'kubernetesui/metrics-scraper:v1.0.7': | ||
sha1: 90b57b399e7ed44bad422e7d9572bfd6d737724a | ||
applications: | ||
'epiphanyplatform/keycloak:14.0.0': | ||
sha1: c73be9d38580fc9819bec8942e2d2569196547e1 | ||
|
||
'registry:2.8.0': | ||
sha1: c6cdd738fbdd2efaef9588b439fc3a7c0c090368 | ||
allow_mismatch: true | ||
'rabbitmq:3.8.9': | ||
sha1: 854d06bae1ee7e3a94570e1ce104618430988f57 | ||
|
||
# applications | ||
'epiphanyplatform/keycloak:14.0.0': | ||
sha1: c73be9d38580fc9819bec8942e2d2569196547e1 | ||
kubernetes-master: | ||
'kubernetesui/dashboard:v2.3.1': | ||
sha1: 5dc90f59af4643952d5a728213983e6f3d884895 | ||
|
||
'rabbitmq:3.8.9': | ||
sha1: 854d06bae1ee7e3a94570e1ce104618430988f57 | ||
'kubernetesui/metrics-scraper:v1.0.7': | ||
sha1: 90b57b399e7ed44bad422e7d9572bfd6d737724a | ||
# K8s | ||
# v1.22.4 | ||
'k8s.gcr.io/kube-apiserver:v1.22.4': | ||
sha1: 6e101cfa4384346b45701e6dda5591a41fa5776d | ||
|
||
# K8s | ||
# v1.22.4 | ||
'k8s.gcr.io/kube-apiserver:v1.22.4': | ||
sha1: 6e101cfa4384346b45701e6dda5591a41fa5776d | ||
'k8s.gcr.io/kube-controller-manager:v1.22.4': | ||
sha1: 6561280956af24f9547dabde5758a4091558e771 | ||
|
||
'k8s.gcr.io/kube-controller-manager:v1.22.4': | ||
sha1: 6561280956af24f9547dabde5758a4091558e771 | ||
'k8s.gcr.io/kube-scheduler:v1.22.4': | ||
sha1: e224852d58ab649f3145cae3ed4f2926e66117bf | ||
|
||
'k8s.gcr.io/kube-scheduler:v1.22.4': | ||
sha1: e224852d58ab649f3145cae3ed4f2926e66117bf | ||
'k8s.gcr.io/kube-proxy:v1.22.4': | ||
sha1: 5e5e4032f3f6464ede1a4a85854013d0801c8eff | ||
|
||
'k8s.gcr.io/kube-proxy:v1.22.4': | ||
sha1: 5e5e4032f3f6464ede1a4a85854013d0801c8eff | ||
'k8s.gcr.io/coredns/coredns:v1.8.4': | ||
sha1: e5d7de1974e8f331892d9587a5312d4cdda04bb2 | ||
|
||
'k8s.gcr.io/coredns/coredns:v1.8.4': | ||
sha1: e5d7de1974e8f331892d9587a5312d4cdda04bb2 | ||
'k8s.gcr.io/etcd:3.5.0-0': | ||
sha1: fb1975ba3fc696fa7530c0752d15abe8ea23e80d | ||
|
||
'k8s.gcr.io/etcd:3.5.0-0': | ||
sha1: fb1975ba3fc696fa7530c0752d15abe8ea23e80d | ||
'k8s.gcr.io/pause:3.5': | ||
sha1: 8f3be7cc532c25b01a2e5e0943b4d55bce0b0f1c | ||
|
||
'k8s.gcr.io/pause:3.5': | ||
sha1: 8f3be7cc532c25b01a2e5e0943b4d55bce0b0f1c | ||
'quay.io/coreos/flannel:v0.14.0-arm64': | ||
sha1: 342b806ab5da6133438f925e22ced802e0e56861 | ||
|
||
'quay.io/coreos/flannel:v0.14.0-arm64': | ||
sha1: 342b806ab5da6133438f925e22ced802e0e56861 | ||
'quay.io/coreos/flannel:v0.14.0': | ||
sha1: 098ec78af9bf3a70afbd1a9743ff352f72fb036d | ||
|
||
'quay.io/coreos/flannel:v0.14.0': | ||
sha1: 098ec78af9bf3a70afbd1a9743ff352f72fb036d | ||
'calico/cni:v3.20.3': | ||
sha1: 5338d670e01558dd053768fb3cdc39c8568d6f4c | ||
|
||
'calico/cni:v3.20.3': | ||
sha1: 5338d670e01558dd053768fb3cdc39c8568d6f4c | ||
'calico/kube-controllers:v3.20.3': | ||
sha1: 24615f8f9c0cac651401cc633ba4850b8f17e175 | ||
|
||
'calico/kube-controllers:v3.20.3': | ||
sha1: 24615f8f9c0cac651401cc633ba4850b8f17e175 | ||
'calico/node:v3.20.3': | ||
sha1: c0432602b9e8dd47d3c869759f210305d9d87d90 | ||
|
||
'calico/node:v3.20.3': | ||
sha1: c0432602b9e8dd47d3c869759f210305d9d87d90 | ||
|
||
'calico/pod2daemon-flexvol:v3.20.3': | ||
sha1: 6e1e59ad1cf6af46d4ce8c8b16f4014337c22411 | ||
'calico/pod2daemon-flexvol:v3.20.3': | ||
sha1: 6e1e59ad1cf6af46d4ce8c8b16f4014337c22411 |
Oops, something went wrong.