When we creating machine not from recipe, but from local image,
the image will be removed after machine is created. So if user
creates a machine from codenvy/ubuntu_jdk8 image, the image will be
removed.
In the step of creating a snapshot from machine I have added a special
prefix to image repository to mark this image as snapshot.
In the step of creating machine (recovering from snapshot) I have
added two checks:
do not pull if image is a local snapshot;
remove source image only if the image is a snapshot from registry.
Fix DockerConnector to avoid failing tests on some systems.
Use Future to prevent undefined order of thread execution.
Also change some exception message.
Also cleanup some tests.
Signed-off-by: Alexander Garagatyi <agaragatyi@codenvy.com>
Add possibility to configure api version by che.properties. Set minimum default docker api version 1.20.
Signed-off-by: Aleksandr Andrienko <aandrienko@codenvy.com>
Add networking API to docker client.
Change JSON serialization/deserialization in docker client to
fix incorrect naming policy work of JsonHelper.
Fix entrypoint field in ContainerConfig since it is array of
strings, not single string.
Signed-off-by: Alexander Garagatyi <agaragatyi@codenvy.com>
Read env variable CHE_API_ENDPOINT if property machine.docker.che_api.endpoint is not set
Set Che host IP to eth0 default IP when docker0 is not found on linux
Fixing typos
Signed-off-by: Mario Loriedo <mloriedo@redhat.com>
Parsing used to use reference definition from docker repo, but
fails in some very simple cases.
Rework parsing. Add comments. Add tests.
Signed-off-by: Alexander Garagatyi <agaragatyi@codenvy.com>
#1 new docker recipe type
currently we have type:"dockerfile", location: "http://path-to-recipe"
now we could provide
type:"dockerfile", content: "FROM codenvy/foo\nENV FLORENT=TRUE\"
and
type:"image", location or content: "codenvy/foo"
#2 InstanceKey
Up to now, InstanceKey was used to perform snapshot recovery.
But machine source is a way to provide this information.
So remove InstanceKey and replace it by MachineSource (and DockerMachineSource instead of DockerInstanceKey)
InstanceProvider:
void removeInstanceSnapshot(InstanceKey instanceKey)
--> void removeInstanceSnapshot(MachineSource machineSource)
Instance:
InstanceKey saveToSnapshot(String owner)
--> MachineSource saveToSnapshot(String owner)
#3 InstanceProvider model
To avoid also that MachineManager "knows" the inner type, the recipe handling is moved to the instance provider implementation
And as the snapshot handling is with MachineSource (included in MachineConfig included in Machine), no need to give extra InstanceKey parameter
Replace two previous methods
Instance createInstance(Recipe recipe,
Machine machine,
LineConsumer creationLogsOutput)
Instance createInstance(InstanceKey instanceKey,
Machine machine,
LineConsumer creationLogsOutput) throws NotFoundException, InvalidInstanceSnapshotException, MachineException;
by only one:
createInstance(Machine machine,
LineConsumer creationLogsOutput)
Change-Id: Ia7ea97bc1a44059b4892f5db387f54f2e1709fa3
Signed-off-by: Florent BENOIT <fbenoit@codenvy.com>
Fix clean up unused docker containers with container name which contains node host with '-'
Signed-off-by: Aleksandr Andrienko <aandrienko@codenvy.com>