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

67 Commits

Author SHA1 Message Date
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
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
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
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
Giuseppe Scrivano
3190da65f8 bash: do not print error if checkout dir doesn't exist
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1387860

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

Closes: #722
Approved by: rhatdan
2016-10-24 13:13:08 +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
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
Dan Walsh
3b486957de Remove primary commands and move to images subcommand
In order to cleanup code and simplify interface, i
move help, info, verify and version to the images subcommand.

Remove man pages for these atomic commands and add info to images subcommand.

Since these have been previously documented we will continue to support
atomic help
atomic info
atomic verify
atomic version

But we will not document them.

Closes: #676
Approved by: rhatdan
2016-10-08 09:46:56 +00:00
yuqi-zhang
20cc5ecfdd images: fix system images auto-complete
Image names are stored differently in ostree, and thus cannot be
directly used as we used to.

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

Closes: #681
Approved by: rhatdan
2016-10-06 10:11:37 +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
1609f8d3af Code cleanup for atomic sign
We need to default the gnukeyring to the users login directory. To
make it easier for the user.

Also add bash completions for -g option

Closes: #671
Approved by: rhatdan
2016-10-04 14:44:12 +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
Dan Walsh
f439d70f7a Add additional bash completions for push/pull
Closes: #635
Approved by: rhatdan
2016-09-20 09:20:59 +00:00
Aaron Weitekamp
0870507325 add atomic trust show
Closes: #629
Approved by: rhatdan
2016-09-20 08:48:20 +00:00
Dan Walsh
9350770c33 Fix up atomic trust completions
Closes: #627
Approved by: rhatdan
2016-09-18 11:40:43 +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
41884aa683 add bash completions
Closes: #604
Approved by: baude
2016-09-15 14:24:49 +00:00
Dan Walsh
48c1d2519c Add support for deleting containers
We want to be able to delete containers from the system, using the
new atomic containers delete call.

atomic containers delete --all

Comes in handy.

Closes: #598
Approved by: giuseppe
2016-09-08 20:29:15 +00:00
Shishir Mahajan
aa7114a8f1 Add atomic containers trim
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>

Closes: #572
Approved by: rhatdan
2016-09-07 20:02:33 +00:00
Dan Walsh
a04847b5e5 Change options to the agreed syntax.
We agreed on using --sign-by for specifying the signer, and --directory
to specify the output directory for images.

Closes: #583
Approved by: rhatdan
2016-09-06 13:25:28 +00:00
Alex Jia
68b216ce03 update bash completion
Signed-off-by: Alex Jia <ajia@redhat.com>

Closes: #573
Approved by: rhatdan
2016-09-06 12:31:08 +00:00
Dan Walsh
ac78ecd44e Add bash completions for atomic sign
Closes: #582
Approved by: rhatdan
2016-09-03 09:24:16 +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
Colin Walters
49d81e884e images-list: Add --json
When trying to script `atomic` via Ansible, in order to implement
idempotence we need the ability to introspect the current state
in a machine-readable way.

`ps` already has `--json`, so teach `images list` about it too;
the implementation is trivial.

Closes: #548
Approved by: rhatdan
2016-08-21 10:02:27 +00:00
Giuseppe Scrivano
fa8626a9ae verify: add autocompletion for --no-validate
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #536
Approved by: cgwalters
2016-08-19 14:14:24 +00:00
Dan Walsh
45ec779178 Move generate from atomic verify to atomic images
Also breakout images handling into a separate python file.

Atomic/images.py

I have switched atomic images generate to generate an images
mtree file for each image in the system.

Closes: #534
Approved by: giuseppe
2016-08-16 08:03:19 +00:00
yuqi-zhang
42c6094e3f syscontainers: add --rootfs to atomic install
Add --rootfs=ROOTFS to atomic install, which allows users to specify
an existing exploded container or existing rootfs location as ROOTFS.
The existing rootfs will be used as a read-only rootfs for the new
container to be installed, and therefore the new container would
only contain configuration files. (Note: currently all system
containers must have a read-only rootfs by default).

A use case for this would be using existing container's rootfs
through NFS, etc to serve as the rootfs for many containers running
the same image. This avoids duplicate storage of having a container
on each machine in a cluster.

A user can update only the remote container's config file parameters
with 'atomic update', and uninstalling a remote container does not
affect the rootfs specified in ROOTFS.

Closes: #527
Approved by: giuseppe
2016-08-12 22:07:36 +00:00
Giuseppe Scrivano
e8243aaff1 bash: add autocompletion for install --user
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #524
Approved by: rhatdan
2016-08-09 17:00:29 +00:00
Giuseppe Scrivano
d1def191ad pull: drop option --user
Pull to the user repo by default when running as non root user

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

Closes: #524
Approved by: rhatdan
2016-08-09 17:00:29 +00:00
yuqi-zhang
6fcfea443d images: add more sub-commands to images
Add the following sub-commands to "atomic images list"

  --all: show all images, including intermediate images

  --filter: filter output based on given filters

  --quiet: only display image IDs

and corresponding bash auto-complete, tests, and documentation.

Closes: #502
Approved by: rhatdan
2016-07-29 12:19:21 +00:00
Mahmoud Tohmaz
6d42041afe Atomic now has --user flag. 2016-07-25 20:48:25 -04:00
yuqi-zhang
45c0902529 atomic: add sub-commands to atomic ps
Add the following sub-commands to ps:

  --filter: filter output based on given VAR=VALUE

  --no-trunc: do not truncate output

  --quiet: only display container IDs

and corresponding bash auto-complete, tests, and documentation.

Closes: #493
Approved by: rhatdan
2016-07-25 19:07:50 +00:00
Jhon Honce
4abc3eb8c9 Refactor 'atomic images list --prune' to 'atomic images prune'
Update supporting files and tests

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #492
Approved by: rhatdan
2016-07-21 10:43:40 +00:00
Jhon Honce
eeac7339f7 Card container_security_114 - Add delete image support
* Add support for calling skopeo to delete v2 images from v2 registry
* Implement atomic images list --no-trunc
* Update documentation and bash tab expansion
* Cleanup code and comments
* Update integration tests

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #425
Approved by: rhatdan
2016-07-20 09:59:09 +00:00
Giuseppe Scrivano
3281a8f97e bash: fix bash completion for system containers
Support also mount and scan

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

Closes: #467
Approved by: rhatdan
2016-07-14 10:45:43 +00:00
Micah Abbott
ffbcbf4bae status: support JSON output
Add support for 'rpm-ostree status --json'

Fixes #469

Signed-off-by: Micah Abbott <miabbott@redhat.com>

Closes: #473
Approved by: jlebon
2016-07-13 18:35:29 +00:00
Giuseppe Scrivano
84d096d29e bash: add autocomplete for "atomic ps"
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #422
Approved by: rhatdan
2016-07-07 21:24:37 +00:00
Matthew Barnes
f556415b4b atomic: Add cluster and rhost subcommands
Interfaces with a Commissaire server.

https://github.com/projectatomic/commissaire

Closes: #354
Approved by: jlebon
2016-06-10 19:19:36 +00:00
Dan Walsh
be7283d595 Add missing information on atomic mount --shared option
Missing from command completion and from man pages.
2016-06-03 13:23:59 -04:00
Dan Walsh
f027f871ea Add atomic images --noheading
In certain cases like piping to grep, you do not want to include headings
2016-05-29 06:12:34 -04:00
Dan Walsh
403b51a5ca Add support for modifying /etc/sysconfig/docker-storage-setup
atomic modify can be used to add devices to the storage backend.
It can also be used to switch the backend storage driver.

Closes: #385
Approved by: rhatdan
2016-05-23 15:32:20 +00:00
Dan Walsh
640ad1bf41 Added atomic storage to handle resetting of storage
Also moved atomic migrate to atomic storage.

Currently we support
atomic storage export
atomic storage import
atomic storage reset

Closes: #365
Approved by: rhatdan
2016-05-11 10:51:14 +00:00
Brent Baude
e67bf52a2a Atomic/scan.py: Add --rootfs option
Add the ability for atomic scan to deal with chroots on the host's
filesystem.  You can now pass a list of chroots to --rootfs and your
scanner will process them as if they were containers or images.  This
works with VMs too.

$ sudo virt-filesystems -d rhel7
/dev/sda1
/dev/sdb1
/dev/sdb2
/dev/rhel/home
/dev/rhel/root
$ sudo guestmount  -d rhel7 -m /dev/rhel/root --ro /tmp/rhel
$ sudo ./atomic scan --rootfs /tmp/rhel
...

Updated the man pages for atomic scan as well as it had fallen out of
date.

Small update that makes sure the host's os.environ is passed into
scanning container.

Closes: #371
Approved by: rhatdan
2016-05-05 15:45:46 +00:00
Giuseppe Scrivano
edcba80371 bash: add autocomplete for new system containers commands
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2016-04-18 20:27:32 +02:00
Dan Walsh
ddc8dd68f0 Allow user to specify alternative docker executables.
This will allow us to support docker-latest
2016-04-13 08:53:19 -04:00
Colin Walters
1365590b9f host: Pass through unlock -> ostree admin unlock
It's nicer for branding the command.  The more correct thing would be
to add it to the rpm-ostree daemon and pass through there, but we have
more important problems to fix for the production code path.  This is
just for local development, so the slightly dirty way is just fine.
2016-04-04 11:25:03 -04:00
Brent Baude
c71664ef97 Atomic/run.py: Add security implications messages based on RUN label
Laymen users who are told to run a image may not understand
the docker run switches that have security implications.  We
now look for the following switches:

* --privileged
* --cap-add
* --security-opt label:disable
* --net=host
* --pid=host
* --ipc=host

and output an appropriate security message.

Also, moved def run() from Atomic/atomic.py to Atomic/run.py
to reduce the size and the number of definitions in
Atomic/atomic.py.
2016-01-18 09:29:37 -06:00
Brent Baude
70427a5159 Atomic/help.py: Display man-like help for an image
Images or containers can now have an associated
man-like help page to help users understand more
about the image.  Typical information included
are things like a longer description, if the image
needs to be installed, security implications, steps
to upgrade, etc.

The default behavior is for atomic to display
a file called help.1 (in man format) located in
the / of the docker object.  This default
can be overriden with the HELP LABEL.  The
HELP LABEL needs to be a fully qualified
command to work correctly.
2016-01-15 10:02:58 -06: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