6293 Commits

Author SHA1 Message Date
9ea2024c55 [CI:DOCS] Correct link syntax
Signed-off-by: baude <bbaude@redhat.com>
2020-01-17 15:50:36 -06:00
37ec23b462 Merge pull request #4896 from baude/rtdapi
[CI:DOCS]Connect API docs and RTD
2020-01-17 22:26:56 +01:00
cc0f7defdc [CI:DOCS]Connect API docs and RTD
Signed-off-by: baude <bbaude@redhat.com>
2020-01-17 15:12:35 -06:00
3b6a843eb2 Merge pull request #4895 from cevich/swagpublish
[CI:DOCS] Post-process swagger yaml and publish
2020-01-17 21:55:11 +01:00
9be6f30a42 post-process swagger yaml for publish
Signed-off-by: baude <bbaude@redhat.com>
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-01-17 15:41:33 -05:00
ab7e1a4c40 Merge pull request #4892 from cevich/fix_upload_image
Minor: Bugfix in upload image
2020-01-17 18:25:24 +01:00
c2f50499c9 Tests for API v2
Initial framework for testing the version 2 (HTTP) API.
Includes a collection of tests for some of the existing
endpoints. Not all tests are currently passing.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-01-17 09:59:22 -07:00
f5e614b63f Merge pull request #4721 from openSUSE/tag-docs
Update `tag` documentation regarding 'alias' usage
2020-01-17 17:08:23 +01:00
c183dddea6 Minor: Bugfix in upload image
The release upload process always involves two filenames, however the
second filename might (someday) be optional.  The code allowed for this,
however input validation did not.  This change fixes the validation.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-01-17 10:43:48 -05:00
acbb6c064d Merge pull request #4873 from lsm5/debian-install-update
update install instructions for Debian, Raspbian and Ubuntu
2020-01-17 15:27:40 +01:00
38ba9e6922 Update tag documentation regarding 'alias' usage
The word `alias` is not very common when speaking about image names and
tags. So we just refer to image name as the overall identifier of an
image.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-01-17 08:51:36 +01:00
26b31fd29c update install instructions for Debian, Raspbian and Ubuntu
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2020-01-17 08:35:45 +05:30
74b89da27c Merge pull request #4837 from mheon/rework_attach
Add an API for Attach over HTTP API
2020-01-16 21:10:53 +01:00
79fbe7252e Merge pull request #4879 from vrothberg/install-golangci-updates
hack/install_golangci.sh: check env vars
2020-01-16 20:55:28 +01:00
1951ff168a oci_conmon: do not create a cgroup under systemd
Detect whether we are running under systemd (if the INVOCATION_ID is
set).  If Podman is running under a systemd service, we do not need to
create a cgroup for conmon.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-01-16 20:29:28 +01:00
427e87449d Merge pull request #4887 from vrothberg/fix-4886
e2e/run_signal_test.go: make it more robust
2020-01-16 20:23:37 +01:00
ac47e80b07 Add an API for Attach over HTTP API
The new APIv2 branch provides an HTTP-based remote API to Podman.
The requirements of this are, unfortunately, incompatible with
the existing Attach API. For non-terminal attach, we need append
a header to what was copied from the container, to multiplex
STDOUT and STDERR; to do this with the old API, we'd need to copy
into an intermediate buffer first, to handle the headers.

To avoid this, provide a new API to handle all aspects of
terminal and non-terminal attach, including closing the hijacked
HTTP connection. This might be a bit too specific, but for now,
it seems to be the simplest approach.

At the same time, add a Resize endpoint. This needs to be a
separate endpoint, so our existing channel approach does not work
here.

I wanted to rework the rest of attach at the same time (some
parts of it, particularly how we start the Attach session and how
we do resizing, are (in my opinion) handled much better here.
That may still be on the table, but I wanted to avoid breaking
existing APIs in this already massive change.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-01-16 13:49:21 -05:00
70236f56f9 systemdgen: specify --cgroups=disabled-conmon for --new
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-01-16 18:59:09 +01:00
ba0a6f34e3 podman: add new option --cgroups=no-conmon
it allows to disable cgroups creation only for the conmon process.

A new cgroup is created for the container payload.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-01-16 18:56:51 +01:00
30245affe9 Merge pull request #4884 from vrothberg/systemd-ignore
systemdgen: add --ignore flag to generic services
2020-01-16 18:31:08 +01:00
1d7176b135 Merge pull request #4869 from rhatdan/network
Remove c.String(net)
2020-01-16 17:07:56 +01:00
9d3667c2f0 systemdgen: add --ignore flag to generic services
The --ignore flag lets Podman ignore errors when a specified container
does not exist (anymore).  That's a nice addition to generic services
generated via the --new flag.  Those services create new containers and
can hence allows user to manually remove a container; may it only be by
accident.

The important part of using the --ignore flag is that Podman will exit 0
which plays nicer with most restart policies; a non-zero exit may yield
systemd to restart the entire service which is arguably wrong if the
user manually deletes the container.

If desired, users can still alter the generated files.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-16 16:36:21 +01:00
49703299b1 e2e/run_signal_test.go: make it more robust
Make the signal test more robust by just checking that the container's
exit code is non-zero.  There are two possible exit codes (i.e., 130 and
137) depending on how the container is being killed, which is likely
responsible for CI flakes.

Fixes: #4886
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-16 16:19:06 +01:00
d4ca3197b6 hack/install_golangci.sh: check env vars
Also make it executable and `set -eo pipefail`.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-16 15:26:25 +01:00
45e9a6b12e Remove c.String(net)
We have a lot of cludgy code trying to make --net and --network equivalent.
This will allow --net to still exists but will eliminate the help and confusion.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-16 09:23:32 -05:00
db00ee97e9 Merge pull request #4881 from vrothberg/terminate-service
v2: don't block sigterm and add the service to `make binaries`
2020-01-16 15:15:58 +01:00
c3d90179dc make binaries: include service
Include the service into make binaries such that we're it's being build
in the CI.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-16 14:05:39 +01:00
279bf40ab1 service: don't block sigterm
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-16 13:08:59 +01:00
61fbce710b Merge pull request #4882 from vrothberg/fix-gating
Cirrus: remove workaround for cleaning /go/bin
2020-01-16 12:53:08 +01:00
45a7e0146b Cirrus: remove workaround for cleaning /go/bin
Remove the temporary workaround for cleaning /go/bin in the gating task.
The workaround was added to make sure that we're always installing the
latest tools in `make install.tools`.  The gating image does not ship
with these pre-installed tools anymore which is now causing errors in
the gating task as the `rm` is missing the `--force` flag.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-16 12:08:58 +01:00
e1e405b70d Merge pull request #4807 from ssbarnea/fix/pre-commit
Enable pre-commit linting
2020-01-15 23:51:22 +01:00
741e29caf3 Merge pull request #4860 from vrothberg/v2-top
v2 api: top improvements
2020-01-15 23:33:10 +01:00
0870e88ff4 Merge pull request #4824 from edsantiago/bats
more BATS tests
2020-01-15 23:33:02 +01:00
978b891c8d Merge pull request #4874 from baude/swagcleanup
[CI:DOCS]swagger cleanup and left-hand nav
2020-01-15 21:45:11 +01:00
a6ea17455c [CI:DOCS]swagger cleanup and left-hand nav
add a static tags file so we can dictate the left-hand navigation. in
doing so we now override the tag in the swagger:operation. we now have
images and images (compat) as a way to differentiate.

Signed-off-by: baude <bbaude@redhat.com>
2020-01-15 14:22:25 -06:00
34429f3b53 Merge pull request #4870 from vrothberg/gating-dockerfile
Gating dockerfile
2020-01-15 19:01:25 +01:00
974373f2b3 Merge pull request #4868 from jwhonce/wip/sshd
[CI:DOCS] Add APIv2 CLI example POC
2020-01-15 18:14:11 +01:00
89678ab0ed Add APIv2 CLI example POC
* Add ReadMe, CLI and unit files to support socket activation, both for
  system and rootless

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-01-15 09:13:45 -07:00
69bd57f518 api: stats: fix typo
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-15 17:08:22 +01:00
a65068aff8 api: utils: add an IsLibpodRequest handler
Add a hanlder to figure out if the specified http request came through
a libpod endpoint.  A first user is the top endpoint which has a
different default value for `ps_args` depending if the request came
through the docker or libpod endpoint.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-15 17:08:22 +01:00
9d54815c26 refactor top code
Move the top logic from pkg/adapter into the (*libpod.Container).Top().
This way, we drop the dependency from pkg/api on pkg/adapters and have
a clearer separation of concerns.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-15 17:08:22 +01:00
88372c2c21 top: use a separate pipe for the error stream
Let's not mix apples and oranges and give stderr a dedicated pipe. This
way, we don't return conmon log messages if run in debug mode.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-15 17:08:22 +01:00
63d8ba64e4 v2 api: top improvements
* Use `pkg/adapter` to increase code reuse and reduce code redundancy.
* Extend swagger docs to mention AIX descriptors.
* Document the libpod endpoint which shares the same handler.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-15 17:08:16 +01:00
e025b43060 Merge pull request #4872 from vrothberg/v2-stats
v2 api: stats improvements
2020-01-15 16:18:36 +01:00
d8d42512c1 v2: stats: drop redundant sleep when streaming
Also remove the redundant stats handler in libpod.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-15 13:42:21 +01:00
b9be9e6170 v2: stats: libpod: use generic handler
The docker and libpod endpoints provide the same functionality, so
we can use the same handler.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-15 13:41:05 +01:00
fb5e597302 v2: stats: rigorous error checks
Also expect the container to be running.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-15 13:14:56 +01:00
0f6955c30e v2: stats: fix errors
Also add some comments.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-15 12:49:47 +01:00
d914cc231a Merge pull request #4859 from giuseppe/not-change-permission-for-rundir-tmpdir
oci_conmon: not make accessible dirs if not needed
2020-01-15 12:45:15 +01:00
3c7b7761ce v2: stats: do not ignore errors
We must check all errors and handle them properly. Otherwise, we can run
into nil dereferences ultimately killing the service.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-15 11:41:38 +01:00