File tree 3 files changed +37
-11
lines changed
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 && \
8
8
WORKDIR /home/mobius3
9
9
10
10
RUN pip install mobius3==0.0.34
11
+ COPY zmobius3.py /usr/bin/zmobius3
11
12
12
13
USER mobius3
13
14
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ module "volume_label" {
12
12
label_order = [" name" ]
13
13
}
14
14
15
- # TODO: Implement a health check
16
15
# TODO: Support different user/groups
17
16
module "mobius3" {
18
17
source = " git::https://github.com/cloudposse/terraform-aws-ecs-container-definition.git?ref=tags/0.57.0"
@@ -23,7 +22,7 @@ module "mobius3" {
23
22
user = var. user
24
23
25
24
command = [
26
- " mobius3 " ,
25
+ " zmobius3 " ,
27
26
" /srv/data" ,
28
27
var . bucket_id ,
29
28
" https://{}.s3.${ var . bucket_region } .amazonaws.com/" ,
@@ -33,21 +32,28 @@ module "mobius3" {
33
32
" --log-level" , " INFO"
34
33
]
35
34
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
+ }]
43
50
44
51
log_configuration = var. log_configuration
45
52
}
46
53
47
54
locals {
48
55
output_container_depends_on = {
49
56
containerName = module.mobius3.json_map_object[" name" ]
50
- # TODO: Use HEALTHY once we have a healthcheck
51
- condition = " START"
57
+ condition = " HEALTHY"
52
58
}
53
59
}
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