Skip to content

Commit

Permalink
[Backend] Add custom EC2 storage to challenges (#4103)
Browse files Browse the repository at this point in the history
  • Loading branch information
gchhablani authored Aug 10, 2023
1 parent d9dd84c commit 35dc987
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/challenges/aws_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ def setup_ec2(challenge):
'DeviceName': '/dev/sda1',
'Ebs': {
'DeleteOnTermination': True,
'VolumeSize': 8, # TODO: Make this customizable
'VolumeSize': challenge_obj.ec2_storage, # TODO: Make this customizable
'VolumeType': 'gp2'
}
},
Expand Down
3 changes: 3 additions & 0 deletions apps/challenges/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ def __init__(self, *args, **kwargs):
ec2_instance_id = models.CharField(
max_length=200, default="", null=True, blank=True
)
ec2_storage = models.PositiveIntegerField(
default=8, verbose_name="EC2 storage (GB)"
)
featured = models.BooleanField(
default=False, verbose_name="Featured", db_index=True
)
Expand Down
2 changes: 2 additions & 0 deletions apps/challenges/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class Meta:
"cpu_only_jobs",
"job_cpu_cores",
"job_memory",
"ec2_storage",
)


Expand Down Expand Up @@ -295,6 +296,7 @@ class Meta:
"cpu_only_jobs",
"job_cpu_cores",
"job_memory",
"ec2_storage",
)


Expand Down

0 comments on commit 35dc987

Please sign in to comment.