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

1170 Commits

Author SHA1 Message Date
Dan Walsh
e9825ee6bf Bump version of atomic for rebuild in Rawhide list 2016-12-05 14:54:23 -05:00
Dan Walsh
0c8dcbbadc Merge branch 'master' of github.com:projectatomic/atomic 2016-12-05 14:48:36 -05:00
Antonio Murdaca
127d5a084d push: prompt user/pass lowercase
Signed-off-by: Antonio Murdaca <runcom@redhat.com>

Closes: #783
Approved by: rhatdan
2016-12-05 15:27:33 +00:00
Brent Baude
1db4288aa9 Atomic/diff.py: Use go-mtree for file comparisons
The previous algorithm for comparing files used python's
dircmp and is considered to be a shallow comparision.  This
allowed distinctly small possibilities that two files being
compared could be different but not caught.

We now use go-mtree to do the comparison.  This can emulate the
shallow comparison we had before but we can also adding a
sha256digest as part of the comparison using the new --keywords
option.

Also, made slight tweaks to gomtree functions in Atomic.util
so we debug and influence the return of JSON data.

This solves https://github.com/projectatomic/atomic/issues/761

Closes: #777
Approved by: rhatdan
2016-12-05 15:08:01 +00:00
Jonathan Lebon
d9dc546ba2 run: add --detach and only add -t if in a TTY
This makes the default SPC_ARGS and RUN_ARGS a bit smarter. We only add
"-t" if we're attached to a terminal, otherwise Docker will fail to
start. We also add a --detach option to passthrough to `docker run`.

These options make atomic easier to use through D-Bus.

Closes: #776
Approved by: rhatdan
2016-12-05 14:43:49 +00:00
Jonathan Lebon
6ad84003fa dbus: fix Install() and Run() signatures
The 'user' parameter of Install() is a bool, not a string.
The 'command' parameter of Run() is a list of strings, not a string.

Closes: #776
Approved by: rhatdan
2016-12-05 14:43:49 +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
f2db09b148 Atomic/top.py: Fix options handling in top
Fix the behaviour for atomic top where if you want to include
additional fields to monitor, you now specificy one field per
-o switch.  For example:

atomic top -o ppid -o time

Closes: #780
Approved by: baude
2016-12-02 13:58:24 +00:00
yuqi-zhang
91c900060f generate: default storage for mounts
If duplicate images exist in ostree and docker, mounting images
will fail during generate if storage is not specified.

Closes: #778
Approved by: rhatdan
2016-12-01 22:00:07 +00:00
Brent Baude
119304a11c Add fedora25_cloud target for vagrant
This allows us to test on Fedora 25 via make vagrant-check.

Closes: #772
Approved by: cgwalters
2016-11-30 21:26:51 +00:00
Brent Baude
c10c5f0b1a Atomic Info Unittests
Add unittests for ostree, docker backends for the version
sub-verb to images.

Closes: #774
Approved by: rhatdan
2016-11-30 17:11:24 +00:00
Brent Baude
ef984ed066 Refactor images
Covers all but verify and generate.  This is a refactoring of the
images subverbs (i.e. info, version, delete, ...)

Added in a unittest for list and info.

Closes: #771
Approved by: baude
2016-11-29 21:47:05 +00:00
Dan Walsh
a67082f3e4 The HELP label by default should be "help"
But we want to check for all cases.  Currently if a image uses the
standard help label, atomic will fail to find it.

Closes: #754
Approved by: rhatdan
2016-11-28 21:01:09 +00:00
Lars Karlitski
e937650ccd atomic_dbus: keep the name until the process exits
The call dbus.service.BusName() claims the name while the returned
object is alive. It wasn't stored into a variable, so the name was
released immediately, but the service keeps running (potentially
indefinitely) with no use.

Fix this by calling request_name() directly, so that we can give useful
feedback (and end the process) when the name is already owned by another
process.

Fixes #763

Closes: #770
Approved by: cgwalters
2016-11-26 18:49:58 +00:00
Dan Walsh
580bc2e460 Add substitutions for Opt variables
Closes: #734
Approved by: rhatdan
2016-11-26 12:04:34 +00:00
yuqi-zhang
4c4d855e1e Minor fix to delete
Change --storage flag to not conflict with -f, and update some tests
to not error on some duplicate storage.

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

Closes: #768
Approved by: giuseppe
2016-11-25 09:23:25 +00:00
Brent Baude
c9ca894d66 Atomic/mount.py: Re-Add _clean_temp_container_by_path (BZ 1397839)
Commit 9a0114c284 removed several
methods not used by Atomic CLI.  Unfortunately, one of the methods
was being called by openscap.  This is reported in bz# 1397839.

Reverted the removal of the method.

Closes: #769
Approved by: baude
2016-11-23 21:52:56 +00:00
Jonathan Lebon
75726671d8 test_util.py: adapt for newer sepolicies
In Fedora 25, the default container context changed to
'container_file_t'. Adapt the unit test accordingly.

Closes: #766
Approved by: rhatdan
2016-11-22 19:27:43 +00:00
Jonathan Lebon
660ea3e4a6 .redhat-ci.yml: test on Fedora 25
Closes: #766
Approved by: rhatdan
2016-11-22 19:27:43 +00:00
yuqi-zhang
148be22083 syscontainers: add rollback
Add --rollback flag to atomic update, which switches a system
container to the other deployment if one exists.

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

Closes: #762
Approved by: rhatdan
2016-11-22 19:17:17 +00:00
Brent Baude
16c761447c backends: has image|container return objects
If the has_image|has_container evals to True, then return
the proper object; else None

Add unittest structure for backends/backendutils.py

We want to make sure we have a good backend/backendutils
unittest.  This should simplify unittests for all backends.

refactor.py: Remove the file used to help mini-test the
refactoring work.  It is not needed by upstream and was
only including during the development phases.

Closes: #757
Approved by: baude
2016-11-22 15:38:13 +00:00
Giuseppe Scrivano
00501faba9 syscontainers: fix installation
bug introduced by:

syscontainers: use image instead of self.args.image

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

Closes: #751
Approved by: baude

Closes: #757
Approved by: baude
2016-11-22 15:38:13 +00:00
Giuseppe Scrivano
35dceef3e1 backends: add skeleton for ostree backend
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

backend: fix pylint issues for ostree backend

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

Add layer object, image object updates, pylint

layer.py: Add layer object
image.py: Add fq name propert, image equality methods, and remote inspection.
backends.py: Begin documentation of common methods
_docker.py: Adding methods: pull, make_remote_image, layers
Full pylint run and cleanups.  Passes all tests.

Closes: #757
Approved by: baude
2016-11-22 15:38:13 +00:00
Giuseppe Scrivano
ec3cb97c3d syscontainers: allow to specify what image to pull
syscontainers: get_containers accept what containers to inspect

syscontainers: use image instead of self.args.image
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #757
Approved by: baude
2016-11-22 15:38:13 +00:00
Brent Baude
5e4ef83304 Add refactoring structure
Atomic/backendutils.py: Class for working with unknown backend
Atomic/objects/image|layer|container.py: classes for objects
Atomic/backends/backend|_docker|_ostree.py: Abstract backends for ostree and docker

Closes: #757
Approved by: baude
2016-11-22 15:38:13 +00:00
Brent Baude
8971501f13 Atomic/mount.py: shutil.rmtree input must be dir
The unmount function for system containers was failing
for images that had regular files in its / directory
because shutil.rmtree was being used.  The rmtree method
requires its input to a path of type dir.  Added a simple
condition to check the input path and use os.remove(path)
on files.

Closes: #759
Approved by: rhatdan
2016-11-21 15:32:09 +00:00
Brent Baude
121435f1cc Use centos for all test images
To download less images, we now just used centos for the
base of all atomic-test images

Closes: #759
Approved by: rhatdan
2016-11-21 15:32:09 +00:00
yuqi-zhang
3af0bc2f9a syscontainers: output better json errors
Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>

Closes: #758
Approved by: rhatdan
2016-11-18 21:33:10 +00:00
Brent Baude
552e3f3bcb atomic diff: Add ability to compare metadata
With the -m switch, we can now compare the metadata between
the two diff objects.  We report only the differences between them. All
common data is deleted from the object structures.

This solves --> https://github.com/projectatomic/atomic/issues/760

Closes: #764
Approved by: baude
2016-11-18 21:22:51 +00:00
yuqi-zhang
bce4da585b syscontainers: environment variable detection
Add functionality to detect environment variables in template files.
The variables that can be set by the user through --set is displayed
on 'atomic images info'. The variables with overridable default
values will either have their default value displayed, or shown as
{SET_BY_OS} if atomic sets them. Variables without default value
must be set by the user and is listed separately.

Currently install --system already checks for variables that have no
value after install, and will error out.

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

Closes: #752
Approved by: giuseppe
2016-11-10 14:19:13 +00:00
Dan Walsh
8a0a5c7cfc Add SYSTEMD_IGNORE_CHROOT=1 to environment of SPCs
Systemd currently blocks apps from executing systemctl commands
from inside of a container effecting the host system.

If you set the  SYSTEMD_IGNORE_CHROOT=1  environment variable this
will turn off this behaviour, allowing a SPC to manage the hosts
systemd.

Closes: #755
Approved by: cgwalters
2016-11-09 16:47:55 +00:00
Dan Walsh
f111f9df45 Add SYSTEMD_IGNORE_CHROOT=1 to environment of SPCs
Systemd currently blocks apps from executing systemctl commands
from inside of a container effecting the host system.

If you set the  SYSTEMD_IGNORE_CHROOT=1  environment variable this
will turn off this behaviour, allowing a SPC to manage the hosts
systemd.
2016-11-09 10:05:09 -05:00
Dan Walsh
5a5e536004 The HELP label by default should be "help"
But we want to check for all cases.  Currently if a image uses the
standard help label, atomic will fail to find it.
2016-11-09 08:45:44 -05:00
Brent Baude
8ea8d1e82e make vagrant-check: Run tests with vagrant
Run tests in a vagrant session (w/libvirt for now).  This allows
the tests to occur similar to the way our jenkins tests work. Run
make vagrant-check and we created an F24 session and install
the proper deps.  We then call the .redhat-ci.sh script inside
the vagrant session and the tests are executed.  At this time, you
will need to vagrant halt to shutdown the session when comlete.

By default, the tests will exeute on an instance of fedora-24-atomic.
You can test on Colin's CAHC centos-atomic by:

make vagrant-check BOX=centos_atomic

Closes: #736
Approved by: rhatdan
2016-11-07 17:01:06 +00:00
Brent Baude
100031ec34 Allow granular UNIT tests
Making several changes to allow for more granular testing with make
check.

You can still run a granular INTEGRATION test with the TEST_INTEGRATION
keyword followed by the name (excluding test and .sh).  For example,

TEST_INTEGRATION=top ./test.sh

This will only run the top integration test.  We then do NOT run any of
the UNIT tests as it is assumed that the developer only wants to test
the specific integration test.

You can now test a singular UNIT test with the TEST_UNIT keyword.  Like
the integration test, simply name the test and exclude the prefixed
"test_" and file suffix of ".py"  For example,

TEST_UNIT=discovery ./test.sh

This will only run the discovery unit test; the pylint test and integration
tests will be skipped.

Closes: #728
Approved by: rhatdan
2016-11-07 15:21:59 +00:00
Dan Walsh
eccc9739a6 Bump to V1.14.0-dev 2016-11-07 10:20:22 -05:00
Dan Walsh
8046db2999 Bump to V1.13.8 v1.13.8 2016-11-07 10:10:18 -05:00
Dan Walsh
569c5d57fb Return image if exact match
Closes: #748
Approved by: rhatdan
2016-11-07 14:51:21 +00:00
Dan Walsh
fe026bd624 Fix atomic host man page
Closes: #746
Approved by: rhatdan
2016-11-05 11:06:16 +00:00
Brent Baude
d280be087d Atomic/discovery.py: Python3 byte vs str fixes
In code paths with Python 3, when dealing with remote registries,
we find that under certain conditions values are set as bytes which
need to be encoded/decoded to work properly with things like json
and ord().

Closes: #747
Approved by: rhatdan
2016-11-05 09:04:31 +00:00
Dan Walsh
4c3ea60df5 Revert accidental commit v1.13.7 2016-11-03 15:59:45 -04:00
Dan Walsh
1d01980dfe Bump to V1.16.7 2016-11-03 11:22:48 -04:00
Brent Baude
0a347975c4 Atomic/verify.py: Ensure probes use fq name
When walking the layers of an image in atomic verify, we need to be sure
we use a fq image name when probing.  In cases where the tagging includes
a non-fq image name, we were not.  This resolves Bugzilla 1377952.

Closes: #744
Approved by: baude
2016-11-03 14:30:46 +00:00
Dan Walsh
a45a2a9dad Bump to v1.13.6 v1.13.6 2016-11-01 14:03:15 -04:00
Brent Baude
8a46a639c4 Atomic/mount.py: Handle self.options == None
When using the dbus interface to perform a scan, self.options
was being set to None.  This tripped a condition with the
setting of args where it could not be iterated.  We now ensure
self.options is not None prior to the iteration.

Closes: #743
Approved by: rhatdan
2016-11-01 17:31:12 +00:00
Aaron Weitekamp
b17944dad4 return empty dict in get_registry_configs()
Closes: #742
Approved by: rhatdan
2016-11-01 14:46:07 +00:00
Dan Walsh
3d9567b332 Bump to v1.13.5 v1.13.5 2016-10-31 15:14:45 -04:00
Brent Baude
6f8a60eacc Atomic/sign.py: Ensure image tag is included in signing.
The previous change where we removed the tag from the write
file location impacted the signing because the tag was also
being omitted. This ensures the tag is omitted from the file
path but included in the call skopeo standalone-sign.

Closes: #741
Approved by: rhatdan
2016-10-31 15:45:08 +00:00
Dan Walsh
0331180c90 Bump to v1.13.4 v1.13.4 2016-10-28 14:36:39 -04:00
Jonathan Lebon
ca9d309436 .redhat-ci.yml: switch to CAHC image stream
Now that the backend has support for frequent, up-to-date CAHC images,
we can make use of it here and avoid a rebase and a reboot.

Closes: #739
Approved by: cgwalters
2016-10-28 14:56:07 +00:00