A new backend is being added to the Atomic CLI called "Containers Storage". This commit
covers the addition of the backend itself. The backend is only made available in the
atomic CLI if an export variable called 'DEV' is found. For example:
sudo DEV=true atomic images list -a
Each method in the backend (with the exceptionof def available) raises an
UnderDevelopment Exception. As the methods are developed, the exceptions will be removed.
Closes: #1038
Approved by: rhatdan
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
To have parity function with pull, we need to add --storage
to install and run. This allows for overriding when atomic.type
is defined. For example, if you pull an image that has
atomic.type=system but you really want to store it
on the docker backend.
Closes: #861
Approved by: baude
If an image from a registry has a label like:
atomic.type=system
the Atomic CLI will now detect that prior to pulling
the image. It will then switch the backend storage
to ostree. In the case of install, it will both
pull to ostree and install it.
If the backend is switched, a message informing the user
as such will be shown.
The detection and switch of the backend can be overriden
with the --storage option.
The following is an example of install:
$ sudo atomic install atomic-registry.usersys.redhat.com:5000/brentbaude/helloworld:latest
Note: Switching from the 'docker' backend to the 'ostree' backend based on the 'atomic.type' label in the image. You can use --storage to override this behaviour.
Extracting to /var/lib/containers/atomic/helloworld.0
systemctl daemon-reload
systemctl enable helloworld
$ sudo ./atomic images list
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE TYPE
atomic-registry.usersys.redhat.com:5000/brentbaude/helloworld latest 0056366e4ebd 2017-02-01 18:04 ostree
$ sudo ./atomic containers list -a
CONTAINER ID IMAGE COMMAND CREATED STATE BACKEND RUNTIME
helloworld atomic-registry.user /usr/bin/run.sh 2017-02-01 18:04 failed ostree runc
Closes: #861
Approved by: baude
Ideally, the atomic CLI should be able to operate independently
of the backends it supports. For example, if dockerd is inactive,
the ostree backend and atomic cli should still work.
This requires some tweaking to the backendutils code and the work
flow. We also need to specifically know if the user passes
--storage so that we treat that as an explicit override. The work
flow is now roughly:
* a default storage can be defined in atomic.conf (was always this way)
* if not defined, defaults to docker.
* if --storage is passed, treat explictly and fail if cannot execute
* if no --storage is specified, use default. if default is not available, move
onto the next backend.
With the exception of fstrim, the containers verb has now been
refactored. It primarily now uses the containers object in its
implementation.
Closes: #792
Approved by: rhatdan
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
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
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