1
0
mirror of https://github.com/projectatomic/atomic.git synced 2026-02-06 21:45:24 +01:00

104 Commits

Author SHA1 Message Date
Dan Walsh
656ade8846 Cleanup handling of dbus calls and test client.
Closes: #723
Approved by: rhatdan
2016-10-24 21:39:23 +00:00
Dan Walsh
f9c6571c78 Don't switch to json, let dbus handle this
Closes: #723
Approved by: rhatdan
2016-10-24 21:39:23 +00:00
yuqi-zhang
fb3779349e Add --storage option to image-related commands
Add an optional --storage flag to the following commands:
 - images delete
 - info
 - mount
 - verify
 - version

If specified, the command will only look at the specified storage
(ostree/docker) for the image to perform the action. If not
specified, the command will look through both ostree/docker for
the image (as it was before). However, if the storage is not
specified and the image exists in both ostree and docker, the
command will error and prompt the user to specify. Image inspection
also no longer forces the user to delete/rename one or the other.

This is meant to address the duplicate naming issue (where a user
can have an image in both ostree and docker with the same name).

Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>

Closes: #720
Approved by: giuseppe
2016-10-24 09:27:00 +00:00
petervo
ab30d45a24 syscontainers: Fix docker: and dockertar: installs
Closes: #721
Approved by: rhatdan
2016-10-23 10:19:04 +00:00
Brent Baude
07d4e01c6b Atomic/verify.py: Smooth out verify issues
Several long-term issues existed for verify including some
munging of information between layers under certain
conditions.  This PR addresses these issues by simplifying
the way things are to be inspected.

Example output as follows:

```
$ atomic verify docker.io/library/busybox
$ atomic verify docker.io/ubuntu

docker.io/ubuntu:latest contains the following images:

NAME                           LOCAL VERSION        REMOTE VERSION       DIFFERS
docker.io/ubuntu:latest        44776f55294a30e89d6a f753707788c5c100f194 Yes

registry.access.redhat.com/rhel7/rsyslog:latest contains the following images:

NAME                           LOCAL VERSION        REMOTE VERSION       DIFFERS
rhel7/rsyslog                  rhel7/rsyslog-7.2-21 rhel7/rsyslog-7.2-29 Yes
rhel7/rhel                     rhel7/rhel-7.2-56    rhel7/rhel-7.2-104   Yes

$
```

Closes: #714
Approved by: baude
2016-10-19 20:41:49 +00:00
Giuseppe Scrivano
f869faf2c1 tests: enable again syscontainers test
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #711
Approved by: rhatdan
2016-10-18 12:16:57 +00:00
Brent Baude
112abcf2ac Atomic/info.py: Fix info and version
The atomic image version subcommand was broken.  Among the issues
was it called the wrong method, attempted to obtain the image
if not locally present, and outputted incorrect information. Some
of the problems were described in:

     https://github.com/projectatomic/atomic/issues/708

The version method has been redone to obtain the correct information.  It
no longer attempts to obtain the image if not present. It raises an
error.

Also, moved the version method into info and performed a pep8 clean up.

Example output now appears like:

```
atomic --debug version -r docker.io/busybox

IMAGE NAME                                     VERSION   IMAGE ID
10.3.11.254:5000/baude/busybox:latest          None      e02e811dd08f
  Tag: docker.io/busybox:latest
  Tag: localhost:5000/busybox:latest

atomic --debug version -r registry.access.redhat.com/rhel7/rsyslog

IMAGE NAME                                               VERSION                IMAGE ID
registry.access.redhat.com/rhel7/rsyslog:latest          rhel7/rsyslog-7.2-21   53f20e902da7
registry.access.redhat.com/rhel7.2:7.2-56                rhel7/rhel-7.2-56      1a9b3357bac5

```

Closes: #710
Approved by: baude
2016-10-14 19:53:03 +00:00
Jonathan Lebon
49f2f9ff64 test_printenv.sh: use realpath
Otherwise the $PWD env var will not match.

Closes: #684
Approved by: cgwalters
2016-10-13 16:37:01 +00:00
Jonathan Lebon
d04d3aa454 test_help.sh: check for groff before testing
Atomic Host variants do not have groff (and most likely never will since
it would pull in a lot of Perl packages). Print out a nicer error if
we're on AH, and make sure to skip that test.

Closes: #684
Approved by: cgwalters
2016-10-13 16:37:01 +00:00
Dan Walsh
217bc6288c Add dbus support for atomic pull
Closes: #682
Approved by: rhatdan
2016-10-08 09:56:20 +00:00
Dan Walsh
57a223b401 Add dbus support for atomic top.
Also add missing force qualifier for ContainersDelete

Closes: #682
Approved by: rhatdan
2016-10-08 09:56:20 +00:00
Giuseppe Scrivano
ad82d64520 syscontainers: allow to specify image id by its prefix
Raise an error if there are more images matching the same prefix.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #683
Approved by: rhatdan
2016-10-06 11:07:34 +00:00
yuqi-zhang
075035a052 version: save and display system image info
Save labels from docker manifest into ostree, so when a user invokes
'atomic version' on a system image, the metadata info is displayed,
same as docker images.

Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>

Closes: #679
Approved by: giuseppe
2016-10-05 12:36:57 +00:00
Dan Walsh
c0256dcfe6 Implement dbus interface for atomic commands
Add missing interfaces.

Fix functions to return text, rather then displaying directly.

Change atomic_client.py to take input from command line. These args are translated into function calls in python.

Add tests scripts in tests/integration/dbus directory

Closes: #668
Approved by: rhatdan
2016-10-04 14:31:42 +00:00
Giuseppe Scrivano
fc0aea92ea syscontainers: remove tmpfiles conf file on error
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #665
Approved by: rhatdan
2016-09-27 12:40:18 +00:00
yuqi-zhang
3e55ad6621 Start/stop syscontainers with atomic run/stop
Wrap atomic run/stop with systemctl start/stop for system
containers. This way the user can directly use the atomic
CLI for the full container cycle. In addition, the equivalent
functionality already exists for docker containers, so it
makes sense to allow system containers to start/stop in a
similar fashion.

Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>

Closes: #651
Approved by: rhatdan
2016-09-21 20:56:13 +00:00
Giuseppe Scrivano
57a0546010 syscontainers: store full image name
store the full image name, registry included, when pulling an image.

Some characters in the url are not usable for the name of an OSTree
ref, so escape them with '_'.  This change breaks old images already
pulled.

use "rm -rf /ostree/repo/refs/heads/ociimage" and pull the images
again.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #620
Approved by: cgwalters
2016-09-21 19:33:16 +00:00
Brent Baude
f60218a679 Atomic/pull.py: Set docker as default backend
Setting docker as the default backend instead of ostree.

Closes: #637
Approved by: rhatdan
2016-09-20 16:07:32 +00:00
yuqi-zhang
ddabf2715f syscontainers: display better container status
Change the status in "atomic containers list" to display systemd
state instead of runc state. This way system containers match user
containers. Another reason for the switch is that systemctl
start/stop creates/destroys a runc container every time instead of
using the same container, so systemd gives better indication of
container status.

Also expand the states to be:

 - running: container is running correctly
 - inactive: container is stopped/newly created and ready to run
 - failed: either systemd service or container process failed

instead of just "exited" and "running" as before.

Add tests and fix to test-image originally by Giuseppe.

Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>

Closes: #619
Approved by: giuseppe
2016-09-16 08:05:49 +00:00
Dan Walsh
f3c036888b Fix test cases using atomic -y ...
Previous patch broke test cases

Closes: #602
Approved by: rhatdan
2016-09-12 20:41:50 +00:00
Giuseppe Scrivano
085ec47e3d syscontainers: keep a copy of the installed files
It is useful in case of reverting to an old version.  We may want to
do this automatically, without any manual intervention.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #596
Approved by: rhatdan
2016-09-08 14:07:20 +00:00
Colin Walters
b924c7d843 syscontainers: Don't start on install
Interactive users or deployment systems may want to perform
configuration before starting.  For example, I may want to configure
the flannel data in etcd before starting flannel.

This topic comes up a lot in the RPM/deb worlds too; most RPM
distributions are inconsistent about this, whereas Debian basically
never starts a service on package install.

I think also it's better to teach admins to use systemd for service
management directly.

(This commit also changes things so we only `enable` on initial install,
 which is a minor tweak)

Closes: #584
Approved by: rhatdan
2016-09-06 20:25:51 +00:00
Dan Walsh
29e7829fd8 Move atomic ps to atomic containers
As we add more commands related to containers, IE Trim, we need to make
containers be a subcommand and add verbs like list, and trim

Closes: #579
Approved by: giuseppe
2016-09-02 11:10:08 +00:00
Giuseppe Scrivano
55855e77eb syscontainers: track installed files with systemd-tmpfiles
Allow images to have an additional /exports/tmpfiles.template file that
specifies what directories/files must be present on the host.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #559
Approved by: rhatdan
2016-08-30 11:28:22 +00:00
Giuseppe Scrivano
d582ae4703 images: hide generate if gomtree is not available
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #567
Approved by: rhatdan
2016-08-29 18:46:29 +00:00
yuqi-zhang
2c16996737 pull: change output for pulled layers
Change "Missing layer" to "Pulling layer" to make it look less like
an error and more like an action during "atomic pull".

Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>

Closes: #560
Approved by: cgwalters
2016-08-26 15:28:55 +00:00
Colin Walters
afc0435458 tests: Start a libtest.sh like model for syscontainers test
I'm trying to debug things here, and it's nicer to have more
info, like `libtest.sh` in ostree does.

Closes: #556
Approved by: giuseppe
2016-08-24 08:00:18 +00:00
Giuseppe Scrivano
27de276af3 Store gomtree manifests under /var/lib/atomic
/var/lib/containers/atomic is for exploded containers, do not store
gomtree manifests there.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #549
Approved by: cgwalters
2016-08-22 17:52:32 +00:00
Giuseppe Scrivano
092133dbe5 update: skip installation if latest version is already installed
Now that we have a proper version tracking for the images and the
installed containers, we can skip update if the latest version is
already used.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #549
Approved by: cgwalters
2016-08-22 17:52:32 +00:00
Giuseppe Scrivano
b52be14b9c syscontainers: remove gomtree check leftover
was mistakenly left after 184955e957

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #549
Approved by: cgwalters
2016-08-22 17:52:32 +00:00
Jan Pazdziora
5992c1b3e5 Extend RUN_OPTS_FILE tests to check that multiple options can be passed in
Closes: #550
Approved by: rhatdan
2016-08-22 10:57:14 +00:00
Giuseppe Scrivano
b98f9ebd55 tests: test gomtree manifest generation for Docker image
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #536
Approved by: cgwalters
2016-08-19 14:14:24 +00:00
Jan Pazdziora
f97e97f172 Add support for LABEL RUN_OPTS_FILE and ${RUN_OPTS}
Closes: #541
Approved by: rhatdan
2016-08-19 13:02:26 +00:00
Shishir Mahajan
23c044303c Fixes issues in atomic migrate export and import. Disable test_migrate.sh
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>

Closes: #542
Approved by: giuseppe
2016-08-18 18:33:42 +00:00
yuqi-zhang
42c6094e3f syscontainers: add --rootfs to atomic install
Add --rootfs=ROOTFS to atomic install, which allows users to specify
an existing exploded container or existing rootfs location as ROOTFS.
The existing rootfs will be used as a read-only rootfs for the new
container to be installed, and therefore the new container would
only contain configuration files. (Note: currently all system
containers must have a read-only rootfs by default).

A use case for this would be using existing container's rootfs
through NFS, etc to serve as the rootfs for many containers running
the same image. This avoids duplicate storage of having a container
on each machine in a cluster.

A user can update only the remote container's config file parameters
with 'atomic update', and uninstalling a remote container does not
affect the rootfs specified in ROOTFS.

Closes: #527
Approved by: giuseppe
2016-08-12 22:07:36 +00:00
Stephen Chung
d4728ae10f verify: validate layers of system image stored on disk
Integrate go-mtree tool into atomic CLI command, `atomic verify -V <imagename>`.
(Note that `gomtree` is still in development and thus we would need some way of
obtaining updated gomtree binaries) When a user does an atomic pull,
validation manifests for that system image's layers are created and stored in
/var/lib/atomic. When user does `atomic verify -V <system image>`, these manifests
are then validated against the image that is on disk (which would be stored in ostree).

Signed-off-by: Stephen Chung <schung@redhat.com>

Closes: #531
Approved by: rhatdan
2016-08-12 18:55:44 +00:00
yuqi-zhang
16d670ff21 Fix wrong filtered variable in test_ps
Closes: #533
Approved by: giuseppe
2016-08-11 19:03:40 +00:00
Giuseppe Scrivano
6ff40cbf5e ps: do not show Docker containers multiple times
regression introduced with 63024095fa

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #528
Approved by: rhatdan
2016-08-10 12:41:35 +00:00
Giuseppe Scrivano
72236c7c26 tests: run atomic with --debug
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #528
Approved by: rhatdan
2016-08-10 12:41:35 +00:00
AmartC
63024095fa Implementing Atomic ps for DBus API
Closes: #516
Approved by: giuseppe
2016-08-05 17:48:23 +00:00
Giuseppe Scrivano
af4eb6ce72 ps: include system containers command
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #515
Approved by: cgwalters
2016-08-05 11:03:40 +00:00
Giuseppe Scrivano
7bf0ac2dd9 ps: include system containers without a runc state with --all
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #515
Approved by: cgwalters
2016-08-05 11:03:40 +00:00
Giuseppe Scrivano
fd3acf8569 syscontainers: fix prune
It was broken by some recent refactoring, add some tests to catch
these cases.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #515
Approved by: cgwalters
2016-08-05 11:03:40 +00:00
Giuseppe Scrivano
1d987bfda0 images: system images honor --all
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #514
Approved by: rhatdan
2016-08-04 11:50:09 +00:00
Giuseppe Scrivano
c367f7d9d7 syscontainers: use the ID from Docker instead of the OSTree rev
To find the ID for an image, try in order:

1) Digest from the docker.manifest metadata
2) $SHA if $SHA in ociimage/$SHA is a valid checksum
3) OSTree commit

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #506
Approved by: rhatdan
2016-08-04 10:03:20 +00:00
Giuseppe Scrivano
f4fa14191e verify: basic support for system images
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #506
Approved by: rhatdan
2016-08-04 10:03:20 +00:00
Giuseppe Scrivano
39bb8eda43 mount: allow shared mount for system containers
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #507
Approved by: rhatdan
2016-08-03 10:07:50 +00:00
yuqi-zhang
6fcfea443d images: add more sub-commands to images
Add the following sub-commands to "atomic images list"

  --all: show all images, including intermediate images

  --filter: filter output based on given filters

  --quiet: only display image IDs

and corresponding bash auto-complete, tests, and documentation.

Closes: #502
Approved by: rhatdan
2016-07-29 12:19:21 +00:00
Giuseppe Scrivano
c34c42ba67 tests: fix label ordering in test_info
do not fail the test if the returned labels are not in the same order as
expected.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #503
Approved by: cgwalters
2016-07-29 10:50:54 +00:00
Giuseppe Scrivano
16450623ef iQIcBAABAgAGBQJXl4IwAAoJECY9bfLhY+Hq+3AQAJIRku1Yo5/1rqPuFiYr2rlq
gaYQToQv5ILtvl6kukQUP8msJs4JtTDULkW7fQYPwCtjhmFTbFAOFSnj0j3fnz/Q
 sm8YNA2kdrtWYnbFTCR5EwA+nYoajim8OwZlVb6ewutGHpMeK6n+p9OVaTI06qfE
 ZMpkJTZPzr0zT1/ysSf8SYmQMqgMOO5Z9t32jFZEpedRKNmjEjhL+aNTi2Z6XX6E
 UfFYUGxBjoxkkWWSgY1zu6S6/Lq5C1vae5i+GzZc70OT2qE2i+lM9EM2JDdbiGZq
 INBZKllYfbjoQE0gPsbWEghMmBMsx0vw04NVV184oCyTBhnaog5NyXmvmNgZocKU
 ftUEK862t9S2MCBSg4gN0jenbQD/uhBBpRsfZFXbBwCQgiGkPC+XppN+FPAf27Ag
 SoK4WWw4whgLvCK4CwuYD7XyWryWq6JHZPpqvuXjBIT1vIwmm4WBR3TG8Lx0/1Jj
 Izc2hO2v+7USWjEAioDKYI7Kpllvnsb2fvvpxcWBDi7Q21pYxWXNJWZHmRYNpEZ6
 EYlmoAjoBEt1iomBfHMTuwKF0vUYM9EXZ+exkQXNnQ/lQXfRZODt4gZTKKNN9Exo
 6XU6RT5tZozsheKS+v0xDPWjSnlORySs8s+XrKa0KNOjM87pedwQDJcSJ3WYh7C2
 483/CSCFnGBW+bbhYGbI
 =tmNr
 -----END PGP SIGNATURE-----

Revert "Migrate script should now work since we are after docker-1.10"

It breaks the tests suite

This reverts commit 7fcd49ebdd.

Closes: #497
Approved by: jlebon
2016-07-26 15:52:25 +00:00