1
0
mirror of https://github.com/projectatomic/atomic.git synced 2026-02-07 06:44:52 +01:00

30 Commits

Author SHA1 Message Date
Giuseppe Scrivano
24e1a61e99 pull: support src-creds option
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1120
Approved by: ashcrow
2017-10-26 16:49:44 +00:00
baude
057536cab4 Pull image to containers-storage
Signed-off-by: baude <bbaude@redhat.com>

Closes: #1089
Approved by: baude
2017-09-05 14:11:43 +00:00
Brent Baude
3c0cbc69ea Incorporate registries parsing tool
Ideally atomic will be able to run multiple container
runtimes.  In and effort to do so, we must have a concept
of a global registries configuration file which will allow
us to pull images with atomic and skopeo. The tooling
that parses the global configuration file is:

https://github.com/projectatomic/registries

This is step one in the implementation of this tooling
and direction.

Closes: #1003
Approved by: rhatdan
2017-05-17 15:19:53 +00:00
Brent Baude
cc0919c408 Adding base dbus integration tests
The following integration tests have been added:

* ScanList
* ImagePull
* ImageUpdate
* ImageUpate when at latest
* ImagePull when already at latest
* Run
* ContainersDelete
* ContainersDelete when container doesnt exist

Closes: #904
Approved by: rhatdan
2017-02-22 15:11:40 +00:00
Aaron Weitekamp
ddc72a61e8 Inline pubkeys in policy.json
Closes: #853
Approved by: rhatdan
2017-02-06 22:41:40 +00:00
Brent Baude
3d2acc23e8 Detect and install systemcontainer images
If an image from a registry has a label like:

    atomic.type=system

the Atomic CLI will now detect that prior to pulling
the image.  It will then switch the backend storage
to ostree.  In the case of install, it will both
pull to ostree and install it.

If the backend is switched, a message informing the user
as such will be shown.

The detection and switch of the backend can be overriden
 with the --storage option.

The following is an example of install:

$ sudo atomic install atomic-registry.usersys.redhat.com:5000/brentbaude/helloworld:latest

Note: Switching from the 'docker' backend to the 'ostree' backend based on the 'atomic.type' label in the image.  You can use --storage to override this behaviour.

Extracting to /var/lib/containers/atomic/helloworld.0
systemctl daemon-reload
systemctl enable helloworld

$ sudo ./atomic images list
   REPOSITORY                                                      TAG      IMAGE ID       CREATED            VIRTUAL SIZE   TYPE
   atomic-registry.usersys.redhat.com:5000/brentbaude/helloworld   latest   0056366e4ebd   2017-02-01 18:04                  ostree

$ sudo ./atomic containers list -a
   CONTAINER ID IMAGE                COMMAND              CREATED          STATE     BACKEND    RUNTIME
   helloworld   atomic-registry.user /usr/bin/run.sh      2017-02-01 18:04 failed    ostree     runc

Closes: #861
Approved by: baude
2017-02-04 17:05:24 +00:00
Brent Baude
1bdd84a507 Improve pull error messaging
When a fq image name is used, the error messages contained the full
stderr formed by skopeo.  It was preferable to only show the msg
portion of the error.

Closes: #862
Approved by: baude
2017-02-02 22:36:06 +00:00
Brent Baude
167986a809 Add pull by digest unittests
Added two tests for pull by digest: one where the image is not
present and the other when it is.

Also, addressed review comments.

Closes: #856
Approved by: baude
2017-02-01 20:02:00 +00:00
Brent Baude
c7aafb3314 Refactor Pull, Update, Install, Run
Refactor several of the atomic verbs and subverbs to take advantage
of object refactoring.

Also, do not pull images with skopeo if the local image is already
at the latest.

$ sudo python ./atomic --debug pull busybox
Namespace(_class=<class 'Atomic.pull.Pull'>, assumeyes=False, debug=True, func='pull_image', image='busybox', reg_type=None, storage='docker')
Latest version of busybox already present.

Closes: #825
Approved by: baude
2017-01-17 22:16:36 +00:00
Jonathan Lebon
e914747f32 pull: support dockertar for docker backend
Make `atomic pull` work with "dockertar:/path" arguments for the docker
storage backend just as well as it does for ostree.

Closes: #776
Approved by: rhatdan
2016-12-05 14:43:49 +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
Dan Walsh
217bc6288c Add dbus support for atomic pull
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
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
Dan Walsh
61b03d3c94 Pass down default policy_filename to skopeo copy command
We need this for integration tests

Closes: #663
Approved by: rhatdan
2016-09-27 17:53:33 +00:00
root
3902a12089 Adding better error message when trying to pull w/ dockerd not running.
Closes: #656
Approved by: rhatdan
2016-09-22 15:14:56 +00:00
Brent Baude
c20cc24d06 Atomic/pull.py: Fix logic error in pull
When a image without a registry is provided as input, i.e.

atomic pull busybox

We are not able to resolve that reference now because we can
no longer depend on docker's algo's for that as we now
use skopeo. Therefore, we now take the input, see if skopeo
inspect can resolve it; and then decompose the fqdn so we
can check if the registry is secure.  Had to make a small
change on the return types of util.decompose to ensure
it returns str objects or else it will return unicode in
python2.

Closes: #650
Approved by: rhatdan
2016-09-21 20:37:13 +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
e0c8e1d78c handle setting args when pulling image
Closes: #638
Approved by: rhatdan
2016-09-20 13:52:48 +00:00
Dan Walsh
f439d70f7a Add additional bash completions for push/pull
Closes: #635
Approved by: rhatdan
2016-09-20 09:20:59 +00:00
Brent Baude
384643a93e Atomic/push.py: Implement push with signing
Enabling signing and pushing at the same time.  At the time of
this writing, we cannot verify that the atomic targets are
working but the code is there.  THis is enabled with the
--type atomic switch. Otherwise, signatures are written locally
and the image is pushed.

Closes: #631
Approved by: rhatdan
2016-09-20 08:56:36 +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
Aaron Weitekamp
3554ed5225 add sigstore-type to validate labels
Closes: #599
Approved by: rhatdan
2016-09-19 13:33:16 +00:00
Aaron Weitekamp
aa9db7bd13 signing bootstrap workflow
Closes: #599
Approved by: rhatdan
2016-09-19 13:33:16 +00:00
Alex Jia
053b18ba91 Atomic.pull: add lost whitespace in help document
Signed-off-by: Alex Jia <ajia@redhat.com>

Closes: #601
Approved by: rhatdan
2016-09-09 12:17:06 +00:00
Giuseppe Scrivano
efdd1cec50 pull: refactor code in common with syscontainers
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #596
Approved by: rhatdan
2016-09-08 14:07:20 +00:00
Brent Baude
a6228f8c3c Atomic/sign.py: Add tag to signing image
Skopeo discards the tag when expanding the docker image
name.  We need the tag included when doing the verification,
so use util.decompose to derive the tag from the input name
and be sure to add it.

Also added some simple debug extensions to be able to see
what skopeo is doing when --debug is provided.

Closes: #595
Approved by: rhatdan
2016-09-07 21:04:11 +00:00
Brent Baude
ddfe8b14af Atomic/pull.py: Use skopeo to perform "pull" and signature verification
There is no change to a pull where --storage is ostree.  But for docker,
we now use skopeo copy to "pull" and image from a registry and verify
its signature (should the policy require it).

When docker is the destination for skopeo copy, it requires a tag.  If
no tag is given by the user, we inject "latest".

Closes: #586
Approved by: baude
2016-09-07 15:22:39 +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