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

DTT1 - Iteration 2 - Allocator module #4746

Closed
1 task done
QU3B1M opened this issue Dec 6, 2023 · 3 comments · Fixed by #4801
Closed
1 task done

DTT1 - Iteration 2 - Allocator module #4746

QU3B1M opened this issue Dec 6, 2023 · 3 comments · Fixed by #4801
Assignees

Comments

@QU3B1M
Copy link
Member

QU3B1M commented Dec 6, 2023

Epic: #4495

Description

This issue aims to englobe all the subtasks required for the completion of the DTT1 Allocator module

Subtasks

@QU3B1M QU3B1M self-assigned this Dec 6, 2023
@fcaffieri fcaffieri changed the title DTT1 - Allocator module DTT1 - Iteration 2 - Allocator module Dec 26, 2023
@QU3B1M
Copy link
Member Author

QU3B1M commented Jan 2, 2024

Update report

  • Allocation module refactored and changes merged on:
  • Implemented pydantic models for data validation
  • Allocation launcher Improved
    import argparse
    import os
    import sys
    
    project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
    sys.path.append(project_root)
    
    from modules.allocation.generic.models import InputPayload
    from modules.allocation import Allocator
    
    
    def parse_arguments():
        parser = argparse.ArgumentParser(description="Infrastructure providing tool")
        parser.add_argument("--provider", choices=['vagrant', 'aws', None], required=False,  default=None)
        parser.add_argument("--size", choices=['micro', 'small', 'medium', 'large', None], required=False, default=None)
        parser.add_argument("--composite-name", required=False, default=None)
        parser.add_argument("--action", choices=['create', 'delete'], required=False, default='create')
        parser.add_argument("--custom-credentials", required=False, default=None)
        parser.add_argument("--track-output", required=False, default='/tmp/wazuh-qa/track.yml')
        parser.add_argument("--inventory-output", required=False, default='/tmp/wazuh-qa/inventory.yml')
        parser.add_argument("--working-dir", required=False, default='/tmp/wazuh-qa')
        return parser.parse_args()
    
    
    def main():
        Allocator.run(InputPayload(**vars(parse_arguments())))
    
    
    if __name__ == "__main__":
        main()

@QU3B1M QU3B1M linked a pull request Jan 2, 2024 that will close this issue
@jnasselle
Copy link
Member

LGTM

@fcaffieri
Copy link
Member

fcaffieri commented Jan 8, 2024

The init test will be executed in PoC Iteration 2 #4751
LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants