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

141 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
Dan Walsh
b110e73c88 Refactor Trust code to work with dbus interface
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
Aaron Weitekamp
6d909022fc trust show GPG key ID
Closes: #702
Approved by: rhatdan
2016-10-13 20:59:03 +00:00
Aaron Weitekamp
8d23c2bffa remove sigstore config with trust delete 2016-10-13 13:34:20 -04: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
Brent Baude
4aa4318c29 decompose: Add ability to decompose image w/digest
Adding the ability to decompose an input image "name" that
includes a digest. For example:

docker.io/library/fedora@sha256:64a02df6aac27d1200c2572fe4b9949f1970d05f74d367ce4af994ba5dc3669e

Also, reword the decompose method in a Decompose class.  This simplifies the use of
decomposition and allows for growth.

Example usage:
   registry, repo, image, tag, digest = Decompose("docker.io/library/busybox:latest").all
   repo = Decompose("docker.io/library/busybox:latest").repo
   digest = Decompose("docker.io/fedora@sha256:64a02df6aac27d1200c2...67ce4af994ba5dc3669e").digest

Closes: #701
Approved by: rhatdan
2016-10-13 12:23:37 +00:00
Brent Baude
adc8956f50 Allow pull from registry not in docker conf
We now allow pulls from registries that are not in
the docker configuration file.  This altered our
decompose method a bit.  We now check the registry
in decompose to see if it resolves on the network.
If so, then we use it.

Closes: #693
Approved by: baude
2016-10-11 13:23:58 +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
Brent Baude
aa59a5e285 Introduce registry inspect methods
Add two classes and several new methods for inspecting
registries and images.  These methods are helpful
for:

* taking user input (i.e. image names, partial image names) and determining
the fully qualified names.
* determining the fq name when the registry is omitted by the user.
* obtaining image manifests
* mimicing skopeo inspect

Closes: #687
Approved by: baude
2016-10-07 19:54:35 +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
Brent Baude
e83c2c5dd8 Atomic.util: More robust decompose
Colleagues asked for decompose to be improved to where it took
an image name and broke it into registry, repo, image, and tag.
It also should mimic docker's implementation where 'library' is a known
exception

Also added unittests for decompose.  Removed a singular glob  test
as it is no longer valid

Closes: #677
Approved by: rhatdan
2016-10-05 17:00:11 +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
Aaron Weitekamp
0870507325 add atomic trust show
Closes: #629
Approved by: rhatdan
2016-09-20 08:48:20 +00:00
Aaron Weitekamp
b66284fb81 refactor trust
Closes: #629
Approved by: rhatdan
2016-09-20 08:48:20 +00:00
Aaron Weitekamp
dbba71243e update based on comments
Closes: #599
Approved by: rhatdan
2016-09-19 13:33:16 +00:00
Aaron Weitekamp
943c984d4c refactor trust
Closes: #599
Approved by: rhatdan
2016-09-19 13:33:16 +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
Aaron Weitekamp
6f016d7854 add test registries.d configs
Closes: #604
Approved by: baude
2016-09-15 14:24:49 +00:00
Aaron Weitekamp
fe2aab7b7c add default policy.json for tests
Closes: #604
Approved by: baude
2016-09-15 14:24:49 +00:00
Aaron Weitekamp
60e073d80e add default policy trust arg
Closes: #604
Approved by: baude
2016-09-15 14:24:49 +00:00
Aaron Weitekamp
7c53602688 update trust based on review feedback
Closes: #604
Approved by: baude
2016-09-15 14:24:49 +00:00
Aaron Weitekamp
0c69d7942f add trust unittests
Closes: #604
Approved by: baude
2016-09-15 14:24:49 +00:00
Aaron Weitekamp
1d4466e2c4 add basic unittests
Closes: #604
Approved by: baude
2016-09-15 14:24: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
Dan Walsh
e32d8692ad Split out atomic pull functions into their own source file.
Create a Pull class as a subclass of Atomic and move all of the
functions and CLI to this file.

Closes: #570
Approved by: baude
2016-09-01 19:02:07 +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