-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Needs FixThe issue is understood and ready for code to be written.The issue is understood and ready for code to be written.good first issueGood for newcomersGood for newcomers
Description
Issue
Objective
Provision a staging environment on AWS EC2 to test StrataSTOR, ensuring compatibility with ZFS and related dependencies. The setup should be automated and validated through Go tests for ZFS operations.
Clearly, there may be other IaC choices including AWS Cloud Formation templates but not limited to Terraform. To prevent the analysis-paralysis, let's choose Terraform favoring faster initial iteration and scalable future development.
Assumptions
-
AWS Resources
- Existing VPC, subnets, NAT, and Internet Gateways (if private subnet is used).
- Existing EC2 keypair for SSH access.
- The user has necessary AWS permissions to create and manage required resources.
-
Terraform State Management
- A pre-configured S3 bucket and DynamoDB table are available for state storage and locking.
-
Validation Criteria
- The environment is valid if the following command executes successfully:
cd rodent/pkg/zfs/dataset/ && sudo go test -v -run TestDatasetOperations
- The environment is valid if the following command executes successfully:
Tasks
1. Provisioning
- Use Terraform to:
- Create an EC2 instance with a base Ubuntu 24 LTS image.
- Configure instance details (e.g., instance type, keypair, disk size) via variables.
- Accommodate ZFS version and build type(source or Canonical/Distribution package) as variables as well.
- Attach a security group allowing:
- SSH (port 22) for administrative access.
- Install and configure the following using user-data shell scripts:
- ZFS 2.3.0-rc5 (built from source). Consider the variable config value.
- Go 1.23.4.
- Docker with Docker Compose
- Latest version of NFS and Samba
- Required utilities:
ssh,git,setfacl,jqand other development utils as necessary
2. Validation
- Run the following command to validate the setup:
This test suite may be an over kill. A particular Test function within this would be sufficient. For instance, TestDatasetOperations/Filesystems/Create should be okay. It creates necessary loopback devices, creates a pool with those devices, creates a file system and then destroys the pool and attached devices. Spares us from additional manual work.
cd rodent/pkg/zfs/dataset/ && sudo go test -v -run TestDatasetOperations
- Output validation logs for debugging.
3. Cleanup
- Ensure Terraform provides a clean destroy operation to remove all resources created during provisioning.
- Confirm idempotency for apply/destroy cycles.
Deliverables
- Terraform configuration for automating the EC2-based staging environment.
- User-data scripts for software installation and configuration.
- Documentation on deploying, validating, and tearing down the environment.
Additional Considerations
- Use modular patterns in Terraform for reusability.
Parallel issue on a similar requirement for Rodent CI: stratastor/rodent#44
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Needs FixThe issue is understood and ready for code to be written.The issue is understood and ready for code to be written.good first issueGood for newcomersGood for newcomers