Skip to content

Commit

Permalink
Merge pull request eclipse-che#5 in CLD/slx.cloud-che from abhi.CHE6_…
Browse files Browse the repository at this point in the history
…migration to master

* commit '47fe46a34fa1df988ed61d46e5a478e0f67675b7': (156 commits)
  Fixed build errors
  eclipse-che#6331 disable key binding handle when any 'Window' opened (eclipse-che#8473)
  changed info about known issue (eclipse-che#8483)
  Avoid removal of non-test workspaces at the cleanup environment stage of selenium testing (eclipse-che#8481)
  Add changes in the methods of checking git-marker in the page object 'CodenvyEditor'
  updated the command
  Use nightly stack by default and -Pdev for development
  Changes pvc name to a prefix + 8 random characters
  init and cli images should not use tag from CHE (eclipse-che#8474)
  CHE-7581 Improved keycloak initialization (eclipse-che#8425)
  CHE-8240: Switch to project explorer tab for reavel resources action. (eclipse-che#8460)
  Selenium: Create selenium tests to cover the authorization on GitHub (eclipse-che#8395)
  apply formating for 'CreateNewPackagesWithHelpCreationJavaClassTest' selenium test (eclipse-che#8464)
  remove read 'preferences' in try/catch block (eclipse-che#8463)
  add project build to CheckAutocompleteFeaturesInTheTestFolderTest (eclipse-che#8457)
  Selenium: Add try/catch block for displaying "Known issue" with eclipse-che#8300 bug (eclipse-che#8454)
  add info about known issue to FileStructureNodesTest selenium test (eclipse-che#8452)
  Remove "source" field from stack object (eclipse-che#8407)
  Selenium: Fix unexpected fail of MacrosCommandsEditorTest selenium test (eclipse-che#8441)
  Fix formatting (eclipse-che#8447)
  ...
  • Loading branch information
Hanno Kolvenbach committed Jan 30, 2018
2 parents 7aaff22 + 47fe46a commit 66adb94
Show file tree
Hide file tree
Showing 8,490 changed files with 287,057 additions and 20,184 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,7 @@ docs/assets/imgs
##################
plugins/plugin-terminal-ui/node_modules/
plugins/plugin-terminal-ui/build/

# VSCode #
##########
.vscode
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,38 @@ If you are interested in fixing issues and contributing directly to the code bas

### License
Che is open sourced under the Eclipse Public License 1.0.



### For Silexica
sudo apt-get update && sudo apt-get install docker.io
sudo usermod -aG docker ${USER}
sudo reboot
# test if docker runs
docker run hello-world
sudo apt-get install maven
sudo apt-get install openjdk-8-jre icedtea-8-plugin
sudo apt-get install golang

#git clone https://github.com/Silexica/codenvy_slx.cloud_devel.git
#cd codenvy_slx.cloud_devel
# this takes around 10 minutes (with no output at the beginning)
mvn clean install



## To build
mvn clean install -Pdev

## To run and Stop
./run.sh --che6
./stop.sh --che6


## To debug IDE
mvn gwt:codeserver -pl :che-ide-gwt-app -am -Dskip-enforce -Dskip-validate-sources


## command to skip uncessary maven problems

mvn clean install -DskipTests=true -Dlicense.skip=true
2 changes: 1 addition & 1 deletion agents/bootstrapper/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012-2017 Red Hat, Inc.
Copyright (c) 2012-2018 Red Hat, Inc.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
Expand Down
2 changes: 1 addition & 1 deletion agents/bootstrapper/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
Copyright (c) 2012-2017 Red Hat, Inc.
Copyright (c) 2012-2018 Red Hat, Inc.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
Expand Down
50 changes: 50 additions & 0 deletions agents/exec/che-exec-agent-client/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012-2018 Red Hat, Inc.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Red Hat, Inc. - initial API and implementation
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>exec-agent-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>6.0.0-M5-SNAPSHOT</version>
</parent>
<artifactId>che-exec-agent-client</artifactId>
<packaging>jar</packaging>
<name>Agent :: Exec :: Client</name>
<dependencies>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-assistedinject</artifactId>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che</groupId>
<artifactId>che-exec-agent-shared</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-core</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-dto</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-workspace</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
/*
* Copyright (c) 2012-2018 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/
package org.eclipse.che.agent.exec.client;

import static org.eclipse.che.dto.server.DtoFactory.newDto;

import com.google.inject.assistedinject.Assisted;
import java.io.IOException;
import java.util.List;
import javax.inject.Inject;
import org.eclipse.che.agent.exec.shared.dto.GetProcessLogsResponseDto;
import org.eclipse.che.agent.exec.shared.dto.GetProcessResponseDto;
import org.eclipse.che.agent.exec.shared.dto.ProcessKillResponseDto;
import org.eclipse.che.agent.exec.shared.dto.ProcessStartRequestDto;
import org.eclipse.che.agent.exec.shared.dto.ProcessStartResponseDto;
import org.eclipse.che.api.core.ApiException;
import org.eclipse.che.api.core.ServerException;
import org.eclipse.che.api.core.rest.HttpJsonRequestFactory;
import org.eclipse.che.api.workspace.server.token.MachineTokenException;
import org.eclipse.che.api.workspace.server.token.MachineTokenProvider;

/**
* Helps to interact with exec agent via REST.
*
* @author Max Shaposhnik (mshaposh@redhat.com)
*/
public class ExecAgentClient {

private final HttpJsonRequestFactory requestFactory;
private final MachineTokenProvider machineTokenProvider;
private final String serverEndpoint;

@Inject
public ExecAgentClient(
HttpJsonRequestFactory requestFactory,
MachineTokenProvider machineTokenProvider,
@Assisted String serverEndpoint) {
this.requestFactory = requestFactory;
this.machineTokenProvider = machineTokenProvider;
this.serverEndpoint = serverEndpoint;
}

/**
* Starts a process within a given command.
*
* @param workspaceId workspace to run command
* @param command command to execute
* @param name command name
* @param type command type
* @return start process response DTO
* @throws ServerException when submit of the process is failed
*/
public ProcessStartResponseDto startProcess(
String workspaceId, String command, String name, String type) throws ServerException {
ProcessStartRequestDto commandDto =
newDto(ProcessStartRequestDto.class).withCommandLine(command).withName(name).withType(type);
try {
return requestFactory
.fromUrl(serverEndpoint)
.addQueryParam("token", machineTokenProvider.getToken(workspaceId))
.setAuthorizationHeader("none") // to prevent sending KC token
.usePostMethod()
.setBody(commandDto)
.request()
.asDto(ProcessStartResponseDto.class);
} catch (IOException | ApiException | MachineTokenException e) {
throw new ServerException(e);
}
}

/**
* Gets information about started process.
*
* @param workspaceId workspace to get process
* @param pid pid of started process
* @return process response DTO
* @throws ServerException when get of the process is failed
*/
public GetProcessResponseDto getProcess(String workspaceId, int pid) throws ServerException {
try {
return requestFactory
.fromUrl(serverEndpoint + "/" + pid)
.addQueryParam("token", machineTokenProvider.getToken(workspaceId))
.setAuthorizationHeader("none") // to prevent sending KC token
.useGetMethod()
.request()
.asDto(GetProcessResponseDto.class);
} catch (IOException | ApiException | MachineTokenException e) {
throw new ServerException(e);
}
}

/**
* Kills started process.
*
* @param workspaceId workspace kill process
* @param pid pid of started process
* @return kill process response DTO
* @throws ServerException when kill of the process is failed
*/
public ProcessKillResponseDto killProcess(String workspaceId, int pid) throws ServerException {
try {
return requestFactory
.fromUrl(serverEndpoint + "/" + pid)
.useDeleteMethod()
.addQueryParam("token", machineTokenProvider.getToken(workspaceId))
.setAuthorizationHeader("none") // to prevent sending KC token
.request()
.asDto(ProcessKillResponseDto.class);
} catch (IOException | ApiException | MachineTokenException e) {
throw new ServerException(e);
}
}

public List<GetProcessLogsResponseDto> getProcessLogs(String workspaceId, int pid)
throws ServerException {
try {
return requestFactory
.fromUrl(serverEndpoint + '/' + pid + '/' + "logs")
.addQueryParam("token", machineTokenProvider.getToken(workspaceId))
.setAuthorizationHeader("none") // to prevent sending KC token
.useGetMethod()
.request()
.asList(GetProcessLogsResponseDto.class);
} catch (IOException | ApiException | MachineTokenException e) {
throw new ServerException(e);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (c) 2012-2018 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/
package org.eclipse.che.agent.exec.client;

/**
* Creates instances of {@link ExecAgentClient} with given exec server endpoint.
*
* @author Max Shaposhnik (mshaposh@redhat.com)
*/
public interface ExecAgentClientFactory {

ExecAgentClient create(String serverEndpoint);
}
115 changes: 115 additions & 0 deletions agents/exec/che-exec-agent-shared/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012-2018 Red Hat, Inc.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Red Hat, Inc. - initial API and implementation
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>exec-agent-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>6.0.0-M5-SNAPSHOT</version>
</parent>
<artifactId>che-exec-agent-shared</artifactId>
<packaging>jar</packaging>
<name>Agent :: Exec :: Shared</name>
<properties>
<dto-generator-out-directory>${project.build.directory}/generated-sources/dto/</dto-generator-out-directory>
</properties>
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-dto</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-resource</id>
<phase>process-sources</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>${dto-generator-out-directory}/META-INF</directory>
<targetPath>META-INF</targetPath>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>add-source</id>
<phase>process-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${dto-generator-out-directory}</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>pre-compile</id>
<phase>generate-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-dto-maven-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<id>server</id>
<phase>process-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<dtoPackages>
<package>org.eclipse.che.agent.exec.shared.dto</package>
</dtoPackages>
<outputDirectory>${dto-generator-out-directory}</outputDirectory>
<genClassName>org.eclipse.che.agent.exec.shared.dto.server.DtoServerImpls</genClassName>
<impl>server</impl>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.eclipse.che</groupId>
<artifactId>che-exec-agent-shared</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit 66adb94

Please sign in to comment.