Skip to content

Commit

Permalink
Merge pull request #663 from quintilesims/OCEMCM-11302-SingleDrive
Browse files Browse the repository at this point in the history
Reviewed the changes with mb-nx
  • Loading branch information
yjwx18 authored Apr 6, 2021
2 parents f13f582 + c746e3c commit a0447b7
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ deploy:
on:
tags: true

after_deploy:
- curl -X POST -F token="$GITLAB_PIPELINE_TOKEN" -F ref=master "$GITLAB_PIPELINE_URL"
6 changes: 3 additions & 3 deletions api/backend/ecs/environment_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ func (e *ECSEnvironmentManager) CreateEnvironment(
ecsRole := config.AWSECSInstanceProfile()
keyPair := config.AWSKeyPair()
launchConfigurationName := ecsEnvironmentID.LaunchConfigurationName()
volSizes := map[string]int{}
if operatingSystem == "linux" {
volSizes["/dev/xvda"] = 8
volSizes := make(map[string]int)
if operatingSystem == "linux" {
volSizes["/dev/xvda"] = 30;
} else {
volSizes["/dev/sda1"] = 200
}
Expand Down
2 changes: 1 addition & 1 deletion api/backend/ecs/environment_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func TestCreateEnvironment(t *testing.T) {
reporter.AssertEqualf("m3.medium", *instanceType, "Instance Type")
reporter.AssertEqualf(config.TEST_AWS_KEY_PAIR, *keyName, "KeyPair")
reporter.AssertEqualf(securityGroupID, *securityGroups[0], "SecurityGroupID 0")
reporter.AssertEqualf(volSizes, map[string]int{"/dev/xvda": 8}, "Volume Sizes")
reporter.AssertEqualf(volSizes, map[string]int{"/dev/xvda": 30}, "Volume Sizes")

return nil
}
Expand Down
12 changes: 11 additions & 1 deletion setup/module/api/core.tf
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,17 @@ data "aws_ami" "linux" {

filter {
name = "name"
values = ["amzn-ami-2018.03.20201130-amazon-ecs-optimized"]
values = ["amzn2-ami-ecs-hvm-*"]
}

filter {
name = "root-device-type"
values = ["ebs"]
}

filter {
name = "virtualization-type"
values = ["hvm"]
}
}

Expand Down
9 changes: 8 additions & 1 deletion setup/module/api/environment.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,18 @@ data "template_file" "user_data" {
resource "aws_launch_configuration" "api" {
name_prefix = "l0-${var.name}-api-"
image_id = "${data.aws_ami.linux.id}"
instance_type = "t2.medium"
instance_type = "t3.medium"
security_groups = ["${aws_security_group.api_env.id}"]
iam_instance_profile = "${aws_iam_instance_profile.ecs.id}"
user_data = "${data.template_file.user_data.rendered}"
key_name = "${var.ssh_key_pair}"
ebs_optimized = true

root_block_device {
delete_on_termination = true
volume_type = "gp2"
volume_size = "30"
}

lifecycle {
create_before_destroy = true
Expand Down

0 comments on commit a0447b7

Please sign in to comment.