Skip to content

Conversation

@glours
Copy link
Collaborator

@glours glours commented May 6, 2025

it will give more details to Language Server Protocol tools

https://docker.atlassian.net/browse/APCLI-1107

Fix compose-spec/compose-spec#138

@glours glours requested a review from ndeloof as a code owner May 6, 2025 10:01
@glours glours self-assigned this May 6, 2025
@glours
Copy link
Collaborator Author

glours commented May 6, 2025

@rcjsuen if you want to take a look also

@glours glours force-pushed the add-description-spec-json branch from e4f44b6 to 8020eb6 Compare May 6, 2025 10:15
Comment on lines +154 to +157
"weight": {
"type": ["integer", "string"],
"description": "Block IO weight (relative weight) for the service, between 10 and 1000."
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I was able to set this value to 0. Is that intentional?
  2. Should we set a minimum and maximum for this similar to cpu_percent?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I keep this one for a follow up PR

},
"mem_swappiness": {
"type": ["integer", "string"],
"description": "Container memory swappiness as percentage (0 to 100)."
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "Container memory swappiness as percentage (0 to 100)."
"description": "Container memory swappiness as a percentage (0 to 100)."

Should we set a minimum and maximum here? I was able to set this value to -1 but Docker Compose still seemed to work. 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there are many places where such min/max could be defined. We should consider adding them as a follow-up

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, we'll do follow-up PR to manage this kind of improvement

Comment on lines +1232 to +1239
"count": {
"type": ["string", "integer"],
"description": "Number of GPUs to use."
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we specify a minimum value here?

Comment on lines +1289 to +1296
"driver": {
"type": "string",
"description": "Specify which driver should be used for this network. Default is 'bridge'."
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we declare the default attribute here?

Comment on lines +1661 to +1670
"description": "A dictionary mapping keys to values.",
"patternProperties": {
".+": {
"type": ["string", "number", "boolean", "null"]
"type": ["string", "number", "boolean", "null"],
"description": "Value for the key, which can be a string, number, boolean, or null."
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could someone help clarify to me as to why we allow a key to be null? 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key only (no value) means "use same value from host env variables, and if not set remove variable"

Comment on lines +1730 to +1737
"rate": {
"type": ["integer", "string"],
"description": "Rate limit in bytes per second or IO operations per second."
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we set a minimum for this attribute?

Comment on lines +1745 to +1752
"weight": {
"type": ["integer", "string"],
"description": "Relative weight for the device, between 10 and 1000."
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we set a minimum and maximum for this attribute?

@glours glours force-pushed the add-description-spec-json branch from 8020eb6 to d3f0e2a Compare May 6, 2025 11:58
},
"mem_swappiness": {
"type": ["integer", "string"],
"description": "Container memory swappiness as percentage (0 to 100)."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there are many places where such min/max could be defined. We should consider adding them as a follow-up

Comment on lines +985 to +992
"failure_action": {
"type": "string",
"description": "Action to take if a rollback fails: 'continue', 'pause'."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only exists for swarm mode, low priority imho

Comment on lines +1661 to +1670
"description": "A dictionary mapping keys to values.",
"patternProperties": {
".+": {
"type": ["string", "number", "boolean", "null"]
"type": ["string", "number", "boolean", "null"],
"description": "Value for the key, which can be a string, number, boolean, or null."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key only (no value) means "use same value from host env variables, and if not set remove variable"

@glours
Copy link
Collaborator Author

glours commented May 6, 2025

@rcjsuen @ndeloof thanks, if you don't have any objection I'll merge it as this and we'll address the other comments as follow-up PRs, is that ok for you?

it will give more details to Language Server Protocol tools

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
@glours glours force-pushed the add-description-spec-json branch from a48bc5b to 3977667 Compare May 6, 2025 14:52
@rcjsuen
Copy link

rcjsuen commented May 6, 2025

if you don't have any objection I'll merge it as this and we'll address the other comments as follow-up PRs, is that ok for you?

No problem. Makes sense to me. 👍

@glours glours enabled auto-merge (rebase) May 6, 2025 14:54
@glours glours merged commit 9fb79a6 into compose-spec:main May 6, 2025
8 checks passed
@glours glours deleted the add-description-spec-json branch May 6, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Description of fields in compose-spec.json

3 participants