* Set CHE_WORKSPACE_ID and CHE_MACHINE_NAME in all machines started through CHE
it is required for single port /reverse proxy strategy
Change-Id: Ib2cb987e594929151de4c26b614b91d788d19869
Signed-off-by: Florent BENOIT <fbenoit@codenvy.com>
Prevents issue where it is possible to start workspace while
pod is terminating. When this occurs, Che creates a new pod but
workspace start fails. This pod must be removed manually before
that workspace can be launched again.
This is done by a) waiting for pod to terminate before returning
from removeContainer, and b) removing created deployment and
service when an exception occurs during createContainer.
Additionally, increases maximum wait time for retreiving
OpenShift image stream metadata
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Bug occurs when container is unavailable without stop of machine.
In that case we don't stop machine instance and not cleanup
resources.
Signed-off-by: Alexander Garagatyi
Adds commit() and removeImage() implementations to
OpenShiftConnector. This requires some refactoring of existing
methods (mostly refactoring repeated processes into their own
methods -- e.g. creating an ImageStreamTag and getting image
info from a tag).
Additionally, refactors inspectContainer() method to remove
a call to DockerConnector, instead obtaining the same information
from what's available through the OpenShift API. This fixes an
issue where the IP address of a workspace was unavailable from
the ContainerInfo returned by DockerConnector.
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Implement OpenShiftConnector pull, tag, and inspectImage through
ImageStreams. Makes changes to how containers are created.
Currently snapshots do not work, as commit and push methods are not
implemented. Additionally, pulling a stack from a private repository
is not supported.
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Adds class so that choice between DockerConnector and OpenShiftConnector
can be made via setting a property in che.properties. The provider is
injected instead of DockerConnector, and provides the appropriate
implementation through a get() method.
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Set internal machine address by CLI from CHE_IP.
Add and fix docs in che.env.
Change behavior of default machine server address evaluation
to be similar to the previous state.
Code cleanup.
Signed-off-by: Alexander Garagatyi <agaragatyi@codenvy.com>
Move agents volume addition into infrastructure provisioner.
Suppress some false positive warnings.
Add some javadocs.
Signed-off-by: Alexander Garagatyi <agaragatyi@codenvy.com>
The current license checking maven plugin does not allow
for multiple copyright owners on source files. This commit
adds files modified for ServerEvaluationStrategy to an excludes
list so that builds can continue normally.
This commit should be undone once issue #3281 is resolved.
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Replaces DockerInstanceRuntimeInfo#getServers() to use
ServerEvaluationStrategy. Deletes LocalDockerInstanceRuntimeInfo
class as it is no longer needed. Adds MapBinder of
ServerEvaluationStrategy to LocalDockerModule.
Updates DockerInstanceRuntimeInfo tests to be more
readable and removes now unnecessary tests.
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Adds abstract class ServerEvaluationStrategy which can be used to
change how Che Server communicates with workspace containers.
ServerEvaluationStrategy is meant to be extended to modify the behavior
of DockerInstanceRuntimeInfo#getServers().
Two implementations of ServerEvaluationStrategy are included:
DefaultServerEvaluationStrategy (which is identical to normal
getServers() functionality) and LocalDockerServerEvaluationStrategy,
which uses internal container addresses for workspace containers
and can help in cases where firewall is an issue.
Strategies are provided by ServerEvaluationStrategyProvider, which
uses the new property che.docker.server_evaluation_strategy to choose
which implementation is provided.
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
* Avoid passing empty array for command and entrypoint to Docker API
* Use official mysql docker image in the java-mysql stack
Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
Refactors workspace bootstrapping code:
Addition of projects volumes to ws-machines and
applying of agents moved to infrastructure provisioner.
It can be overwritten in any implementation of Che and
will be responsible for providing all infrastructure needed for Che implementation functioning.
Allow to configure environment network driver.
Allow to add Agents from the code instead of special files.
These agents can override agents configured in files if identifiers are equal.
Adds possibility to host agents binaries from CHE master.
Reworks agents in a way when they can be downloaded from CHE master if they are not found on FS.
Adds workspace ID to internal representation of environment to allow to use it for internal purposes of machine bootstrapping.
Renames some properties.
Refactors AgentConfigApplier to encapsulate additional code that was used with this class before.
Signed-off-by: Alexander Garagatyi <agaragatyi@codenvy.com>
Allow to override /bin/sh by a "shell" attribute in commands
Change-Id: I19b95868c44f473552a153e29d1ba41abcc19aef
Signed-off-by: Florent BENOIT <fbenoit@codenvy.com>