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

152 Commits

Author SHA1 Message Date
Dan Walsh
fe026bd624 Fix atomic host man page
Closes: #746
Approved by: rhatdan
2016-11-05 11:06:16 +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
Aaron Weitekamp
a34814a25d Document supported push registry types
Closes: #699
Approved by: rhatdan
2016-10-12 16:20:12 +00:00
Dan Walsh
ac396a0e84 Add support for overlay2 driver
Closes: #700
Approved by: rhatdan
2016-10-12 12:54:11 +00: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
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
Aaron Weitekamp
c00a1972df add keyring override config
Closes: #643
Approved by: rhatdan
2016-09-26 14:31:13 +00:00
Dan Walsh
09f5ec7861 Fixup man pages
Closes: #664
Approved by: cgwalters
2016-09-24 22:22:32 +00:00
Aaron Weitekamp
653faf7c67 add TRUST_POLICY env var
Closes: #659
Approved by: rhatdan
2016-09-23 13:06:23 +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
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
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
0870507325 add atomic trust show
Closes: #629
Approved by: rhatdan
2016-09-20 08:48:20 +00:00
Brent Baude
18ec6d3b38 Change sigstore-write to sigstore-staging
The registries.d YAML files label for sigstore-write
has been changed to sigstore-staging for a more accurate
description.  Skopeo has made this change in its
85e4551eab00f9c3c973b309544329eb5558dfcd commit in
the integrate-all-the-things branch.

Closes: #622
Approved by: rhatdan
2016-09-16 11:35:32 +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
7c53602688 update trust based on review feedback
Closes: #604
Approved by: baude
2016-09-15 14:24:49 +00:00
Aaron Weitekamp
e63d672cd3 add trust man page
Closes: #604
Approved by: baude
2016-09-15 14:24:49 +00:00
Brent Baude
64917bc862 Atomic/sign.py: Raise error on writing signatures to http
Atomic cannot write a signature to web(http/https) target. We
now raise an error as such.

sudo ./atomic sign docker.io/library/hello-world

Writing to http://123 is not supported. Use a file:///location instead.

Closes: #618
Approved by: rhatdan
2016-09-15 08:27:18 +00:00
Brent Baude
887f20c501 Atomic/sign.py: Update man page and inject registry/repo/image for -d
When using -d to override the signature write location, we now want
to make sure we also add in the presribed directory structure
of registry/repo/image@sha256:manfist/. So, something like:

atomic --debug sign -d /tmp docker.io/library/busybox:latest

results in:

/tmp/docker.io/library/busybox@sha256:a59906e...a1e0e6/signature-1

Closes: #617
Approved by: baude
2016-09-14 18:29:15 +00:00
Dan Walsh
4f54dc6a3c Fix missing verb
Closes: #611
Approved by: rhatdan
2016-09-13 19:27:00 +00:00
Jan Pazdziora
41ce11aa1a For make command on Fedora 24 to pass, additional packages are needed.
Addressing:

# make all
/usr/bin/python setup.py build
Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    import Atomic as _Atomic
  File "/root/atomic/Atomic/__init__.py", line 1, in <module>
    from .pulp import PulpServer, PulpConfig
  File "/root/atomic/Atomic/pulp.py", line 8, in <module>
    import requests
ImportError: No module named requests
Makefile:34: recipe for target 'python-build' failed
make: *** [python-build] Error 1

# make all
/usr/bin/python setup.py build
Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    import Atomic as _Atomic
  File "/root/atomic/Atomic/__init__.py", line 1, in <module>
    from .pulp import PulpServer, PulpConfig
  File "/root/atomic/Atomic/pulp.py", line 10, in <module>
    from . import util
  File "/root/atomic/Atomic/util.py", line 10, in <module>
    import selinux
ImportError: No module named selinux
Makefile:34: recipe for target 'python-build' failed
make: *** [python-build] Error 1

# make all
/usr/bin/python setup.py build
Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    import Atomic as _Atomic
  File "/root/atomic/Atomic/__init__.py", line 1, in <module>
    from .pulp import PulpServer, PulpConfig
  File "/root/atomic/Atomic/pulp.py", line 10, in <module>
    from . import util
  File "/root/atomic/Atomic/util.py", line 11, in <module>
    from .client import AtomicDocker
  File "/root/atomic/Atomic/client.py", line 1, in <module>
    import docker
ImportError: No module named docker
Makefile:34: recipe for target 'python-build' failed
make: *** [python-build] Error 1

# make all
/usr/bin/python setup.py build
Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    import Atomic as _Atomic
  File "/root/atomic/Atomic/__init__.py", line 1, in <module>
    from .pulp import PulpServer, PulpConfig
  File "/root/atomic/Atomic/pulp.py", line 10, in <module>
    from . import util
  File "/root/atomic/Atomic/util.py", line 12, in <module>
    from yaml import load as yaml_load
ImportError: No module named yaml
Makefile:34: recipe for target 'python-build' failed
make: *** [python-build] Error 1

# make all
/usr/bin/python setup.py build
Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    import Atomic as _Atomic
  File "/root/atomic/Atomic/__init__.py", line 3, in <module>
    from .atomic import Atomic
  File "/root/atomic/Atomic/atomic.py", line 7, in <module>
    from .syscontainers import SystemContainers
  File "/root/atomic/Atomic/syscontainers.py", line 15, in <module>
    from dateutil.parser import parse as dateparse
ImportError: No module named dateutil.parser
Makefile:34: recipe for target 'python-build' failed

# make all
[...]
/usr/bin/go-md2man -in docs/atomic-storage.1.md -out docs/atomic-storage.1.tmp && touch docs/atomic-storage.1.tmp && mv docs/atomic-storage.1.tmp docs/atomic-storage.1
/usr/bin/python -m pylint --disable=all --enable=E --enable=W --additional-builtins=_ *.py atomic Atomic tests/unit/*.py -d=no-absolute-import,print-statement,no-absolute-import,bad-builtin
/usr/bin/python: No module named pylint
Makefile:38: recipe for target 'pylint-check' failed
make: *** [pylint-check] Error 1

# make all
/usr/bin/python setup.py build
running build
running build_py
running build_scripts
/usr/bin/python -m pylint --disable=all --enable=E --enable=W --additional-builtins=_ *.py atomic Atomic tests/unit/*.py -d=no-absolute-import,print-statement,no-absolute-import,bad-builtin
No config file found, using default configuration
************* Module atomic_client
E:  8, 0: Unable to import 'slip.dbus' (import-error)
************* Module atomic_dbus
E:  9, 0: Unable to import 'gi.repository' (import-error)
E: 10, 0: Unable to import 'slip.dbus.service' (import-error)
************* Module Atomic.mount
E: 35, 0: Unable to import 'gi.repository' (import-error)
************* Module Atomic.syscontainers
E: 21, 8: Unable to import 'gi.repository' (import-error)
[...]
Makefile:38: recipe for target 'pylint-check' failed
make: *** [pylint-check] Error 2

Closes: #608
Approved by: rhatdan
2016-09-13 12:08:39 +00:00
Jan Pazdziora
55c02a6949 For make test on Fedora 24 to even start the tests, additional steps are needed.
Addressing:

# make test
[...]
/usr/bin/python3 -m pylint --disable=all --enable=E --enable=W --additional-builtins=_ *.py atomic Atomic tests/unit/*.py -d=no-absolute-import,print-statement,no-absolute-import,bad-builtin
/usr/bin/python3: No module named pylint
Makefile:20: recipe for target 'test-python3-pylint' failed
make: *** [test-python3-pylint] Error 1

# make test
[...]
./test.sh
Pulling standard images from Docker Hub...
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Makefile:27: recipe for target 'test' failed
make: *** [test] Error 1

# make test
[...]
UNIT TESTS:
./test.sh: line 153: /usr/bin/coverage2: No such file or directory
[...]
Coverage report:
./test.sh: line 200: /usr/bin/coverage2: No such file or directory
Makefile:27: recipe for target 'test' failed
make: *** [test] Error 1

Closes: #609
Approved by: rhatdan
2016-09-13 11:51:49 +00:00
Dan Walsh
98524aa457 Merge branch 'master' of github.com:projectatomic/atomic 2016-09-12 16:34:15 -04:00
Brent Baude
d89b47d4f4 Atomic/sign.py|util.py Support sigstore from conf files
We now derive the proper sigstore from a series of YAML
configuration files in /etc/containers/registries.d.  These
configuration files can have: sigstore and sigstore-write as
keys and the values are a file path or http|s URL.

When signing an image, as long as the -d override is not used,
we use those values when writing local signatures.

Closes: #603
Approved by: rhatdan
2016-09-10 09:45:16 +00:00
Dan Walsh
7eb2af9c34 Remove --force option and use --assumeyes
atomic images delete --force

Should force the remove of images that are in use, not answer the prompt yes.

atomic -y|--assumeyes images delete foobar

Should force the answer to yes

Also lots of cleanups of the man page.
2016-09-09 08:54:25 -04:00
Alex Jia
3c7c74f42b docs: fix documents in atomic-images
Signed-off-by: Alex Jia <ajia@redhat.com>

Closes: #600
Approved by: rhatdan
2016-09-09 11:57:31 +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
Mahmoud Tohmaz
c66bf4e32c Atomic will mount/unmount a user image.
Ostree already has functionality to extract images as non-root user. This involves changing OSTree's checkout mode to USER (only if the image's repo was created with BARE_USER mode).
Atomic will then ignore calls to mount_path since there is no need to run the mount systemcall since ostree checkout already takes care of thata.

Also added changes to allow atomic to unmount an image previously mounted by non-root user. This involves a patch to atomic mount to change permissions of the image once mounted. It then removes symbolic links before removing all the subdirectories in the specified mount directory.

Closes: #509
Approved by: rhatdan
2016-09-06 20:38:35 +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
a6e953056b update man page
Signed-off-by: Alex Jia <ajia@redhat.com>

Closes: #573
Approved by: rhatdan
2016-09-06 12:31:08 +00:00
Alex Jia
314f9d5a3a docs/atomic-sign.1.md: fix lost command
Signed-off-by: Alex Jia <ajia@redhat.com>

Closes: #585
Approved by: rhatdan
2016-09-06 12:22:27 +00:00
Brent Baude
683c0fac9b Introduce signing
Allow atomic users to sign an images that has been pulled
from a repository.  This uses GPG, skopeo, and friends and
creates a local signature file for a image that has been
pulled locally.  Signatures are stored in the dir:

/var/lib/atomic/containers/registry/image_name@sha256:image_id/

Individual signature files are then stored as:

  ../signature-(INTEGER)

where INTEGER is incremented each time a signature
is added.

Closes: #539
Approved by: baude
2016-09-02 17:11:28 +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
Giuseppe Scrivano
d582ae4703 images: hide generate if gomtree is not available
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #567
Approved by: rhatdan
2016-08-29 18:46:29 +00:00
Giuseppe Scrivano
c8f83d99ed install: hide --system and --user if not supported
Check respectively that runc and bwrap-oci are available before showing
'install --system' and 'install --user'.

bwrap-oci is still not packaged and may not be available immediately on
RHEL.  The check for runc is added for completeness.

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

Closes: #567
Approved by: rhatdan
2016-08-29 18:46:29 +00:00
Dan Walsh
448654d68f Don't add host verb if not on atomic host
Check whether /run/ostree-booted file exists.  If it does then
add the host commands to the atomic command.

Also fix some of the descriptions in atomic man page.

Closes: #561
Approved by: cgwalters
2016-08-27 12:28:17 +00:00
Dan Walsh
1c0a36e416 Fix reference to containers/images in atomic mount help and man page
Closes: #563
Approved by: giuseppe
2016-08-26 22:01:14 +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
adaec5456d docs: add docs for verify --no-validate
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #536
Approved by: cgwalters
2016-08-19 14:14:24 +00:00
Jan Pazdziora
f97e97f172 Add support for LABEL RUN_OPTS_FILE and ${RUN_OPTS}
Closes: #541
Approved by: rhatdan
2016-08-19 13:02:26 +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
Stephen Chung
d4728ae10f verify: validate layers of system image stored on disk
Integrate go-mtree tool into atomic CLI command, `atomic verify -V <imagename>`.
(Note that `gomtree` is still in development and thus we would need some way of
obtaining updated gomtree binaries) When a user does an atomic pull,
validation manifests for that system image's layers are created and stored in
/var/lib/atomic. When user does `atomic verify -V <system image>`, these manifests
are then validated against the image that is on disk (which would be stored in ostree).

Signed-off-by: Stephen Chung <schung@redhat.com>

Closes: #531
Approved by: rhatdan
2016-08-12 18:55:44 +00:00
Giuseppe Scrivano
3bb5dbfe5a docs: document atomic 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
Marius Vollmer
b828b6fadf storage: Add --vgroup option to modify command
Closes: #519
Approved by: cgwalters
2016-08-05 17:18:07 +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