Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Optimize downloading requirements introducing file checksums, use Python instead of Bash #805

Closed
10 of 18 tasks
to-bar opened this issue Dec 30, 2019 · 4 comments
Assignees

Comments

@to-bar
Copy link
Contributor

to-bar commented Dec 30, 2019

Is your feature request related to a problem? Please describe.

  1. Downloading all requirements takes about 12 min (Azure RHEL), sometimes longer.
  2. Each time Epiphany downloads all requirements, there is no option to download only required ones - e.g. if there is no Ignite component enabled, its heavy binary is downloaded unnecessarily.
  3. requirements.txt file doesn't contain files' checksums so we are not able to check if existing file was fully downloaded or it's corrupted. For this reason, files are re-downloaded each time (for RHEL) or may be corrupted (for Ubuntu).
  4. requirements.txt file in current format doesn't allow to have flexible (structured) configuration (for checksums or dependencies).
  5. We have redundant code so if you want to make a change in download-requirements.sh you may need to do it for every OS directory.

Describe the solution you'd like

  1. Download any file only once. If exists, compare chechsums. If checksums differs, then re-download.
  2. Switch from txt files with custom format to YAML.
  3. Support 2 download modes: full (current solution) and adaptive (download only files required by enabled components).
  4. Support multiple repositories for the same package.
  5. Use the same code for all OS distribution when possible.
  6. Support retries for network related tasks which may succeed on another try.
  7. Ansible seems to meet the above requirements.

DoD checklist

  • Changelog
    • updated
    • not needed
  • COMPONENTS.md
    • updated
    • not needed
  • Schema
    • updated
    • not needed
  • Backport tasks
    • created
    • not needed
  • Documentation
    • added
    • updated
    • not needed
  • Feature has automated tests
  • Automated tests passed (QA pipelines)
    • apply
    • upgrade
    • backup/restore
  • Idempotency tested
  • All conversations in PR resolved
@rafzei
Copy link
Contributor

rafzei commented Jun 9, 2021

I've check how messed this role is during #127...

We should keep consistency of the repository role for supported OS's.

Proposed structure of files directory in repository role:

repository role
- files (dir)
  - client (dir)
    - common (dir contain common files with functions)
      - common_functions.sh (example file with functions for all OSs)
      - ...
    - debian.sh (this file should source common functions)
    - redhat.sh (same)
  - download-requirements (dir)
    - common (dir contain common files with functions)
      - common_functions.sh (example file with functions for all OSs)
    - centos-7
      - download-requirements.sh (this file should source common functions)
      - requirements.<arch>.txt
    - redhad-7
      - ...
    - ubuntu-18.04
      - ...
  - server
    - ... (same as above)

@rafzei rafzei changed the title Optimize repository role - common code for RHEL and CentOS where possible [FEATURE REQUEST] Optimize repository role - common code for RHEL and CentOS where possible Jun 9, 2021
@rafzei
Copy link
Contributor

rafzei commented Jun 10, 2021

#2378 , #804 Can be done parallel

@mkyc mkyc added this to the S20210701 milestone Jun 18, 2021
@rafzei
Copy link
Contributor

rafzei commented Jun 22, 2021

I was discussing with @to-bar the possibilities of refactoring this role. We agreed that if possible, download-requirements should be rewritten to python. It will give us the possibility to keep requirements.txt in a more structured file type like JSON. Another thing we should consider is adding md5sum to this file, so we will be able to verify if file was downloaded successfully and skip re-downloading in case of re-apply.

@mkyc mkyc modified the milestones: S20210701, S20210715 Jul 5, 2021
@to-bar to-bar changed the title [FEATURE REQUEST] Optimize repository role - common code for RHEL and CentOS where possible [FEATURE REQUEST] Optimize downloading requirements introducing file checksums, use Ansible instead of Bash Aug 5, 2021
@sbbroot sbbroot self-assigned this Nov 5, 2021
sbbroot added a commit to sbbroot/epiphany that referenced this issue Nov 29, 2021
@mkyc mkyc unassigned sbbroot Dec 3, 2021
@romsok24
Copy link
Contributor

romsok24 commented Dec 9, 2021

#2778 is related.

sbbroot added a commit to sbbroot/epiphany that referenced this issue Jan 17, 2022
* rsync added to the Dockerfile

* add rsync to devcontainer

* files, images and crane moved to separate files

* added yaml
sbbroot added a commit to sbbroot/epiphany that referenced this issue Jan 17, 2022
* rsync added to the Dockerfile

* add rsync to devcontainer

* files, images and crane moved to separate files

* added yaml
sbbroot added a commit to sbbroot/epiphany that referenced this issue Jan 18, 2022
* rsync added to the Dockerfile

* add rsync to devcontainer

* files, images and crane moved to separate files

* added yaml
sbbroot added a commit to sbbroot/epiphany that referenced this issue Jan 19, 2022
* rsync added to the Dockerfile

* add rsync to devcontainer

* files, images and crane moved to separate files

* added yaml
@seriva seriva added the priority/high Task with high priority label Jan 20, 2022
sbbroot added a commit to sbbroot/epiphany that referenced this issue Jan 20, 2022
* rsync added to the Dockerfile

* add rsync to devcontainer

* files, images and crane moved to separate files

* added yaml
sbbroot added a commit to sbbroot/epiphany that referenced this issue Jan 25, 2022
* rsync added to the Dockerfile

* add rsync to devcontainer

* files, images and crane moved to separate files

* added yaml
sbbroot added a commit to sbbroot/epiphany that referenced this issue Jan 26, 2022
* rsync added to the Dockerfile

* add rsync to devcontainer

* files, images and crane moved to separate files

* added yaml
sbbroot added a commit to sbbroot/epiphany that referenced this issue Jan 26, 2022
* rsync added to the Dockerfile

* add rsync to devcontainer

* files, images and crane moved to separate files

* added yaml
sbbroot added a commit to sbbroot/epiphany that referenced this issue Jan 26, 2022
* rsync added to the Dockerfile

* add rsync to devcontainer

* files, images and crane moved to separate files

* added yaml
sbbroot added a commit to sbbroot/epiphany that referenced this issue Feb 1, 2022
* rsync added to the Dockerfile

* add rsync to devcontainer

* files, images and crane moved to separate files

* added yaml
sbbroot added a commit to sbbroot/epiphany that referenced this issue Feb 10, 2022
* rsync added to the Dockerfile

* add rsync to devcontainer

* files, images and crane moved to separate files

* added yaml
sbbroot added a commit to sbbroot/epiphany that referenced this issue Feb 11, 2022
* rsync added to the Dockerfile

* add rsync to devcontainer

* files, images and crane moved to separate files

* added yaml
sbbroot added a commit to sbbroot/epiphany that referenced this issue Feb 17, 2022
* rsync added to the Dockerfile

* add rsync to devcontainer

* files, images and crane moved to separate files

* added yaml
sbbroot added a commit to sbbroot/epiphany that referenced this issue Feb 17, 2022
* rsync added to the Dockerfile

* add rsync to devcontainer

* files, images and crane moved to separate files

* added yaml
@przemyslavic przemyslavic self-assigned this Feb 18, 2022
sbbroot added a commit that referenced this issue Feb 22, 2022
* Implement new download requirements script (#805)

* rsync added to the Dockerfile

* add rsync to devcontainer

* files, images, packages and crane moved to separate files

* added yaml support
@seriva seriva changed the title [FEATURE REQUEST] Optimize downloading requirements introducing file checksums, use Ansible instead of Bash [FEATURE REQUEST] Optimize downloading requirements introducing file checksums, use Python instead of Bash Feb 28, 2022
@seriva seriva closed this as completed Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants