Commit graph

7109 commits

Author SHA1 Message Date
Sebastiaan van Stijn
8e0d43dda7
docs/api: add node about concurrency on /system/df endpoint
Commit 135cec5d4d added support for
calling the /system/df endpoint concurrently.

This patch adds a note about this enhancement to the API changes.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-10 14:51:27 +02:00
Roman Volosatovs
47ad2f3dd6
API,daemon: support type URL parameter to /system/df
Let clients choose object types to compute disk usage of.

Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-27 12:17:45 +02:00
Roman Volosatovs
2af9bd3b26
API: add shared-size parameter to image queries
The reasoning for this change is to be able to query image shared size without having to rely on the more heavyweight `/system/df` endpoint.

Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
2021-07-13 13:46:07 +02:00
Roman Volosatovs
31348afa19
API: deprecate BuilderSize in API versions >= 1.42
Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
2021-07-12 10:03:49 +02:00
Sebastiaan van Stijn
c858e496f6
Merge pull request #42596 from thaJeztah/sync_swagger_fix
API: fix 404 status description on container create
2021-07-07 11:49:10 +02:00
Brian Goff
2a7f70f81c
Merge pull request #42063 from thaJeztah/bump_api_version
API: update API version to v1.42
2021-07-06 16:13:07 -07:00
Sebastiaan van Stijn
68b095d4df
API: fix 404 status description on container create
This updates the current swagger file, and all docs versions
with the same fix as ff1d9a3ec5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-03 21:30:47 +02:00
Sebastiaan van Stijn
2b5427b853
Merge pull request #42047 from Emdot/Emdot-patch-1
Fix containers/create 404 response description
2021-07-03 21:21:16 +02:00
Sebastiaan van Stijn
477244cca5
API: update API version to v1.42
Docker 20.10 was released with API v1.41, so any change in the API
should now target v1.42.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-03 18:12:46 +02:00
Roman Volosatovs
c2c0b8dc4e
docs: fix image name in testing guide
Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
2021-06-16 17:41:04 +02:00
Felipe Ruhland
eefb6c672a Fix typo on the v1.41 changelog
Signed-off-by: Felipe Ruhland <felipe.ruhland@gmail.com>
2021-04-07 22:29:07 +02:00
Sebastiaan van Stijn
328de0b8d9
Update documentation links
- Using "/go/" redirects for some topics, which allows us to
  redirect to new locations if topics are moved around in the
  documentation.
- Updated some old URLs to their new location.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-25 12:11:50 +01:00
Matt Morrison
ff1d9a3ec5 Update v1.41.yaml
fix containers/create 404 response description

Signed-off-by: Matt Morrison <3241034+Emdot@users.noreply.github.com>
2021-02-19 18:23:28 -06:00
Sebastiaan van Stijn
8e2343ffd4
docs: fix NanoCPUs casing
While the field in the Go struct is named `NanoCPUs`, it has a JSON label to
use `NanoCpus`, which was added in the original pull request (not clear what
the reason was); 846baf1fd3

Some notes:

- Golang processes field names case-insensitive, so when *using* the API,
  both cases should work, but when inspecting a container, the field is
  returned as `NanoCpus`.
- This only affects Containers.Resources. The `Limits` and `Reservation`
  for SwarmKit services and SwarmKit "nodes" do not override the name
  for JSON, so have the canonical (`NanoCPUs`) casing.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-10 13:02:27 +01:00
Sebastiaan van Stijn
240d0b37bb
docs: fix double "the" in existing API versions
Backport of 2db5676c6e to the swagger files
used in the documentation

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-01-27 12:24:47 +01:00
Sebastiaan van Stijn
4e8f3bcee1
docs: fix typos in API docs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-01-04 13:17:39 +01:00
Sebastiaan van Stijn
9122cd1a75
docs: add API v1.41
This copies the current swagger.yaml to the docs as v1.41.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-12-10 15:28:38 +01:00
Tonis Tiigi
8cc0fd811e docs: fix builder-version swagger
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-10-26 20:17:50 -07:00
Nikolay Edigaryev
7afef854ed api: clarify "v" option behavior in the container remove endpoint
Current description of the "v" option doesn't explain what happens to
the volumes that are still in use by other containers. Turns out that
the only volumes that are removed are unnamed ones[1].

Perhaps a good way of clarifying this behavior would be adapting the
description from "docker rm --help".

As for the docs/api/v1.*.yaml changes — they seem to be applicable,
since the origin of this behavior dates way back to the 2016 or v1.11[2].

[1]: a24a71c50f/daemon/mounts.go (L34-L38)
[2]: dd7d1c8a02

Signed-off-by: Nikolay Edigaryev <edigaryev@gmail.com>
2020-09-23 12:34:52 +03:00
Nikolay Edigaryev
13e0ba700a swagger: fix MemTotal units in SystemInfo endpoint
MemTotal represents bytes, not kilobytes. See Linux[1] and Windows[2]
implementations.

[1]: f50a40e889/pkg/system/meminfo_linux.go (L49)
[2]: f50a40e889/pkg/system/meminfo_windows.go (L40)

Signed-off-by: Nikolay Edigaryev <edigaryev@gmail.com>
2020-09-10 22:15:45 +03:00
Sebastiaan van Stijn
47b7c888ee
Merge pull request #41284 from akerouanton/service-ulimits
Support ulimits on Swarm services.
2020-07-30 20:08:41 +02:00
Albin Kerouanton
c76f380bea
Add ulimits support to services
Add Ulimits field to the ContainerSpec API type and wire it to Swarmkit.

This is related to #40639.

Signed-off-by: Albin Kerouanton <albin@akerouanton.name>
2020-07-29 02:09:06 +02:00
Sebastiaan van Stijn
51c7992928
API: add "prune" events
This patch adds a new "prune" event type to indicate that pruning of a resource
type completed.

This event-type can be used on systems that want to perform actions after
resources have been cleaned up. For example, Docker Desktop performs an fstrim
after resources are deleted (https://github.com/linuxkit/linuxkit/tree/v0.7/pkg/trim-after-delete).

While the current (remove, destroy) events can provide information on _most_
resources, there is currently no event triggered after the BuildKit build-cache
is cleaned.

Prune events have a `reclaimed` attribute, indicating the amount of space that
was reclaimed (in bytes). The attribute can be used, for example, to use as a
threshold for performing fstrim actions. Reclaimed space for `network` events
will always be 0, but the field is added to be consistent with prune events for
other resources.

To test this patch:

Create some resources:

    for i in foo bar baz; do \
        docker network create network_$i \
        && docker volume create volume_$i \
        && docker run -d --name container_$i -v volume_$i:/volume busybox sh -c 'truncate -s 5M somefile; truncate -s 5M /volume/file' \
        && docker tag busybox:latest image_$i; \
    done;

    docker pull alpine
    docker pull nginx:alpine

    echo -e "FROM busybox\nRUN truncate -s 50M bigfile" | DOCKER_BUILDKIT=1 docker build -

Start listening for "prune" events in another shell:

    docker events --filter event=prune

Prune containers, networks, volumes, and build-cache:

    docker system prune -af --volumes

See the events that are returned:

    docker events --filter event=prune
    2020-07-25T12:12:09.268491000Z container prune  (reclaimed=15728640)
    2020-07-25T12:12:09.447890400Z network prune  (reclaimed=0)
    2020-07-25T12:12:09.452323000Z volume prune  (reclaimed=15728640)
    2020-07-25T12:12:09.517236200Z image prune  (reclaimed=21568540)
    2020-07-25T12:12:09.566662600Z builder prune  (reclaimed=52428841)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-28 12:41:14 +02:00
Tibor Vass
846b7e24ba
Merge pull request #41254 from AkihiroSuda/deprecate-kernel-memory
Deprecate KernelMemory
2020-07-28 10:43:29 +02:00
Sebastiaan van Stijn
4750c28eea
Merge pull request #41236 from thaJeztah/move_version_to_definitions
Swagger: move system version response to definitions
2020-07-28 09:35:20 +02:00
Sebastiaan van Stijn
b36e87af03
Merge pull request #41249 from cpuguy83/swarm_caps
Replace swarm Capabilites API with cap add/drop API
2020-07-28 01:07:49 +02:00
Sebastiaan van Stijn
f2cc755f66
docs: API v1.39: move system version response to definitions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-27 21:07:24 +02:00
Sebastiaan van Stijn
e221931ccd
docs: API v1.40: move system version response to definitions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-27 21:03:39 +02:00
Brian Goff
4db39ab1a0
Merge pull request #41267 from thaJeztah/swagger_fix_buildcache_types 2020-07-27 12:02:53 -07:00
Brian Goff
24f173a003 Replace service "Capabilities" w/ add/drop API
After dicussing with maintainers, it was decided putting the burden of
providing the full cap list on the client is not a good design.
Instead we decided to follow along with the container API and use cap
add/drop.

This brings in the changes already merged into swarmkit.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-07-27 10:09:42 -07:00
Sebastiaan van Stijn
9a6402d761
docs: API v1.39: fix type for BuildCache CreatedAt and LastUsedAt
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-27 12:13:27 +02:00
Sebastiaan van Stijn
a305abb1d1
docs: API v1.40: fix type for BuildCache CreatedAt and LastUsedAt
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-27 12:12:25 +02:00
Akihiro Suda
b8ca7de823
Deprecate KernelMemory
Kernel memory limit is not supported on cgroup v2.
Even on cgroup v1, kernel memory limit (`kmem.limit_in_bytes`) has been deprecated since kernel 5.4.
0158115f70

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-07-24 20:44:29 +09:00
Sebastiaan van Stijn
a8b2272ab3
swagger: sync updates to v1.39
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-23 13:52:51 +02:00
Sebastiaan van Stijn
1e89ca40ba
swagger: sync updates to v1.40
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-23 13:35:54 +02:00
Sebastiaan van Stijn
d4b3e786ed
docs: add mention of DefaultAddressPools to API history
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-20 14:36:57 +02:00
Sebastiaan van Stijn
63382e5f3b
docs: sync API v1.39 swagger formatting with current version
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-03 20:32:51 +02:00
Sebastiaan van Stijn
01244e85e7
docs: sync API v1.40 swagger formatting with current version
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-03 15:42:41 +02:00
Jie Ma
3b80af727a fix typos and grammar in docs
Signed-off-by: Jie Ma <jienius@outlook.com>
2020-06-26 17:30:59 -06:00
Sebastiaan van Stijn
687bdc7c71
API: swarm: move PidsLimit to TaskTemplate.Resources
The initial implementation followed the Swarm API, where
PidsLimit is located in ContainerSpec. This is not the
desired place for this property, so moving the field to
TaskTemplate.Resources in our API.

A similar change should be made in the SwarmKit API (likely
keeping the old field for backward compatibility, because
it was merged some releases back)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-05 12:50:38 +02:00
Akihiro Suda
f350b53241 cgroup2: implement docker info
ref: https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-04-17 07:20:01 +09:00
Sebastiaan van Stijn
c8e31dc2f2
Merge pull request #39882 from thaJeztah/swarm_pids_limit
Add API support for PidsLimit on services
2020-04-16 21:02:30 +02:00
Sebastiaan van Stijn
54d88a7cd3
Merge pull request #40478 from cpuguy83/dont-prime-the-stats
Add stats options to not prime the stats
2020-04-16 20:57:06 +02:00
Sebastiaan van Stijn
157c53c8e0
Add API support for PidsLimit on services
Support for PidsLimit was added to SwarmKit in docker/swarmkit/pull/2415,
but never exposed through the Docker remove API.

This patch exposes the feature in the repote API.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-15 22:37:42 +02:00
Sebastiaan van Stijn
e9348898d3
api docs: fix broken link on GitHub
The pages that were linked to have moved, so changing the
links to point to docs.docker.com instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-09 13:44:51 +02:00
Sebastiaan van Stijn
2b8ae08571
docs: add API versions v1.30 - v1.37
Adding separate documents for older API versions, so that these don't have to
be collected from each tag/release branch. For each version of the API, I picked
the highest release that uses the API (to make sure to include possible fixes
in the swagger);

    git mv api/swagger.yaml api/swagger-current.yaml

    git checkout v18.05.0-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.37.yaml

    git checkout v18.02.0-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.36.yaml

    git checkout v18.01.0-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.35.yaml

    git checkout v17.11.0-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.34.yaml

    git checkout v17.10.0-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.33.yaml

    git checkout v17.09.1-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.32.yaml

    git checkout v17.07.0-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.31.yaml

    git checkout v17.06.2-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.30.yaml

    git mv api/swagger-current.yaml api/swagger.yaml

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-06 10:14:15 +02:00
Akihiro Suda
745fa04e52 service: support --mount type=bind,bind-nonrecursive
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-03-13 19:01:28 +09:00
Sebastiaan van Stijn
616e64b42f
API: deprecate /info "ClusterStore" and "ClusterAdvertise" fields
These fields will now be omitted when empty.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-03-03 18:10:47 +01:00
Brian Goff
ce1ceeb257 Add stats options to not prime the stats
Metrics collectors generally don't need the daemon to prime the stats
with something to compare since they already have something to compare
with.
Before this change, the API does 2 collection cycles (which takes
roughly 2s) in order to provide comparison for CPU usage over 1s. This
was primarily added so that `docker stats --no-stream` had something to
compare against.

Really the CLI should have just made a 2nd call and done the comparison
itself rather than forcing it on all API consumers.
That ship has long sailed, though.

With this change, clients can set an option to just pull a single stat,
which is *at least* a full second faster:

Old:
```
time curl --unix-socket
/go/src/github.com/docker/docker/bundles/test-integration-shell/docker.sock
http://./containers/test/stats?stream=false\&one-shot=false > /dev/null
2>&1

real0m1.864s
user0m0.005s
sys0m0.007s

time curl --unix-socket
/go/src/github.com/docker/docker/bundles/test-integration-shell/docker.sock
http://./containers/test/stats?stream=false\&one-shot=false > /dev/null
2>&1

real0m1.173s
user0m0.010s
sys0m0.006s
```

New:
```
time curl --unix-socket
/go/src/github.com/docker/docker/bundles/test-integration-shell/docker.sock
http://./containers/test/stats?stream=false\&one-shot=true > /dev/null
2>&1
real0m0.680s
user0m0.008s
sys0m0.004s

time curl --unix-socket
/go/src/github.com/docker/docker/bundles/test-integration-shell/docker.sock
http://./containers/test/stats?stream=false\&one-shot=true > /dev/null
2>&1

real0m0.156s
user0m0.007s
sys0m0.007s
```

This fixes issues with downstreams ability to use the stats API to
collect metrics.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-02-28 09:54:37 -08:00
Sebastiaan van Stijn
6fdbc50084
docs: add API versions v1.25 - v1.29, v1.38 - v1.40
Adding separate documents for older API versions, so that these don't have to
be collected from each tag/release branch:

- v1.40 - docker v19.03
- v1.39 - docker v18.09
- v1.38 - docker v18.06
- v1.29 - docker v17.05
- v1.28 - docker v17.04
- v1.27 - docker v17.03
- v1.26 - docker v1.13.1
- v1.25 - docker v1.13.0

Note that:

- API versions v1.30 - v1.37 are yet to be added after the tags and release-
  branches from the docker/docker-ce mono-repo have been extracted.
- docker v1.13.0 made the switch from using a markdown file to using swagger
  to document the API.

Approach taken:

    git mv api/swagger.yaml api/swagger-current.yaml

    git checkout upstream/19.03 -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.40.yaml

    git checkout v18.09.9 -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.39.yaml

    git checkout v18.06.3-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.38.yaml

    git checkout v17.05.0-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.29.yaml

    git checkout v17.04.0-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.28.yaml

    git checkout v17.03.2-ce -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.27.yaml

    git checkout v1.13.1 -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.26.yaml

    git checkout v1.13.0 -- api/swagger.yaml
    git mv api/swagger.yaml docs/api/v1.25.yaml

    git mv api/swagger-current.yaml api/swagger.yaml

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-24 11:00:35 +01:00