File tree Expand file tree Collapse file tree 3 files changed +37
-11
lines changed Expand file tree Collapse file tree 3 files changed +37
-11
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ RUN addgroup -S mobius3 && \
88WORKDIR /home/mobius3
99
1010RUN pip install mobius3==0.0.34
11+ COPY zmobius3.py /usr/bin/zmobius3
1112
1213USER mobius3
1314
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ module "volume_label" {
1212 label_order = [" name" ]
1313}
1414
15- # TODO: Implement a health check
1615# TODO: Support different user/groups
1716module "mobius3" {
1817 source = " git::https://github.com/cloudposse/terraform-aws-ecs-container-definition.git?ref=tags/0.57.0"
@@ -23,7 +22,7 @@ module "mobius3" {
2322 user = var. user
2423
2524 command = [
26- " mobius3 " ,
25+ " zmobius3 " ,
2726 " /srv/data" ,
2827 var . bucket_id ,
2928 " https://{}.s3.${ var . bucket_region } .amazonaws.com/" ,
@@ -33,21 +32,28 @@ module "mobius3" {
3332 " --log-level" , " INFO"
3433 ]
3534
36- mount_points = [
37- {
38- containerPath = " /srv/data"
39- sourceVolume = module.volume_label.id
40- readOnly = false
41- }
42- ]
35+ healthcheck = {
36+ command = [" /bin/sh" , " -c" ,
37+ " cat /tmp/ruok | grep imok"
38+ ]
39+ retries = 3
40+ timeout = 3
41+ interval = 10
42+ startPeriod = 60
43+ }
44+
45+ mount_points = [{
46+ containerPath = " /srv/data"
47+ sourceVolume = module.volume_label.id
48+ readOnly = false
49+ }]
4350
4451 log_configuration = var. log_configuration
4552}
4653
4754locals {
4855 output_container_depends_on = {
4956 containerName = module.mobius3.json_map_object[" name" ]
50- # TODO: Use HEALTHY once we have a healthcheck
51- condition = " START"
57+ condition = " HEALTHY"
5258 }
5359}
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+ import mobius3
3+
4+
5+ super_async_main = mobius3 .async_main
6+
7+
8+ async def async_main (syncer_args ):
9+ stop = await super_async_main (syncer_args )
10+ with open ("/tmp/ruok" , "w" ) as f :
11+ f .write ("imok" )
12+ return stop
13+
14+
15+ if __name__ == "__main__" :
16+ mobius3 .async_main = async_main
17+ mobius3 .main ()
18+
19+
You can’t perform that action at this time.
0 commit comments