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

Added the ec2_run to the policy runner #709

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

athiruma
Copy link
Collaborator

Type of change

Note: Fill x in []

  • bug
  • enhancement
  • documentation
  • dependencies

Description

Added the ec2_run to the policy runner

For security reasons, all pull requests need to be approved first before running any automated CI

@athiruma athiruma added bug Something isn't working ok-to-test PR ok to test labels Dec 21, 2023
@athiruma athiruma requested a review from ebattat December 21, 2023 08:58
@athiruma athiruma self-assigned this Dec 21, 2023


class Utils:
pass
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why we need it ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Another PR file, due to PR switching mistakenly added here. Removed

@@ -91,6 +91,13 @@ def get_policies(type: str = None):
os.system(f"""podman run --rm --name cloud-governance --net="host" -e EMAIL_ALERT="False" -e account="PSAP" -e MANAGER_EMAIL_ALERT="False" -e policy="{policy}" -e AWS_ACCESS_KEY_ID="{AWS_ACCESS_KEY_ID_DELETE_PSAP}" -e AWS_SECRET_ACCESS_KEY="{AWS_SECRET_ACCESS_KEY_DELETE_PSAP}" -e AWS_DEFAULT_REGION="{region}" -e dry_run="yes" -e LDAP_HOST_NAME="{LDAP_HOST_NAME}" -e special_user_mails="{special_user_mails}" -e account_admin="{account_admin}" -e es_host="{ES_HOST}" -e es_port="{ES_PORT}" {es_index_env_var} -e policy_output="s3://{BUCKET_PSAP}/{LOGS}/{region}" -e log_level="INFO" quay.io/ebattat/cloud-governance:latest""")
os.system(f"""podman run --rm --name cloud-governance --net="host" -e EMAIL_ALERT="False" -e account="PERF-SCALE" -e policy="{policy}" -e AWS_ACCESS_KEY_ID="{AWS_ACCESS_KEY_ID_DELETE_PERF_SCALE}" -e AWS_SECRET_ACCESS_KEY="{AWS_SECRET_ACCESS_KEY_DELETE_PERF_SCALE}" -e AWS_DEFAULT_REGION="{region}" -e dry_run="yes" -e LDAP_HOST_NAME="{LDAP_HOST_NAME}" -e special_user_mails="{special_user_mails}" -e account_admin="{account_admin}" -e es_host="{ES_HOST}" -e es_port="{ES_PORT}" {es_index_env_var} -e policy_output="s3://{BUCKET_PERF_SCALE}/{LOGS}/{region}" -e log_level="INFO" quay.io/ebattat/cloud-governance:latest""")

# Run the EC2 run policy
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why u add a separate code for it ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In the policy changes, if we pass the env variable *RUN_ACTIVE_REGIONS=True. It runs the policy in all active regions. Due to that, I don't have a chance to include it in the for loop, for the upcoming PR's statics regions are removed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

So why you add a whole code ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I opened this pr to resolve the ec2-run bug. Later prs i will open new pr to order the policy runs.

@ebattat
Copy link
Collaborator

ebattat commented Dec 21, 2023

@athiruma, fix conflicts

@athiruma athiruma force-pushed the organize_jenkins_policy branch from 5d30719 to b4da075 Compare December 21, 2023 13:36
@athiruma athiruma force-pushed the organize_jenkins_policy branch from b4da075 to f18b77c Compare December 21, 2023 13:38
@ebattat ebattat merged commit 34d4e95 into redhat-performance:main Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ok-to-test PR ok to test
Projects
Development

Successfully merging this pull request may close these issues.

2 participants