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

Fix Creation of AWS Sandboxes + Containerize #103

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Conversation

fridim
Copy link
Contributor

@fridim fridim commented Jan 15, 2025

The creation of new AWS sandboxes is currently broken and is a manual process that is run from different places.

  • ansible playbooks to create the accounts
  • cypress automation to enable the accounts in access.redhat.com
  • playbook again to validate the sandboxes and make sure the GOLD images there

Instead, make it possible to run it as a single OpenShift job.

Tasks:

  • Create a container image that has all the software needed for the creation of a new sandbox

  • Fix locales in Containerfile.admin

  • Create a wrapper script for automation => Python

  • Automatically guess the next sandbox number from all different DB (prod and dev)

  • Add profiling callback to ansible creation playbook runs.

  • Enable Gold images by using the new HCC (console.redhat.com) APIs instead of Cypress + access.redhat.com
    There is a transition from access.redhat.com web page to HCC (console.redhat.com)
    Advantages:

    • much much faster
    • less dependencies in the images (roughly -500MB)
  • Status script creation_status.py – list creation in progress freshly created sandbox

  • Add a --retry sandbox123 capability

  • Add alternate contact to the account

  • Toggle ansible-playbook output ON|OFF

  • Add an Org Policy to p protect anything that is required by HCC (role, …)

  • Performance: make slow task async in the playbook (low priority)

  • New feature: provide the reservation name, by default new sandboxes end up in a new reservation

  • sandboxes are created in a untested reservation first. After the functional tests, if successful, we move the new sandboxes to the target reservation (default new)

  • Create monitoring dashboard or at least scripts for the creation

  • Add a test to ensure Vault value is correct. Try to read one key with the passed vault secret. If it doesn't work, exit. That will prevent accidentally creating sandboxes with a vault different that the one currently in use for the target DB;

  • document

  • Package everything for OpenShift: use OpenShift job to run the creation

- [X] Create a container image that has all the software needed for the creation of a new sandbox
- [X] Fix Locales in Containerfile.admin
- [X] Create a wrapper script for automation => Python
- [X] Automatically guess the next sandbox number from all different DB (prod and dev)
- [X] Add profiling callback to ansible creation playbook runs.
- [X] Enable Gold images by using the new HCC (console) APIs instead of Cypress + access.redhat.com
      There is a transition from access.redhat.com web page to HCC (console.redhat.com)
      Advantages:
        - much much faster
        - less dependencies in the images (roughly -500MB)
- [X] Status script `creation_status.py`  -- list creation in progress freshly created sandbox
- [X] Add a `--retry sandbox123` capability
- [ ] Add an Org Policy to p protect anything that is required by HCC (role, ...)
- [ ] make slow task async in the playbook
- [X] New feature: provide the reservation name,  by default new sandboxes end up in a 'new' reservation
- [X] sandboxes are created in a 'untested' reservation first. After the functional tests, if successful, we move the new sandboxes to the target reservation (default 'new')
- [ ] Create monitoring dashboard or at least scripts for the creation
- [ ] Add a test to ensure Vault value is correct. Try to read one key with the passed vault secret. If it doesn't work, exit. That will prevent accidentally creating sandboxes with a vault different that the one currently in use for the 'target DB'
- [ ] allow to change the target OU
- [ ] document (upstream and confluence)
- [ ] Package everything for OpenShift: use OpenShift job to run the creation
retries: 5
delay: "{{ 60|random(start=3, step=1) }}"
retries: 10
delay: "{{ 10|random(start=3, step=1) }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This random delay does not work as expected. Unfortunately Ansible only evaluates the delay value once when starting the task rather than for each retry. So if it gets 5 it will be a 5 second delay it will be the same delay for each retry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants