1
0
mirror of https://github.com/projectatomic/atomic.git synced 2026-02-05 18:45:01 +01:00
Commit Graph

1323 Commits

Author SHA1 Message Date
Shishir Mahajan
2ea2a32f19 Integration test: Create d-s-s config if it does not exist
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>

Closes: #924
Approved by: rhatdan
2017-03-01 20:37:32 +00:00
Shishir Mahajan
d5c6ea2279 Create /etc/sysconfig/docker-storage-setup if it does not exist
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>

Closes: #924
Approved by: rhatdan
2017-03-01 20:37:32 +00:00
Shishir Mahajan
064d6c503f Update man pages for atomic storage commands.
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>

Closes: #918
Approved by: rhatdan
2017-03-01 18:16:11 +00:00
Brent Baude
153f4b077f Atomic/storage.py: Reduce number of times NoDockerDaemon is called
Instead of calling the default_docker_lib function a bunch of times
in the arg parser, we call it one and use the result in the parser.

Also, tighten up some exit conditions where self.d.close() is being
called when dockerd is not running.

Closes: #921
Approved by: rhatdan
2017-03-01 16:22:03 +00:00
Giuseppe Scrivano
2880f3229d syscontainers: when using --rootfs create a symlink to rootfs
In this way it is still possible to access $DESTDIR/rootfs as in the
case --rootfs is not specified.

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

Closes: #922
Approved by: yuqi-zhang
2017-03-01 15:59:30 +00:00
Brent Baude
e7dfac48b7 Merge pull request #920 from baude/circular_dockerd
Atomic/util.py Fix Try/Catch exceptions for dockerd
2017-02-28 14:18:00 -06:00
Brent Baude
312685882d Atomic/util.py Fix Try/Catch exceptions for dockerd
Fix a cirucular dependancy in atomic storage reset where certain
functions require a dockerd but storage reset requires dockerd to
be stopped.
2017-02-28 14:11:32 -06:00
Giuseppe Scrivano
90146aa088 scan: use the best storage for mount
let the storage choose the best mountpoint.

Closes: https://github.com/projectatomic/atomic/issues/916

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

Closes: #917
Approved by: baude
2017-02-28 16:29:16 +00:00
Giuseppe Scrivano
4f567e4b87 scan: do not leak ostree mount points
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #917
Approved by: baude
2017-02-28 16:29:16 +00:00
Giuseppe Scrivano
668691bb1c mount: allow storage to choose the best mountpoint
It optimizes the OSTree case where we prefer to use the same file
system of the repository for the checkout so that we can use hard links
instead of copying files.

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

Closes: #917
Approved by: baude
2017-02-28 16:29:16 +00:00
Giuseppe Scrivano
101cb1946c scan: store the full path to the mountpoint
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #917
Approved by: baude
2017-02-28 16:29:16 +00:00
Brent Baude
f5419ec570 Atomic/scan.py: Return codes from scan should reflect scan results BZ 1387288
A user has asked for the return code from scans to reflect whether or not
all the scans were successful.  This was reported in https://bugzilla.redhat.com/show_bug.cgi?id=1387288

So now, a return code of 0 implies all scans were sucessful and the operation
completed normally.  A return code of 1 implies that not all scans were
successful OR the operation did not complete normally.

Closes: #919
Approved by: giuseppe
2017-02-28 14:47:12 +00:00
Brent Baude
358b97003e Refactor Scan
Refactor scan to use the backends as well as container and
image objects.

Closes: #919
Approved by: giuseppe
2017-02-28 14:47:12 +00:00
Shishir Mahajan
cdab678b7e Fix tests for issues: Atomic storage import and modify.
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>

Closes: #915
Approved by: rhatdan
2017-02-27 21:13:08 +00:00
Shishir Mahajan
b4d87da22b No need to ping. NoDockerDaemon exception is already raised.
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>

Closes: #915
Approved by: rhatdan
2017-02-27 21:13:08 +00:00
Shishir Mahajan
4e447bec32 Don't call d-s-s on executing atomic storage modify.
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>

Closes: #915
Approved by: rhatdan
2017-02-27 21:13:08 +00:00
Shishir Mahajan
5a0138b1bf Add overlay2 as a valid option in atomic storage modify autocomplete.
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>

Closes: #914
Approved by: rhatdan
2017-02-27 12:37:13 +00:00
Brent Baude
7047b63d2b Atomic/util.py: default_docker detects wrong library BZ# 1381696
When Atomic unmount is called on an overlayfs based dockerd,
the default docker library is incorrectly determined resulting in
failures to unmount.

We now first ask the running dockerd what its root library directory
is and use that if dockerd is running.

This resolves https://bugzilla.redhat.com/show_bug.cgi?id=1381696

Closes: #912
Approved by: rhatdan
2017-02-24 17:41:59 +00:00
Honza Horak
fbfba837cb Make --json and --verbose mutually exclusive for commands where both those options exist
Closes: #909
Approved by: rhatdan
2017-02-24 17:07:45 +00:00
Honza Horak
a039e730a7 Do not print docker command for atomic scan without verbose
When running atomic scan <img> --json, docker command is printed on stdout,
which makes the JSON output invalid.

This change only prints the docker command when --verbose or --debug options
are used.

Closes: #909
Approved by: rhatdan
2017-02-24 17:07:45 +00:00
Brent Baude
bae5518901 Atomic/storage.py: Prevent circular dep on dockerd
atomic storage reset requires that the dockerd be inactive.  However,
calling the d.info() requires that docker be active.  Adding the
NoDockerDaemon exception allows it to progress without the daemon.

This fixes https://github.com/projectatomic/atomic/issues/910

Closes: #913
Approved by: rhatdan
2017-02-24 16:54:15 +00:00
Brent Baude
e9a6d7498b Add integration test for dbus stop
Add tests to make sure stopping a container works through dbus

Closes: #908
Approved by: rhatdan
2017-02-23 17:11:13 +00:00
Daniel J Walsh
a16f089a25 Bump to version V1.16.1 v1.16.1 V1.16.1 2017-02-23 11:36:11 -05:00
Brent Baude
ca8c3a31dd Add dbus integration test for install and uninstall
Closes: #906
Approved by: baude
2017-02-23 16:15:06 +00:00
Aaron Weitekamp
af84413d03 use /run for temp public key dir
Closes: #876
Approved by: rhatdan
2017-02-23 15:22:30 +00:00
Aaron Weitekamp
3ac762901e parse inline keys
Closes: #876
Approved by: rhatdan
2017-02-23 15:22:30 +00:00
Shishir Mahajan
cec8759f63 Integration test for --lvname, --lvsize and --rootfs flags
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>

Closes: #905
Approved by: rhatdan
2017-02-23 14:39:35 +00:00
Brent Baude
a61de69aba Enable atomic push in dbus and add integrations tests
For potential cockpit use, we have enabled atomic push.  It returns
a 0 if successful or throws a dbus Exception upon failure.  Added
a series of integrations tests as well.

Closes: #907
Approved by: rhatdan
2017-02-23 14:28:37 +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
Brent Baude
23f4bc9143 Fix uninstall bug: BZ 1425495
The bug https://bugzilla.redhat.com/show_bug.cgi?id=1425495 demostrates
a case where atomic attempts to "add" a list and str resulting in a
TypeError exception.  This should resolve that BZ.

Closes: #903
Approved by: rhatdan
2017-02-21 21:57:26 +00:00
Shishir Mahajan
ab4e7cb0bb add --lvsize option to atomic storage modify
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>

Closes: #900
Approved by: rhatdan
2017-02-21 17:03:28 +00:00
Brent Baude
8fafc5feeb Account for API Changes in docker-py-2
The new 2.x version of the docker python API has non-backward
compatible changes.  These changes are described here:

https://docker-py.readthedocs.io/en/stable/change-log.html#breaking-changes

We need to account for docker.Client and docker.APIClient as well
as changes in the way kwargs are handled.  Also, it appears the
AutoVersion method is deprecated.

Closes: #894
Approved by: rhatdan
2017-02-21 14:17:51 +00:00
Shishir Mahajan
c42976adc3 Suppress STDOUT of lower level commands e.g. vgreduce, wipefs.
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>

Closes: #884
Approved by: rhatdan
2017-02-20 21:46:22 +00:00
Brent Baude
791f62eff9 Add base integration test for dbus
Define the methodology for testing dbus in integrations tests.  Using a decorator,
this allows us to automatically define and test dbus tests. This is only the base
test to exercise the testing.

Closes: #901
Approved by: rhatdan
2017-02-20 21:36:18 +00:00
Shishir Mahajan
db08293954 smarter_copy(): Split into separate copy() and remove() functions
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>

Closes: #892
Approved by: rhatdan
2017-02-20 21:10:14 +00:00
Brent Baude
ed9eaf2e55 Fix Stop Regression: BZ #1422448
BZ #1422448 actually points out one regression and one
bug related to atomic stop. The BZ itself points out
a TypeError exception in the code when trying to glue
together a python list and str.

Then the atomic stop command was failling in the case where a
STOP label was defined and it uses the variable $NAME resulting
in a subprocess exception.

The self.name variable was not being set by set_args after
refactoring occured.  Ideally, this should all be moved
into the image|container object handling but for now we
just handle it in set_args.

Also added a test in test_display to catch any future
regressions.

Closes: #899
Approved by: rhatdan
2017-02-20 20:37:38 +00:00
Brent Baude
6dcca7bc44 Enable dbus install
Enable for performing atomic install over dbus.

Closes: #887
Approved by: baude
2017-02-17 16:00:06 +00:00
Brent Baude
391a80a5c7 Enable dbus stop
Add the ability to be able to stop a container via dbus.

Closes: #886
Approved by: baude
2017-02-17 15:00:30 +00:00
Giuseppe Scrivano
305a9e09d8 syscontainers: allow delete by image id
Allow to delete a single layer by its ID

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

Closes: #890
Approved by: baude
2017-02-17 14:14:06 +00:00
Giuseppe Scrivano
17599687f3 syscontainers: refactor common code
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #890
Approved by: baude
2017-02-17 14:14:06 +00:00
Giuseppe Scrivano
8f9f567288 syscontainers: support @sha256: format for image listing
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #890
Approved by: baude
2017-02-17 14:14:06 +00:00
Giuseppe Scrivano
a05745c44e syscontainers: do not use raw manifest from Skopeo
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #890
Approved by: baude
2017-02-17 14:14:06 +00:00
Giuseppe Scrivano
ecd5533e74 syscontainers: skip @sha256: part in the default name
atomic install --system busybox@sha256:817a12.. installed a container
named busybox@sha256-817a12.. by default.  Change it to skip the
'@sha256:' part and generate only "busybox".

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

Closes: #890
Approved by: baude
2017-02-17 14:14:06 +00:00
Giuseppe Scrivano
1a6720609f syscontainers: drop sha256 only if prefix
After this fix, we can install a system container by the image sha256 ID:

atomic install --system busybox@sha256:817a12c32a39bbe394944ba49de563e085f1d3c5266eb8e9723256bc4448680e

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

Closes: #890
Approved by: baude
2017-02-17 14:14:06 +00:00
Brent Baude
b649d9d160 atomic_dbus.py: Allow for async scans via dbus
Users like cockpit need to be able to submit scan jobs and not
tie up the dbus bus while waiting for results. They also want
to be able to check the status of active scans.

We now have an AsyncScan method that takes an image|container
id in string format as input.  It will then thread the scan
and return.  The scan can then be monitored through dbus
signals.

Results can be obtained using the GetScanResultsByID method.

There is also an ActiveScans method that allows you to check
the active scans.  It returns a list of container|image ids
that are being scanned.

Closes: #885
Approved by: baude
2017-02-16 19:40:07 +00:00
Brent Baude
eea2cbd6a6 .redhat-ci.sh: Correct avoid selinux issues
At present, when overlayfs is used on RHEL and Centos to unlock
ostree, selinux and permissions get set with the wrong permissions.

This is a work-around for now.

Closes: #896
Approved by: jlebon
2017-02-16 15:47:29 +00:00
Brent Baude
b9b6ff378e Fix FQ Name for SystemContainers
When calling atomic images info --storage ostree <some_image>, the
FQ Name of the image being returned was incorrect.  We now call
Decompose to set the name correctly in the image object.

This was reported as a side issue in https://github.com/projectatomic/atomic/issues/870

Closes: #897
Approved by: rhatdan
2017-02-16 14:55:34 +00:00
Giuseppe Scrivano
26df3c1296 docker: do not raise exception if the image is not found
Solves this issue:

Namespace(_class=<class 'Atomic.install.Install'>, args=[], assumeyes=False, debug=True, display=False, func='install', image='localhost:5000/busybox', name=None, opt1=None, opt2=None, opt3=None, remote=None, setvalues=None, storage=None, system=False, user=False)
'NoneType' object has no attribute '__getitem__'
Traceback (most recent call last):
  File "./atomic", line 188, in <module>
    sys.exit(_func())
  File "/home/gscrivano/src/atomic/Atomic/install.py", line 112, in install
    img_obj = be.has_image(self.image)
  File "/home/gscrivano/src/atomic/Atomic/backends/_docker.py", line 75, in has_image
    return self._make_image(img, self._inspect_image(img), deep=True)
  File "/home/gscrivano/src/atomic/Atomic/backends/_docker.py", line 127, in _make_image
    img_obj.id = img_struct['Id']
TypeError: 'NoneType' object has no attribute '__getitem__'

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

Closes: #889
Approved by: rhatdan
2017-02-16 14:36:05 +00:00
Giuseppe Scrivano
0be19c2863 containers: simplify some code
dict already has a .keys() method.  Do not redefine it.

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

Closes: #889
Approved by: rhatdan
2017-02-16 14:36:05 +00:00
Giuseppe Scrivano
be4b7e1851 images: list raises an error when the filter is not known
atomic containers list -f FOO=BAR fails when FOO is not a known
filter.  Make "atomic images list" work in the same way and raise an
error instead of silently ignoring it.

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

Closes: #889
Approved by: rhatdan
2017-02-16 14:36:05 +00:00