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

462 Commits

Author SHA1 Message Date
Daniel J Walsh
a35ae1859a Merge pull request #267 from cdrage/fix-docs
Fix doc error in Debian installation docs
v1.8 v1.6
2016-01-04 16:22:58 -05:00
Charlie Drage
aeb141751d Fix doc error in Debian installation docs 2016-01-04 16:08:00 -05:00
Daniel J Walsh
cc5997a87f Merge pull request #266 from runcom/add-uid-atomic-top
Atomic: top: add optional uid,gid,user,group to ps_args
2015-12-23 12:55:32 -05:00
Antonio Murdaca
465ab1fc8f Atomic: top: add optional uid,gid,user,group to ps_args
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-12-23 18:19:41 +01:00
Daniel J Walsh
9202a3b944 Merge pull request #265 from baude/atomic_top_ps_args
Add -e to docker top to correct TTY issues (BZ 1293063)
2015-12-21 11:23:24 -05:00
Brent Baude
76a4113428 Add -e to docker top to correct TTY issues (BZ 1293063)
Depending on if a container has an allocated tty, you can get
different results from docker top unless you pass the -e
argument.  Adding the -e option will give correct results
regardless.

This is documented in https://bugzilla.redhat.com/show_bug.cgi?id=1293063.
2015-12-21 10:08:22 -06:00
Daniel J Walsh
c2faa99a4f Merge pull request #264 from baude/atomic_verify_fixes
Correct blank version names
2015-12-21 10:04:17 -05:00
Brent Baude
3331c19094 Correct blank version names
Due to a bug in atomic verify, sometimes the local and remote
versions ended up being blank.
2015-12-19 08:49:13 -06:00
Daniel J Walsh
3bb66c0a15 Merge pull request #258 from jandryuk/patch-1
Pass integer to dmsetup
2015-12-18 14:56:37 -05:00
Daniel J Walsh
b66c2344da Merge pull request #257 from baude/baude_tests
Add tests for Atomic diff and top
2015-12-18 14:54:09 -05:00
Daniel J Walsh
e549f0c0f4 Merge pull request #263 from dustymabe/dusty-re-enable-stop
Re-enable execution of the container image stop label
2015-12-18 14:33:37 -05:00
Dusty Mabe
4762405819 Re-enable execution of "stop" label from image.
In 374d344 "stop" was converted to only expect the argument provided
to be the name/id of a running container. This eliminated the usage
where a user wanted to execute the "STOP" label from a container image
rather than actually stopping a named container. This commit re-enables
the functionality to be able to run a stop label.
2015-12-18 14:19:48 -05:00
Daniel J Walsh
699c46f7b5 Merge pull request #262 from jlebon/pr/skip-integration-tests
test.sh: add TEST_INTEGRATION support
2015-12-18 13:44:45 -05:00
Jonathan Lebon
3dc7aa1723 test.sh: add TEST_INTEGRATION support
This allows users to skip all/certain tests.

$ sudo make test
	tests all integration tests

$ sudo make test TEST_INTEGRATION=
	skip all integration tests

$ sudo make test TEST_INTEGRATION='display pass'
	test only the 'display' and 'pass' integration tests

Resolves: #259
2015-12-18 12:26:53 -05:00
Dusty Mabe
ec724f7bca Allow additional args to be provided to "stop". 2015-12-18 12:07:46 -05:00
Daniel J Walsh
9b846b9042 Merge pull request #261 from jlebon/pr/f23-tweaks
F23 tweaks
2015-12-18 11:10:18 -05:00
Jonathan Lebon
f95bb160e8 migrate.sh: mount on /run for gotar
On the current F23 docker, mounting to /dev/shm does not work. Change it
to /run for now.
2015-12-18 10:41:34 -05:00
Jonathan Lebon
d34e4ff880 pylint: disable no-name-in-module for GLib
For some reason, pylint fails to find GLib in gi.repository. Disable
that error.
2015-12-18 10:41:34 -05:00
jandryuk
1e9e48a583 Pass integer to dmsetup
oscap-docker on Fedora 23 failed with a MountError exception.  strace-ing the process produced the following output:

[pid 17354] execve("/sbin/dmsetup", ["dmsetup", "create", "docker-253:1-791413-c135d4b9e1cd9f68485765ed681cf80b8fe1e91559fc8a3101ecf59e35a05501", "--table", "0 20971520.0 thin /dev/mapper/vg_air-docker--pool 445"], [/* 38 vars */]) = 0
[pid 17354] +++ exited with 1 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=17354, si_uid=0, si_status=1, si_utime=0, si_stime=0} ---
Traceback (most recent call last):
  File "/bin/oscap-docker", line 108, in <module>
    args.func()
  File "/bin/oscap-docker", line 44, in cve_scan
    result = OS.scan_cve(self.args.scan_target, self.unknown_args)
  File "/usr/lib/python3.4/site-packages/oscap_docker_python/oscap_docker_util.py", line 193, in scan_cve
    _tmp_mnt_dir = DM.mount(image)
  File "/usr/lib/python3.4/site-packages/Atomic/mount.py", line 294, in mount
    driver_mount_fn(identifier, options)
  File "/usr/lib/python3.4/site-packages/Atomic/mount.py", line 372, in _mount_devicemapper
    dm_pool)
  File "/usr/lib/python3.4/site-packages/Atomic/mount.py", line 91, in _activate_thin_device
    raise MountError('Failed to create thin device: ' + r.stderr.decode('utf-8'))
Atomic.mount.MountError: Failed to create thin device: device-mapper: reload ioctl on docker-253:1-791413-c135d4b9e1cd9f68485765ed681cf80b8fe1e91559fc8a3101ecf59e35a05501 failed: Invalid argument
Command failed

"dmsetup create" is passed decimal 20971520.0 when an integer is
required.

Floor division, //, provides the integer-only result desired in Python 2
and 3.

---
This is untested, but a similar change worked on Fedora's atomic-1.6-5.git09ac479.fc23.x86_64 package.
2015-12-18 08:41:40 -05:00
Brent Baude
f7a38d4e44 Add tests for Atomic diff and top
Basic tests for atomic diff and top which should catch
basic code regressions.

In top.py, added -n for number of iterations.  And added
tty detection so that tests can pass in a jenkins environment
where there is no tty.
2015-12-17 11:01:37 -06:00
Daniel J Walsh
a3d025cc1a Merge pull request #255 from rhatdan/mount
In docker-1.10 the device/imageIDs are not == to container ID
2015-12-16 15:34:51 -05:00
Daniel J Walsh
ac53ccaa4c Merge pull request #256 from rhatdan/verify
Code cleanup and port for python3
2015-12-16 15:12:37 -05:00
Dan Walsh
08c6083bf2 Code cleanup and port for python3
python3 changed the interator .next() to __next__()

Cleanup handling of local_nvr
2015-12-16 12:24:06 -05:00
Dan Walsh
749f4d1fd1 No need for from exceptions line, these are builtin, blows up on python3 2015-12-16 10:41:33 -05:00
Dan Walsh
68ae3bcc6f In docker-1.10 the device/imageIDs are not == to container ID
This is causing atomic unmount to fail. This searches for the DeviceName
in the list of containers to umount.

Since I was constantly typing `atomic umount` rather then `atomic unmount`,
I thought we should add an alias.
2015-12-16 10:41:33 -05:00
Daniel J Walsh
b8159d13b1 Merge pull request #254 from baude/atomic_top_repeated
Atomic Top: fix repeated process information
2015-12-16 08:30:17 -05:00
Brent Baude
4006a500a1 Atomic Top: fix repeated process information
Fixed an indention issue which caused the process
information to be repeated several times.
2015-12-15 16:45:42 -06:00
Daniel J Walsh
9062c274d4 Merge pull request #253 from rhatdan/master
Update version to 1.8
2015-12-15 14:40:39 -05:00
Dan Walsh
63fa20afb6 Update version to 1.8 2015-12-15 14:39:17 -05:00
Daniel J Walsh
a078c6bd76 Merge pull request #243 from baude/scan_errors
Add noprune to image deletion
2015-12-15 14:22:21 -05:00
Daniel J Walsh
9affefd4ae Merge pull request #252 from baude/atomic_diff_rpm_broke
Atomic Diff: RPMS arent being collected
2015-12-15 14:12:29 -05:00
Brent Baude
6baeb0f527 SCAN ERRORS: correct pruning and add unmount timeout
Correcting a bug observed by the openscap team where under
certain conditions, the deletion of a temporary image would
cause a traceback when noprune=False.

After discussing with dwalsh and vgoyal, we decided to revert
to the original PR implementation of a timeout as the lazy
umounts and deferred removals and deletion complicated matters.

We now have  simple timeout loop for unmounting by path to prevent
race failures between openscap, docker, the filesystem, and/or
dms.
2015-12-15 13:12:19 -06:00
Brent Baude
758ab4d7af Atomic Diff: RPMS arent being collected
Due to very small bug, the function that collects the
operating system version and RPMs was not being called.
2015-12-15 13:02:07 -06:00
Daniel J Walsh
96fff9d152 Merge pull request #251 from baude/top_man
Atomic Top Man
2015-12-14 12:09:29 -05:00
Brent Baude
f0900da257 Atomic Top Man
The man page for atomic top was accidently not commited in the
PR.
2015-12-11 15:31:01 -06:00
Daniel J Walsh
cbca98b956 Merge pull request #249 from rhatdan/top
CLeanups for running atomic top when no containers are running
2015-12-11 16:00:14 -05:00
Dan Walsh
2ba2c985e7 CLeanups for running atomic top when no containers are running 2015-12-11 14:40:55 -05:00
Daniel J Walsh
ac2f835bca Merge pull request #247 from baude/atomic_verify
atomic verify: remote inspect and more details
2015-12-11 09:12:56 -05:00
Brent Baude
2c7b463196 atomic verify: remote inspect and more details
With the remote_inspect function in RH docker, we can inspect
and image on a remote repository for various information like
versions (when present).  This allows us to expand atomic
verify to check a local version against a remote version.

atomic verify now can take an image as input (as before) and
provide a greater level of detail when checking each base
image (defined as a non-intermediate image).  It now iterates
on those base images looking for update status.

The output of atomic verify has also been changed slightly to
include a verbose option.  When invoked, the verify output
will list each base image with its versioning information.

The non-verbose output remains largely the same, where only
base images that have identified updates are put to stdout.
If verbose is not called for by the user but we find base
images with no version information, we output a warning
message and print verbosely anyway.

Updated man page
2015-12-10 13:53:22 -06:00
Daniel J Walsh
32d12efae4 Merge pull request #239 from baude/atomic_diff_fix
BUGFIX: Atomic diff leaks FD (BZ # 1285006)
2015-12-10 13:36:03 -05:00
Colin Walters
8146c0f449 Merge pull request #246 from rhatdan/master
Remove duplicate dbus import and add newline at end of atomic.py
2015-12-10 13:34:57 -05:00
Dan Walsh
a926483b33 Remove duplicate dbus import and add newline at end of atomic.py 2015-12-10 13:13:07 -05:00
Daniel J Walsh
15d64f0456 Merge pull request #245 from baude/atomic_top
Atomic TOP: Top-like display for container processes
2015-12-10 13:11:10 -05:00
Brent Baude
cf6806cff5 Atomic TOP: Top-like display for container processes
Adding a new atomic sub-command that behaves like GNU top
but for processes being run for containers.  It currently
displays the container id,  container name,
pid, cpu% (as reported by docker
top), mem% (as reported by docker top), and the command.

You can optionally pass in -o ppid, stime, time to collect
more data on the processes themselves.

While in the interactive display, you can also sort on
the columns to re-organize the data as needed.

You can define an interval for refreshing the process
information.

atomic top can be run without any additional
parameters.  If that is the case, it will by default
show processes for all active containers.  You can also
add one or more container_ids for exclusive process
monitoring by container.

Also added an AtomicDocker class to atomic.py which
allows for custom docker, python-api calls without
having to re-invent the wheel.
2015-12-10 11:24:08 -06:00
Brent Baude
327f152d4b BUGFIX: Atomic diff leaks FD (BZ # 1285006)
Under the condition that you diff two images and one or both
of the images are not RPM based, no cleanup of the mounts and
dm devices was done. This was reported via BZ #1285006.

We now handle the exit and cleanup differently which counts
for this condition.

Also added a try/except for catching control-c, where if found
it will clean up the mounts and dm devices.
2015-12-10 11:02:00 -06:00
Colin Walters
95b28a9ffd Merge pull request #238 from rhatdan/master
Use from . import methods
2015-11-30 16:40:55 -05:00
Dan Walsh
ec5ab037da Use from . import methods 2015-11-30 16:16:51 -05:00
Daniel J Walsh
ea7c6564a3 Merge pull request #236 from baude/break_out
Proposal: Move lengthy subfunctions to classes
2015-11-30 16:04:50 -05:00
Brent Baude
d9fed17a13 Move lengthy subfunctions to classes
Set a pattern where if an atomic subfunction
is lengthy, then we can break that out into its own class.
This reduces the overall size of the Atomic class and allows
new development and debug to be cleaner.

Instead of using the func function of argparser, we pass
the Class and Function that should be run as variables. For
example, the Atomic verify subfunction would now be:

    _class=Atomic.Atomic, func='verify'

The defined class is instantiated after parseargs is run.  We
then perform the set_args and call the function.
2015-11-30 14:53:21 -06:00
Daniel J Walsh
c9a028ece0 Merge pull request #237 from baude/align_images
RFE: Align output for atomic images (1285461)
2015-11-30 13:36:22 -05:00