From 524085ca26e3668dfa1152c57414c0f2dca6c8b9 Mon Sep 17 00:00:00 2001 From: Digvijay Ukirde Date: Tue, 20 Jan 2026 01:26:11 +0530 Subject: [PATCH] Structural changes for awsv2 plugin --- build.sh | 2 +- .../awsv2/conf/lsf/awsprov_config.json | 5 +++ .../awsv2/conf/lsf/awsprov_templates.json | 39 +++++++++++++++++++ .../awsv2/{src => scripts}/__init__.py | 0 .../awsv2/{src => scripts}/aws_client.py | 2 +- .../awsv2/{src => scripts}/config_manager.py | 0 .../awsv2/{src => scripts}/db_manager.py | 0 .../awsv2/scripts/getAvailableTemplates.sh | 2 +- .../awsv2/scripts/getRequestStatus.sh | 2 +- .../awsv2/scripts/getReturnRequests.sh | 2 +- .../get_available_templates.py | 0 .../{src => scripts}/get_request_status.py | 0 .../{src => scripts}/get_return_requests.py | 0 .../awsv2/scripts/requestMachines.sh | 2 +- .../awsv2/scripts/requestReturnMachines.sh | 2 +- .../{src => scripts}/request_machines.py | 0 .../awsv2/{src => scripts}/request_manager.py | 0 .../request_return_machines.py | 0 .../{src => scripts}/sample_federated_auth.py | 0 .../{src => scripts}/template_manager.py | 0 hostProviders/awsv2/{src => scripts}/utils.py | 0 21 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 hostProviders/awsv2/conf/lsf/awsprov_config.json create mode 100644 hostProviders/awsv2/conf/lsf/awsprov_templates.json rename hostProviders/awsv2/{src => scripts}/__init__.py (100%) rename hostProviders/awsv2/{src => scripts}/aws_client.py (99%) rename hostProviders/awsv2/{src => scripts}/config_manager.py (100%) rename hostProviders/awsv2/{src => scripts}/db_manager.py (100%) rename hostProviders/awsv2/{src => scripts}/get_available_templates.py (100%) rename hostProviders/awsv2/{src => scripts}/get_request_status.py (100%) rename hostProviders/awsv2/{src => scripts}/get_return_requests.py (100%) rename hostProviders/awsv2/{src => scripts}/request_machines.py (100%) rename hostProviders/awsv2/{src => scripts}/request_manager.py (100%) rename hostProviders/awsv2/{src => scripts}/request_return_machines.py (100%) rename hostProviders/awsv2/{src => scripts}/sample_federated_auth.py (100%) rename hostProviders/awsv2/{src => scripts}/template_manager.py (100%) rename hostProviders/awsv2/{src => scripts}/utils.py (100%) diff --git a/build.sh b/build.sh index 7a8132d..944c2d3 100755 --- a/build.sh +++ b/build.sh @@ -7,7 +7,7 @@ _num_of_opts="$#" _cmd_opt_str="$@" RC_JAVA_PLUGINS="aws azure cyclecloud google" -RC_SCRIPT_PLUGINS="ibmcloudgen2 openstack" +RC_SCRIPT_PLUGINS="awsv2 ibmcloudgen2 openstack" ALL_RC_PLUGSIN="$RC_JAVA_PLUGINS $RC_SCRIPT_PLUGINS" #RC_TARGET_FILE="brel_root.rc_plugin.tar.gz" RC_TARGET_FILE="brel_root.hf_providers_java_plugin.tar.gz" diff --git a/hostProviders/awsv2/conf/lsf/awsprov_config.json b/hostProviders/awsv2/conf/lsf/awsprov_config.json new file mode 100644 index 0000000..7910c2d --- /dev/null +++ b/hostProviders/awsv2/conf/lsf/awsprov_config.json @@ -0,0 +1,5 @@ +{ + "LogLevel": "INFO", + "AWS_CREDENTIAL_FILE": "/home/aws/credentials", + "AWS_REGION": "us-west-2" +} diff --git a/hostProviders/awsv2/conf/lsf/awsprov_templates.json b/hostProviders/awsv2/conf/lsf/awsprov_templates.json new file mode 100644 index 0000000..345f0eb --- /dev/null +++ b/hostProviders/awsv2/conf/lsf/awsprov_templates.json @@ -0,0 +1,39 @@ +{ + "templates": [ + { + "templateId": "Template-VM-1", + "maxNumber": 0, + "attributes": { + "type": ["String", "X86_64"], + "ncores": ["Numeric", "1"], + "ncpus": ["Numeric", "1"], + "mem": ["Numeric", "1024"], + "awshost": ["Boolean", "1"] + }, + "imageId": "ami-27a1", + "subnetId": "subnet-b573", + "vmType": "t2.micro", + "keyName": "Lsf-Key", + "securityGroupIds": [""], + "instanceTags" : "group=project1", + "userData": "zone=us_west_2a" + }, + { + "templateId": "Template-VM-2", + "maxNumber": 0, + "attributes": { + "type": ["String", "X86_64"], + "ncores": ["Numeric", "4"], + "ncpus": ["Numeric", "2"], + "mem": ["Numeric", "2048"], + "awshost": ["Boolean", "1"] + }, + "imageId": "ami-27b1", + "subnetId": "subnet-b5738", + "vmType": "t2.micro", + "keyName": "Lsf-Key", + "securityGroupIds": [""], + "userData": "zone=us_west_2b" + } + ] +} diff --git a/hostProviders/awsv2/src/__init__.py b/hostProviders/awsv2/scripts/__init__.py similarity index 100% rename from hostProviders/awsv2/src/__init__.py rename to hostProviders/awsv2/scripts/__init__.py diff --git a/hostProviders/awsv2/src/aws_client.py b/hostProviders/awsv2/scripts/aws_client.py similarity index 99% rename from hostProviders/awsv2/src/aws_client.py rename to hostProviders/awsv2/scripts/aws_client.py index f7ab635..684d8d3 100644 --- a/hostProviders/awsv2/src/aws_client.py +++ b/hostProviders/awsv2/scripts/aws_client.py @@ -655,7 +655,7 @@ def _build_user_data(self, template: Dict, rc_account: str = 'default') -> str: logger.debug("Building user data from template...") user_data = "" script_dir = os.path.dirname(os.path.abspath(__file__)) - user_data_file = os.path.join(script_dir, "../scripts/user_data.sh") + user_data_file = os.path.join(script_dir, "user_data.sh") logger.debug(f"Looking for user data file: {user_data_file}") if os.path.exists(user_data_file): diff --git a/hostProviders/awsv2/src/config_manager.py b/hostProviders/awsv2/scripts/config_manager.py similarity index 100% rename from hostProviders/awsv2/src/config_manager.py rename to hostProviders/awsv2/scripts/config_manager.py diff --git a/hostProviders/awsv2/src/db_manager.py b/hostProviders/awsv2/scripts/db_manager.py similarity index 100% rename from hostProviders/awsv2/src/db_manager.py rename to hostProviders/awsv2/scripts/db_manager.py diff --git a/hostProviders/awsv2/scripts/getAvailableTemplates.sh b/hostProviders/awsv2/scripts/getAvailableTemplates.sh index 3d996af..30b342a 100755 --- a/hostProviders/awsv2/scripts/getAvailableTemplates.sh +++ b/hostProviders/awsv2/scripts/getAvailableTemplates.sh @@ -10,4 +10,4 @@ homeDir="$(cd "$scriptDir" && cd .. && pwd)" export PYTHONPATH=$scriptDir -python3 $scriptDir/../src/get_available_templates.py $inJson $homeDir \ No newline at end of file +python3 $scriptDir/get_available_templates.py $inJson $homeDir \ No newline at end of file diff --git a/hostProviders/awsv2/scripts/getRequestStatus.sh b/hostProviders/awsv2/scripts/getRequestStatus.sh index 3908234..17b7f89 100755 --- a/hostProviders/awsv2/scripts/getRequestStatus.sh +++ b/hostProviders/awsv2/scripts/getRequestStatus.sh @@ -10,4 +10,4 @@ homeDir="$(cd "$scriptDir" && cd .. && pwd)" export PYTHONPATH=$scriptDir -python3 $scriptDir/../src/get_request_status.py $inJson $home \ No newline at end of file +python3 $scriptDir/get_request_status.py $inJson $home \ No newline at end of file diff --git a/hostProviders/awsv2/scripts/getReturnRequests.sh b/hostProviders/awsv2/scripts/getReturnRequests.sh index 1183af5..da67d51 100755 --- a/hostProviders/awsv2/scripts/getReturnRequests.sh +++ b/hostProviders/awsv2/scripts/getReturnRequests.sh @@ -10,4 +10,4 @@ homeDir="$(cd "$scriptDir" && cd .. && pwd)" export PYTHONPATH=$scriptDir -python3 $scriptDir/../src/get_return_requests.py $inJson $home \ No newline at end of file +python3 $scriptDir/get_return_requests.py $inJson $home \ No newline at end of file diff --git a/hostProviders/awsv2/src/get_available_templates.py b/hostProviders/awsv2/scripts/get_available_templates.py similarity index 100% rename from hostProviders/awsv2/src/get_available_templates.py rename to hostProviders/awsv2/scripts/get_available_templates.py diff --git a/hostProviders/awsv2/src/get_request_status.py b/hostProviders/awsv2/scripts/get_request_status.py similarity index 100% rename from hostProviders/awsv2/src/get_request_status.py rename to hostProviders/awsv2/scripts/get_request_status.py diff --git a/hostProviders/awsv2/src/get_return_requests.py b/hostProviders/awsv2/scripts/get_return_requests.py similarity index 100% rename from hostProviders/awsv2/src/get_return_requests.py rename to hostProviders/awsv2/scripts/get_return_requests.py diff --git a/hostProviders/awsv2/scripts/requestMachines.sh b/hostProviders/awsv2/scripts/requestMachines.sh index 93a2325..fe1acbd 100755 --- a/hostProviders/awsv2/scripts/requestMachines.sh +++ b/hostProviders/awsv2/scripts/requestMachines.sh @@ -10,4 +10,4 @@ homeDir="$(cd "$scriptDir" && cd .. && pwd)" export PYTHONPATH=$scriptDir -python3 $scriptDir/../src/request_machines.py $inJson $home \ No newline at end of file +python3 $scriptDir/request_machines.py $inJson $home \ No newline at end of file diff --git a/hostProviders/awsv2/scripts/requestReturnMachines.sh b/hostProviders/awsv2/scripts/requestReturnMachines.sh index a73450f..ec25876 100755 --- a/hostProviders/awsv2/scripts/requestReturnMachines.sh +++ b/hostProviders/awsv2/scripts/requestReturnMachines.sh @@ -10,4 +10,4 @@ homeDir="$(cd "$scriptDir" && cd .. && pwd)" export PYTHONPATH=$scriptDir -python3 $scriptDir/../src/request_return_machines.py $inJson $home \ No newline at end of file +python3 $scriptDir/request_return_machines.py $inJson $home \ No newline at end of file diff --git a/hostProviders/awsv2/src/request_machines.py b/hostProviders/awsv2/scripts/request_machines.py similarity index 100% rename from hostProviders/awsv2/src/request_machines.py rename to hostProviders/awsv2/scripts/request_machines.py diff --git a/hostProviders/awsv2/src/request_manager.py b/hostProviders/awsv2/scripts/request_manager.py similarity index 100% rename from hostProviders/awsv2/src/request_manager.py rename to hostProviders/awsv2/scripts/request_manager.py diff --git a/hostProviders/awsv2/src/request_return_machines.py b/hostProviders/awsv2/scripts/request_return_machines.py similarity index 100% rename from hostProviders/awsv2/src/request_return_machines.py rename to hostProviders/awsv2/scripts/request_return_machines.py diff --git a/hostProviders/awsv2/src/sample_federated_auth.py b/hostProviders/awsv2/scripts/sample_federated_auth.py similarity index 100% rename from hostProviders/awsv2/src/sample_federated_auth.py rename to hostProviders/awsv2/scripts/sample_federated_auth.py diff --git a/hostProviders/awsv2/src/template_manager.py b/hostProviders/awsv2/scripts/template_manager.py similarity index 100% rename from hostProviders/awsv2/src/template_manager.py rename to hostProviders/awsv2/scripts/template_manager.py diff --git a/hostProviders/awsv2/src/utils.py b/hostProviders/awsv2/scripts/utils.py similarity index 100% rename from hostProviders/awsv2/src/utils.py rename to hostProviders/awsv2/scripts/utils.py