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
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, jq and other development utils as necessary
2. Validation
- Run the following command to validate the setup:
cd rodent/pkg/zfs/dataset/ && sudo go test -v -run TestDatasetOperations
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.
- 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
Additional Considerations
- Use modular patterns in Terraform for reusability.
Parallel issue on a similar requirement for Rodent CI: stratastor/rodent#44
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
Terraform State Management
Validation Criteria
Tasks
1. Provisioning
ssh,git,setfacl,jqand other development utils as necessary2. Validation
3. Cleanup
Deliverables
Additional Considerations
Parallel issue on a similar requirement for Rodent CI: stratastor/rodent#44