Skip to content

Commit

Permalink
Merged recent changes from Che master + bumped up version (5.0.0-M8)
Browse files Browse the repository at this point in the history
Signed-off-by: Bartlomiej Laczkowski <[email protected]>
  • Loading branch information
Bartlomiej Laczkowski committed Nov 14, 2016
1 parent 744c6ac commit 5f94018
Show file tree
Hide file tree
Showing 622 changed files with 11,311 additions and 5,428 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ target/
bin/
test-output/
maven-eclipse.xml
instance/
config/

# Idea #
##################
Expand Down
261 changes: 139 additions & 122 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Chefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ workspace.commands[0].name="1. Build Che in Che"
workspace.commands[0].commandLine="mvn clean install -f /projects/che/assembly/assembly-main"

workspace.commands[1].name="2. Run Che in Che"
workspace.commands[1].commandLine='export CHE_VERSION="nightly" && export CHE_BIN_PATH=$(ls -d /projects/che/assembly/assembly-main/target/eclipse-che-*/eclipse-che-*); sudo docker run --rm -t -v /var/run/docker.sock:/var/run/docker.sock --env CHE_LOCAL_BINARY=${CHE_BIN_PATH/\'/projects/che\'/$(sudo docker inspect --format \'{{ range .Mounts }}{{ if eq .Destination "/projects/che" }}{{ .Source }}{{ end }}{{ end }}\' $(hostname))} --env CHE_PORT=54321 --env CHE_SERVER_CONTAINER_NAME="che-in-che-server" codenvy/che-launcher:nightly start'
workspace.commands[1].commandLine='export CHE_VERSION="nightly" && export CHE_BIN_PATH=$(ls -d /projects/che/assembly/assembly-main/target/eclipse-che-*/eclipse-che-*); sudo docker run --rm -t -v /var/run/docker.sock:/var/run/docker.sock --env CHE_ASSEMBY=${CHE_BIN_PATH/\'/projects/che\'/$(sudo docker inspect --format \'{{ range .Mounts }}{{ if eq .Destination "/projects/che" }}{{ .Source }}{{ end }}{{ end }}\' $(hostname))} --env CHE_PORT=54321 --env CHE_SERVER_CONTAINER_NAME="che-in-che-server" codenvy/che-launcher:nightly start'
workspace.commands[1].attributes={
"previewUrl": "http://localhost:54321"
}
Expand Down
2 changes: 1 addition & 1 deletion assembly/assembly-ide-war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>che-assembly-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.0.0-M7-SNAPSHOT</version>
<version>5.0.0-M8-SNAPSHOT</version>
</parent>
<artifactId>assembly-ide-war</artifactId>
<packaging>war</packaging>
Expand Down
2 changes: 1 addition & 1 deletion assembly/assembly-main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>che-assembly-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.0.0-M7-SNAPSHOT</version>
<version>5.0.0-M8-SNAPSHOT</version>
</parent>
<artifactId>assembly-main</artifactId>
<packaging>pom</packaging>
Expand Down
1 change: 0 additions & 1 deletion assembly/assembly-main/src/assembly/bin/che.sh
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ start_che_server () {
stop_che_server () {
echo -e "Stopping Che server running on localhost:${CHE_PORT}"
call_catalina >/dev/null 2>&1
return 1;
}

call_catalina () {
Expand Down
65 changes: 48 additions & 17 deletions assembly/assembly-main/src/assembly/bin/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ pid=0
check_docker() {
if [ ! -S /var/run/docker.sock ]; then
echo "Docker socket (/var/run/docker.sock) hasn't been mounted. Verify your \"docker run\" syntax."
return 1;
return 2;
fi

if ! docker ps > /dev/null 2>&1; then
output=$(docker ps)
error_exit "Error when running \"docker ps\": ${output}"
echo "Error when running \"docker ps\": ${output}"
return 2;
fi
}

Expand Down Expand Up @@ -51,9 +52,17 @@ init() {
export CHE_IN_CONTAINER="true"
export CHE_SKIP_JAVA_VERSION_CHECK="true"

if [ -f "/assembly/bin/che.sh" ]; then
echo "Found custom assembly..."
export CHE_HOME="/assembly"
else
echo "Using embedded assembly..."
export CHE_HOME="/home/user/che"
fi

### Are we using the included assembly or did user provide their own?
DEFAULT_CHE_HOME="/home/user/che"
export CHE_HOME=${CHE_ASSEMBLY:-${DEFAULT_CHE_HOME}}
# DEFAULT_CHE_HOME="/assembly"
# export CHE_HOME=${CHE_ASSEMBLY:-${DEFAULT_CHE_HOME}}

if [ ! -f $CHE_HOME/bin/che.sh ]; then
echo "!!!"
Expand All @@ -64,27 +73,36 @@ init() {
fi

### We need to discover the host mount provided by the user for `/data`
DEFAULT_CHE_DATA="/data"
export CHE_DATA=${CHE_DATA:-${DEFAULT_CHE_DATA}}
# DEFAULT_CHE_DATA="/data"
# export CHE_DATA=${CHE_DATA:-${DEFAULT_CHE_DATA}}
export CHE_DATA="/data"
CHE_DATA_HOST=$(get_che_data_from_host)

### Are we going to use the embedded che.properties or one provided by user?`
### CHE_LOCAL_CONF_DIR is internal Che variable that sets where to load
DEFAULT_CHE_CONF_DIR="${CHE_DATA}/conf"
export CHE_LOCAL_CONF_DIR=${CHE_LOCAL_CONF_DIR:-${DEFAULT_CHE_CONF_DIR}}
# DEFAULT_CHE_CONF_DIR="/conf"
# export CHE_LOCAL_CONF_DIR="${CHE_DATA}/conf"
# export CHE_LOCAL_CONF_DIR=${CHE_LOCAL_CONF_DIR:-${DEFAULT_CHE_CONF_DIR}}

if [ ! -f "${CHE_LOCAL_CONF_DIR}/che.properties" ]; then
echo "Did not discover che.properties file. Copying properties template to ${CHE_DATA_HOST}/conf."
if [ -f "/conf/che.properties" ]; then
echo "Found custom che.properties..."
export CHE_LOCAL_CONF_DIR="/conf"
else
echo "Using embedded che.properties... Copying template to ${CHE_DATA_HOST}/conf."
mkdir -p /data/conf
cp -rf "${CHE_HOME}/conf/che.properties" /data/conf/che.properties
export CHE_LOCAL_CONF_DIR="/data/conf"
fi

# Update the provided che.properties with the location of the /data mounts
sed -i "/che.workspace.storage/c\che.workspace.storage=${CHE_DATA_HOST}/workspaces" $CHE_LOCAL_CONF_DIR/che.properties
sed -i "/che.conf.storage/c\che.conf.storage=/data/storage" $CHE_LOCAL_CONF_DIR/che.properties
sed -i "/machine.server.ext.archive/c\machine.server.ext.archive=${CHE_DATA_HOST}/lib/ws-agent.tar.gz" $CHE_LOCAL_CONF_DIR/che.properties
sed -i "/machine.server.terminal.path_to_archive.linux_amd64/c\machine.server.terminal.path_to_archive.linux_amd64=${CHE_DATA_HOST}/lib/linux_amd64/terminal" $CHE_LOCAL_CONF_DIR/che.properties
sed -i "/machine.server.terminal.path_to_archive.linux_arm7/c\machine.server.terminal.path_to_archive.linux_arm7=${CHE_DATA_HOST}/lib/linux_arm7/terminal" $CHE_LOCAL_CONF_DIR/che.properties
sed -i "/che.workspace.storage=/c\che.workspace.storage=/data/workspaces" $CHE_LOCAL_CONF_DIR/che.properties
sed -i "/che.database=/c\che.database=/data/storage" $CHE_LOCAL_CONF_DIR/che.properties
sed -i "/che.template.storage=/c\che.template.storage=/data/templates" $CHE_LOCAL_CONF_DIR/che.properties
sed -i "/che.stacks.storage=/c\che.stacks.storage=/data/stacks/stacks.json" $CHE_LOCAL_CONF_DIR/che.properties
sed -i "/che.stacks.images=/c\che.stacks.images=/data/stacks/images" $CHE_LOCAL_CONF_DIR/che.properties
sed -i "/che.workspace.agent.dev=/c\che.workspace.agent.dev=${CHE_DATA_HOST}/lib/ws-agent.tar.gz" $CHE_LOCAL_CONF_DIR/che.properties
sed -i "/che.workspace.terminal_linux_amd64=/c\che.workspace.terminal_linux_amd64=${CHE_DATA_HOST}/lib/linux_amd64/terminal" $CHE_LOCAL_CONF_DIR/che.properties
sed -i "/che.workspace.terminal_linux_arm7=/c\che.workspace.terminal_linux_arm7=${CHE_DATA_HOST}/lib/linux_arm7/terminal" $CHE_LOCAL_CONF_DIR/che.properties

### If this container is inside of a VM like boot2docker, then additional internal mods required
DEFAULT_CHE_IN_VM=$(is_in_vm)
Expand All @@ -109,8 +127,20 @@ init() {

# Move files from /lib to /lib-copy. This puts files onto the host.
rm -rf ${CHE_DATA}/lib/*
mkdir -p ${CHE_DATA}/lib
cp -rf ${CHE_HOME}/lib/* ${CHE_DATA}/lib
mkdir -p ${CHE_DATA}/lib
cp -rf ${CHE_HOME}/lib/* "${CHE_DATA}"/lib

if [[ ! -f "${CHE_DATA}"/stacks/stacks.json ]];then
rm -rf "${CHE_DATA}"/stacks/*
mkdir -p "${CHE_DATA}"/stacks
cp -rf "${CHE_HOME}"/stacks/* "${CHE_DATA}"/stacks
fi

if [[ ! -f "${CHE_DATA}"/templates/samples.json ]];then
rm -rf "${CHE_DATA}"/templates/*
mkdir -p "${CHE_DATA}"/templates
cp -rf "${CHE_HOME}"/templates/* "${CHE_DATA}"/templates
fi

# A che property, which names the Docker network used for che + ws to communicate
export JAVA_OPTS="${JAVA_OPTS} -Dche.docker.network=bridge"
Expand Down Expand Up @@ -212,6 +242,7 @@ responsible_shutdown() {
echo ""
echo "Received SIGTERM"
"${CHE_HOME}"/bin/che.sh stop
exit;
}

# setup handlers
Expand Down
4 changes: 2 additions & 2 deletions assembly/assembly-main/src/assembly/stack/che-in-che.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@
"type": "custom"
},
{
"commandLine": "export CHE_BIN_PATH=$(ls -d /projects/che/assembly/assembly-main/target/eclipse-che-*/eclipse-che-*); sudo docker run -t -v /var/run/docker.sock:/var/run/docker.sock --env CHE_LOCAL_BINARY=${CHE_BIN_PATH//projects/'home/user/che/workspaces/che'} --env CHE_HOST_IP=$HOST_IP --env CHE_PORT=54321 codenvy/che-launcher start",
"commandLine": "export CHE_BIN_PATH=$(ls -d /projects/che/assembly/assembly-main/target/eclipse-che-*/eclipse-che-*); sudo docker run -t -v /var/run/docker.sock:/var/run/docker.sock --env CHE_ASSEMBLY=${CHE_BIN_PATH//projects/'home/user/che/workspaces/che'} --env CHE_HOST_IP=$HOST_IP --env CHE_PORT=54321 eclipse/che-launcher start",
"name": "3. Run Che in Che",
"type": "custom",
"attributes": {
"previewUrl": "http://<host.ip>:54321/"
}
},
{
"commandLine": "sudo docker run -t -v /var/run/docker.sock:/var/run/docker.sock codenvy/che-launcher stop",
"commandLine": "sudo docker run -t -v /var/run/docker.sock:/var/run/docker.sock eclipse/che-launcher stop",
"name": "4. Stop Che in Che",
"type": "custom"
},
Expand Down
4 changes: 4 additions & 0 deletions assembly/assembly-main/src/assembly/tomcat/conf/server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="false">


<!-- Provide Che Agent binaries (like workspace agent, terminal) -->
<Context docBase="${che.home}/lib" path="/agent-binaries" />

<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
Expand Down
2 changes: 1 addition & 1 deletion assembly/assembly-wsagent-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>che-assembly-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.0.0-M7-SNAPSHOT</version>
<version>5.0.0-M8-SNAPSHOT</version>
</parent>
<artifactId>assembly-wsagent-server</artifactId>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion assembly/assembly-wsagent-war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>che-assembly-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.0.0-M7-SNAPSHOT</version>
<version>5.0.0-M8-SNAPSHOT</version>
</parent>
<artifactId>assembly-wsagent-war</artifactId>
<packaging>war</packaging>
Expand Down
2 changes: 1 addition & 1 deletion assembly/assembly-wsmaster-war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>che-assembly-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.0.0-M7-SNAPSHOT</version>
<version>5.0.0-M8-SNAPSHOT</version>
</parent>
<artifactId>assembly-wsmaster-war</artifactId>
<packaging>war</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,21 @@
import com.google.inject.name.Names;
import com.google.inject.persist.jpa.JpaPersistModule;

import org.eclipse.che.account.api.AccountModule;
import org.eclipse.che.api.agent.server.launcher.AgentLauncher;
import org.eclipse.che.api.core.jdbc.jpa.eclipselink.EntityListenerInjectionManagerInitializer;
import org.eclipse.che.api.core.jdbc.jpa.guice.JpaInitializer;
import org.eclipse.che.api.core.rest.CheJsonProvider;
import org.eclipse.che.api.core.rest.MessageBodyAdapter;
import org.eclipse.che.api.core.rest.MessageBodyAdapterInterceptor;
import org.eclipse.che.account.api.AccountModule;
import org.eclipse.che.api.core.jdbc.jpa.eclipselink.EntityListenerInjectionManagerInitializer;
import org.eclipse.che.api.machine.server.jpa.MachineJpaModule;
import org.eclipse.che.api.machine.shared.Constants;
import org.eclipse.che.api.workspace.server.WorkspaceConfigMessageBodyAdapter;
import org.eclipse.che.api.workspace.server.WorkspaceMessageBodyAdapter;
import org.eclipse.che.api.ssh.server.jpa.SshJpaModule;
import org.eclipse.che.api.user.server.CheUserCreator;
import org.eclipse.che.api.user.server.TokenValidator;

import org.eclipse.che.api.user.server.jpa.UserJpaModule;
import org.eclipse.che.api.workspace.server.WorkspaceConfigMessageBodyAdapter;
import org.eclipse.che.api.workspace.server.WorkspaceMessageBodyAdapter;
import org.eclipse.che.api.workspace.server.jpa.WorkspaceJpaModule;
import org.eclipse.che.api.workspace.server.stack.StackMessageBodyAdapter;
import org.eclipse.che.inject.DynaModule;
Expand Down Expand Up @@ -105,7 +104,8 @@ protected void configure() {

bind(org.eclipse.che.api.workspace.server.event.MachineStateListener.class).asEagerSingleton();

bind(org.eclipse.che.api.agent.server.AgentRegistry.class).to(org.eclipse.che.api.agent.server.impl.LocalAgentRegistryImpl.class);
bind(org.eclipse.che.api.agent.server.AgentRegistry.class)
.to(org.eclipse.che.api.agent.server.impl.LocalAgentRegistryImpl.class);

Multibinder<AgentLauncher> agentLaunchers = Multibinder.newSetBinder(binder(), AgentLauncher.class);
agentLaunchers.addBinding().to(org.eclipse.che.api.workspace.server.launcher.WsAgentLauncherImpl.class);
Expand Down Expand Up @@ -143,5 +143,7 @@ protected void configure() {
bindInterceptor(subclassesOf(CheJsonProvider.class), names("readFrom"), interceptor);
bind(org.eclipse.che.api.workspace.server.WorkspaceFilesCleaner.class)
.to(org.eclipse.che.plugin.docker.machine.cleaner.LocalWorkspaceFilesCleaner.class);
bind(org.eclipse.che.api.environment.server.InfrastructureProvisioner.class)
.to(org.eclipse.che.plugin.docker.machine.local.LocalCheInfrastructureProvisioner.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,16 @@ che.docker.unused_containers_cleanup_min=60
# Version number of the Docker API used within the Che implementation
che.docker.api=1.20

che.docker.network_driver=NULL

che.docker.tcp_connection_timeout_ms=600000
che.docker.tcp_connection_read_timeout_ms=600000

# Docker registry example. Uncomment to add a registry configuration.
# You can configure multiple registries with different names.
#docker.registry.auth.<insert-name>.url=https://index.docker.io/v1/
#docker.registry.auth.<insert-name>.username=<username>
#docker.registry.auth.<insert-name>.password=<password>
#che.docker.registry.auth.<insert-name>.url=https://index.docker.io/v1/
#che.docker.registry.auth.<insert-name>.username=<username>
#che.docker.registry.auth.<insert-name>.password=<password>

# Allows to adjust machine swap memory by multiplying current machnine memory to provided value.
# default is -1 which is unlimited swap. If set, value is multipled by machine memory set by user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</context-param>
<context-param>
<param-name>org.eclipse.che.websocket.endpoint</param-name>
<param-value>/ws/{ws-id}</param-value>
<param-value>/ws</param-value>
</context-param>
<context-param>
<param-name>org.eclipse.che.eventbus.endpoint</param-name>
Expand Down
4 changes: 2 additions & 2 deletions assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
<parent>
<artifactId>che-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.0.0-M7-SNAPSHOT</version>
<version>5.0.0-M8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.eclipse.che</groupId>
<artifactId>che-assembly-parent</artifactId>
<version>5.0.0-M7-SNAPSHOT</version>
<version>5.0.0-M8-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Che IDE :: Parent</name>
<modules>
Expand Down
Loading

0 comments on commit 5f94018

Please sign in to comment.