Skip to content
This repository was archived by the owner on Aug 14, 2020. It is now read-only.

Commit 699e725

Browse files
author
Alessandro Puccetti
committed
schema/app: add annotation to expose sd_notify() support
The annotation "appc.io/executor/systemd/support-notify" exposes if or not an application supports notifications using sd_notify(). This information may be used to signal the init process when a service is ready.
1 parent 66a50da commit 699e725

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

examples/image.json

+4
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@
128128
{
129129
"name": "homepage",
130130
"value": "https://example.com"
131+
},
132+
{
133+
"name": "appc.io/executor/systemd/support-notify",
134+
"value": "false"
131135
}
132136
]
133137
}

schema/types/annotations_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ func TestAnnotationsAssertValid(t *testing.T) {
7979
},
8080
false,
8181
},
82+
{
83+
[]Annotation{
84+
makeAnno("appc.io/executor/systemd/support-notify", "false"),
85+
},
86+
false,
87+
},
8288
// empty is OK
8389
{
8490
[]Annotation{},

spec/aci.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ JSON Schema for the Image Manifest (app image manifest, ACI manifest), conformin
169169
"count": 1000,
170170
"protocol": "tcp"
171171
}
172-
]
172+
],
173173
},
174174
"dependencies": [
175175
{
@@ -211,6 +211,10 @@ JSON Schema for the Image Manifest (app image manifest, ACI manifest), conformin
211211
{
212212
"name": "homepage",
213213
"value": "https://example.com"
214+
},
215+
{
216+
"name": "appc.io/executor/supportsSystemdNotify",
217+
"value": false
214218
}
215219
]
216220
}
@@ -250,6 +254,7 @@ JSON Schema for the Image Manifest (app image manifest, ACI manifest), conformin
250254
* **authors** contact details of the people or organization responsible for the image (freeform string)
251255
* **homepage** URL to find more information on the image (string, must be a URL with scheme HTTP or HTTPS)
252256
* **documentation** URL to get documentation on the image (string, must be a URL with scheme HTTP or HTTPS)
257+
* **appc.io/executor/supportsSystemdNotify** (boolean, optional, defaults to "false" if unset) if set to true, all applications within the image MUST use the sd\_notify mechanism to signal when they are ready. Also each application MUST be able to detect if the executor had not set up the sd\_notify mechanism and skip the notification without error ([sd_notify()](https://www.freedesktop.org/software/systemd/man/sd_notify.html) from libsystemd does that automatically).
253258

254259
#### Dependency Matching
255260

0 commit comments

Comments
 (0)