Skip to content

Commit

Permalink
Merge pull request #819 from degica/change_log_driver
Browse files Browse the repository at this point in the history
Change log driver of runpack to json-file
  • Loading branch information
essa authored Sep 19, 2024
2 parents d74a06d + 95617a5 commit 3d7224f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
10 changes: 9 additions & 1 deletion app/models/heritage_task_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,16 @@ def run_pack_definition
cpu: 1,
memory: 16,
essential: false,
image: "public.ecr.aws/degica/barcelona-run-pack"
image: "public.ecr.aws/degica/barcelona-run-pack",
log_configuration: {
log_driver: "json-file",
options: {
"max-size": "10m",
"max-file": "10"
}
}
)

end

def reverse_proxy_definition_tcp
Expand Down
29 changes: 23 additions & 6 deletions spec/models/heritage_task_definition_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,24 @@
}
}
}

let(:expected_log_configuration_for_runpack) {
{
log_driver: "json-file",
options: {
"max-size": "10m",
"max-file": "10"
}
}
}
let(:expected_log_configuration_for_runpack2) {
{
"LogDriver" => "json-file",
"Options" => {
"max-size": "10m",
"max-file": "10"
}
}
}
describe ".service_definition" do
subject { described_class.service_definition(service).to_task_definition }
let(:district) { create :district }
Expand Down Expand Up @@ -52,7 +69,7 @@
essential: false,
image: "public.ecr.aws/degica/barcelona-run-pack",
environment: [],
log_configuration: expected_log_configuration
log_configuration: expected_log_configuration_for_runpack
}
]
})
Expand Down Expand Up @@ -105,7 +122,7 @@
essential: false,
image: "public.ecr.aws/degica/barcelona-run-pack",
environment: [],
log_configuration: expected_log_configuration
log_configuration: expected_log_configuration_for_runpack
},
{
name: "#{service.service_name}-revpro",
Expand Down Expand Up @@ -197,7 +214,7 @@
essential: false,
image: "public.ecr.aws/degica/barcelona-run-pack",
environment: [],
log_configuration: expected_log_configuration
log_configuration: expected_log_configuration_for_runpack
},
{
name: "#{service.service_name}-revpro",
Expand Down Expand Up @@ -283,7 +300,7 @@
essential: false,
image: "public.ecr.aws/degica/barcelona-run-pack",
environment: [],
log_configuration: expected_log_configuration
log_configuration: expected_log_configuration_for_runpack
}
]
})
Expand Down Expand Up @@ -352,7 +369,7 @@
"Essential" => false,
"Image" => "public.ecr.aws/degica/barcelona-run-pack",
"Environment" => [],
"LogConfiguration" => expected_log_configuration
"LogConfiguration" => expected_log_configuration_for_runpack2
}
]
})
Expand Down

0 comments on commit 3d7224f

Please sign in to comment.