-
Notifications
You must be signed in to change notification settings - Fork 20
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
Infrastructure Deployment API implementation #16
Conversation
I was wondering if "api" folder should be renamed "plugin", this is not actually containing the API but the implementations so probably plugin is more appropriate, thoughts? |
crc-cloud.sh
Outdated
# check AWS credentials | ||
[[ -z $AWS_ACCESS_KEY_ID ]] && stop_if_failed 1 "AWS_ACCESS_KEY_ID must be set, please refer to AWS CLI documentation https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html" | ||
[[ -z $AWS_SECRET_ACCESS_KEY ]] && stop_if_failed 1 "AWS_ACCESS_KEY_ID must be set, please refer to AWS CLI documentation https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html" | ||
[[ -z $AWS_DEFAULT_REGION ]] && stop_if_failed 1 "AWS_ACCESS_KEY_ID must be set, please refer to AWS CLI documentation https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html" | ||
[[ ( $WORKING_MODE == "T" ) && ($TEARDOWN_RUN_ID == "latest") ]] && stop_if_failed 1 "TEARDOWN_RUN_ID must be set in container mode. Please set this value with the run id that you want to teardown, refer to README.md for further instructions" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this logic be part of deployer/bash-aws/main.sh
otherwise adding more provider means we have to again use a logic to parse those. Instead crc-cloud.sh
should be just entry point and require deployer
and platform
as of now default deployer can be bash
and platform
can be aws
but if we able to make this separation now then it would be easy to rebase the gcp
and openstack
PR on top of it.
Also I will create another PR from the commits of gcp provider PR which doesn't have any implementation around cloud provider but just some fix and breaking the logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I missed it!
I have create #17 which should be in and then this PR need to be rebased to make sure we have proper logic to add new cloud providers. |
… bug in main script related to plugin loading argument
@@ -302,6 +300,8 @@ else | |||
|
|||
fi | |||
|
|||
## LOAD DEPLOYER API | |||
api_load_deployer $DEPLOYER_API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the position of this call was wrong, was loading the plugin before the -D argument was parsed resulting on always loading the default plugin
It is a good habit to have one commit (as atomic as possible) per PR. The following are just a few reasons why it is a good habit:
|
A general question: is there a need for supporting multiple bootstrapping technologies? I am asking it because in my sense this project should be opinionated about the technology. |
You're right, I had to open this PR as a draft. It's actually a huge change that touched several parts of the code so even if made a single commit the review could have been not so comfortable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to reconsider the approach of supporting multiple backend bootstrapping technologies
Closing this PR since we are going to use the pulumi and that would be default |
With this PR will be introduced the Infrastructure Deployer API in order to split the Infrastructure deployment logic from the Openshift Instance provisioning. This feature will simplify the proposed integrations with Terraform, Pulumi or even other custom deployment logic not yet mentioned giving to CRC-Cloud the ability to selectively load the preferred logic with a CLI/ENV Parameter.
Adding a plugin won't affect other plugins so we could potentially implement an undefined amount of infrastructure deployment strategies and approaches that can coexist as plugins and can be utilized depending on the user needs.
Moreover this implementation lays the ground for a pluggable API architecture that can be reused on the project for other future purposes.
Even though bash is not an OO language, I created some functions to enforce the correct API implementation and methods naming conventions respect.
Version bumped to 1.1 (maybe should be v2.0?)