Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [che-dev] How to bootstrap a minimal Che IDE?

When /lib folder, you should have terminal folder in there, with different sub folders for various architecture types. Do you see them there? I mean Che tomcat/binaries.

On Fri, Apr 15, 2016 at 6:20 PM, Kaloyan Raev <kaloyan.r@xxxxxxxx> wrote:

The folder, which name is the id of the ssh machine, contains a single file with name 'machineId.logs'. This file is empty - 0 bytes.


I cannot find ~/che/terminal or anything similar.


Kaloyan



From: che-dev-bounces@xxxxxxxxxxx <che-dev-bounces@xxxxxxxxxxx> on behalf of Alexander Garagatyi <agaragatyi@xxxxxxxxxxx>
Sent: Friday, April 15, 2016 3:51 PM

To: che developer discussions
Subject: Re: [che-dev] How to bootstrap a minimal Che IDE?
 
Can you check if there are any logs of SSH your machine in this folder che/assembly/assembly-main/target/eclipse-che-4.2.0-RC1-SNAPSHOT/eclipse-che-4.2.0-RC1-SNAPSHOT/tomcat/logs/machine/logs

Also can you check if there is a folder ~/che/terminal and what content does it have.

Alexander Garagatyi | Software Engineer | agaragatyi@xxxxxxxxxxx


On Fri, Apr 15, 2016 at 2:57 PM, Kaloyan Raev <kaloyan.r@xxxxxxxx> wrote:

Hi Alexander,


I followed your instructions to create a workspace with a primary docker machine and a secondary ssh machine. I switched to the latest state of the master branch for building the assembly.


The first issue I faced was a validation message that only machines of type "docker" are allowed. I fixed this in the DefaultWorkspaceValidator. I pushed a pull request with the change: https://github.com/eclipse/che/pull/1055


Now, I can create the workspace and start it. Unfortunately, the ssh machine fails to connect its terminal. The error in the UI is: "Some error happened with terminal WebSocket connection"


The Che Server printed the following output:


2016-04-15 14:32:12,764[kspaceManager-2]  [INFO ] [o.e.c.a.m.s.MachineManager 162]      - Creating machine [ws = workspacerwrxf8s4h6mja14l: env = wksp-custom: machine = ws-machine]
2016-04-15 14:32:12,767[kspaceManager-2]  [ERROR] [o.e.c.a.m.s.u.RecipeDownloader 82]   - Removal of recipe file /home/kraev/git/che/assembly/assembly-main/target/eclipse-che-4.2.0-RC1-SNAPSHOT/eclipse-che-4.2.0-RC1-SNAPSHOT/tomcat/temp/recipe4818349294577732647.tmp failed.
2016-04-15 14:32:18,267[kspaceManager-2]  [WARN ] [o.e.c.p.d.c.DockerConnector 1187]    - Error response from docker API, status: 200, message: Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning.

2016-04-15 14:32:28,304[kspaceManager-2]  [INFO ] [o.e.c.a.m.s.MachineManager 168]      - Machine [ws = workspacerwrxf8s4h6mja14l: env = wksp-custom: machine = ws-machine] was successfully created, its id is 'machinesxa9dg853c9zro0g'
2016-04-15 14:32:28,304[kspaceManager-2]  [INFO ] [o.e.c.a.m.s.MachineManager 162]      - Creating machine [ws = workspacerwrxf8s4h6mja14l: env = wksp-custom: machine = ssh-machine]
2016-04-15 14:32:28,305[kspaceManager-2]  [ERROR] [o.e.c.a.m.s.u.RecipeDownloader 82]   - Removal of recipe file /home/kraev/git/che/assembly/assembly-main/target/eclipse-che-4.2.0-RC1-SNAPSHOT/eclipse-che-4.2.0-RC1-SNAPSHOT/tomcat/temp/recipe5185995697911503079.tmp failed.
2016-04-15 14:32:28,609[kspaceManager-2]  [INFO ] [o.e.c.a.m.s.MachineManager 168]      - Machine [ws = workspacerwrxf8s4h6mja14l: env = wksp-custom: machine = ssh-machine] was successfully created, its id is 'machinepnsbf5cjam3eo63x'
2016-04-15 14:32:28,610[kspaceManager-2]  [INFO ] [o.e.c.a.w.s.WorkspaceManager 523]    - Workspace 'che:custom-workspace' started by user 'che'

How can I troubleshoot this?


Thanks for your help!

Kaloyan



From: che-dev-bounces@xxxxxxxxxxx <che-dev-bounces@xxxxxxxxxxx> on behalf of Alexander Garagatyi <agaragatyi@xxxxxxxxxxx>
Sent: Friday, April 15, 2016 1:02 PM

To: che developer discussions
Subject: Re: [che-dev] How to bootstrap a minimal Che IDE?
 
Hi!

You can't use SSH machine as a primary machine. This functionality is not implemented yet. So you have to use docker for that.
This machine hosts CHE tooling for file editing, etc.

If possibility to execute commands in terminal right on AMI instance fits your needs you can use SSH machine for that. It will be secondary machine.
Che tooling won't be able to use PHP installed right in the AMI instance because it is in the container. But you will be able to access your files in console of SSH machine
and using API of CHE deployed in docker container.

To add secondary ssh machine to your workspace add next JSON to workspace JSON on workspace creation.
{
    "name": "my_ssh_machine",
    "type": "ssh",
    "source": {
        "type": "ssh-config"
    },
    "dev": false
}
So workspace JSON should looks like:
{
    "name" : ...,
    "defaultEnv" : "my_env",
    "environments" : [
        {
            "name" : "my_env",
            "machineConfigs" : [
                {
                         PRIMARY MACHINE JSON
                },
                {
                         SECONDARY SSH MACHINE
                }
            ]
        }
    ]
}

It looks like:
{
    "host": "127.0.0.1",
    "port": 22,
    "username": "root",
    "password": "root"
}

You just need to configure SSHD to allow connection with password. If you don't want to expose password protected SSHD you can configure it to allow password access only from localhost.

Best regards,
Alexander

Alexander Garagatyi | Software Engineer | agaragatyi@xxxxxxxxxxx


On Fri, Apr 15, 2016 at 12:28 PM, Kaloyan Raev <kaloyan.r@xxxxxxxx> wrote:

Hi again,


I was able to build an assembly without the Dashboard by removing the "che-dashboard-war" dependency from /assembly/assembly-main/pom.xml. This is a first good step in customizing Che. I need to also remove any reference from the menus to the (already missing) Dashboard, but we can leave this for later.


Having no dashboard, I was able to use the Che REST API to create a workspace with a machine of type "docker" and start it. Swagger makes this a really nice experience.


Now, I realize that the Docker machine type does not fit well my use case. The Docker container keeps the workspace runtime isolated from the host environment. I want to achieve exactly the opposite - to have the workspace runtime integrated as much as possible to the host environment. The user should be able to use from the Che Terminal view all the tools installed on the AMI. Ideally I will have the Project Explorer's root mounted to the Apache document root (/var/www/html). You know, PHP does not require any compilation and it is natural for PHP developers to work directly in the web server's document root.


Therefore, I think it is time to make my hands dirty and implement this new "localhost" machine type. Any advice where to start from would be much appreciated.

BTW, Tyler, regarding setting the workspace idle timeout to -1, where is this exactly configured?

Also, what is the purpose of this new SSH machine type? Can I somehow loop it to localhost, assuming I have a SSH server installed?

Thanks,
Kaloyan


From: che-dev-bounces@xxxxxxxxxxx <che-dev-bounces@xxxxxxxxxxx> on behalf of Kaloyan Raev <kaloyan.r@xxxxxxxx>
Sent: Thursday, April 14, 2016 6:03 PM
To: che developer discussions
Subject: Re: [che-dev] How to bootstrap a minimal Che IDE?
 

Hi Tyler,


Thank you for the detailed explanation!


I will try first using Docker. Having the Che image in a local repository would really avoid the long download process, so it may be enough for my use case.


I'll try to follow the given steps and will update you when I have any progress or issue.


Greetings,

Kaloyan




From: che-dev-bounces@xxxxxxxxxxx <che-dev-bounces@xxxxxxxxxxx> on behalf of Tyler Jewell <tyler@xxxxxxxxxxx>
Sent: Thursday, April 14, 2016 5:35 PM
To: che developer discussions
Subject: Re: [che-dev] How to bootstrap a minimal Che IDE?
 
Hi Kaloyan:

The use case that you are talking about is clear.

There are two ways to achieve what you are seeking - with and without docker.  In both cases, a Che workspace always requires a runtime. The workspace cannot start without its runtime, and you cannot open the IDE without it. So the only question is whether you are going to use a default runtime (Docker) or create a different kind of runtime (localhost). Che is shipping with an abstraction layer, called Machines, which can be extended to different types. Machines are used to provide runtimes to the workspace. We have the Docker machine as the default implementation. In 4.2, shipping in a couple weeks, we'll have an SSH machine as well.  We have not implemented a localhost machine, but it is possible to override our interfaces and to create custom machines of your own.

In all cases, regardless of the machine, you can programmatically create / destroy workspaces. Once you have the type of machine that you intend to use, you can launch the Che server and then use the Che APIs to generate (or load) a workspace. Once the workspace is loaded, you can then provide the user the IDE.  You could have the process that starts the che server & create the workspace run as part of a daemon, for example.

In the docker configuration, you need to have a docker daemon on your AMI along with the PHP image that would be used to power the Che machine.  Docker can instantiate containers quickly, so using Docker would generally not be the bottleneck in the loading.

So to do this, would:
1. Create a build of Che that removes any use of the dashboard.
2. Get a Che image on your AMI in your local registry.
3. Start the Che server in a daemon.
4. Call the Che APIs to create a workspace.
5. The workspace will start with the embedded terminal & ws-agent.
6. Then you have this workspace ready to present to the user on your own terms.

You'd want to set the workspace idle timeout to -1 or a very large number, as essentially the workspace itself is now running as a service.

Doing this without Docker would involve writing a new Machine interface. That is getting into code.  But even once you had this, it would be an optimization, as the workflow cited above would still be the sequence of steps to follow.

Tyler


Tyler Jewell | CEO | tyler@xxxxxxxxxxx | 978.884.5355


On Thu, Apr 14, 2016 at 7:04 AM, Kaloyan Raev <kaloyan.r@xxxxxxxx> wrote:

Hi,


I'd like to experiment with Che for the following use case.


We have an AWS AMI providing a professional PHP stack. It's an Ubuntu VM with Apache Web Server, Zend Server as the PHP stack, MySQL and other dev tools. I'd like to include the Che IDE in the same AMI and integrate it with the PHP runtime as tightly as possible to achieve better off-the-shelf experience.


I'd like to manually install the minimum required Che components in the existing AWS AMI. I need only a single workspace - the VM of the AMI itself. I don't need the Che dashboard and the ability to create new workspaces. Hence, I don't need the Docker management stuff.


Ideally, when I launch the AMI, I should have the Che IDE up-and-running very quickly.


What should I do to achieve the above?


Thanks,

Kaloyan


_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev



_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev



_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev



_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev




--

Eugene Ivantsov | Docs&Support |eivantsov@xxxxxxxxxxx



Back to the top