New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set variable CHE_DOCKER_MACHINE_HOST_EXTERNAL on Docker for Mac and Windows #11

Merged
merged 1 commit into from Sep 9, 2016

Conversation

Projects
None yet
4 participants
@l0rd
Copy link
Contributor

l0rd commented Sep 9, 2016

This change is to set variable CHE_DOCKER_MACHINE_HOST_EXTERNAL to localhost when running on Docker for Mac or Docker for windows.

It's related to PR eclipse/che#2402 and fixes eclipse/che#1644

Set variable CHE_DOCKER_MACHINE_HOST_EXTERNAL when on Docker for Mac …
…or Docker for Windows

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
@TylerJewell

This comment has been minimized.

Copy link
Contributor

TylerJewell commented Sep 9, 2016

lgtm +1

@TylerJewell TylerJewell self-assigned this Sep 9, 2016

@TylerJewell TylerJewell merged commit f082eff into eclipse:master Sep 9, 2016

1 check passed

ip-validation
Details
@darrinsimmons

This comment has been minimized.

Copy link

darrinsimmons commented Nov 16, 2016

Great job at CheConf16 today! Unfortunately, I still don't have Che fully working yet on my Mac.

I am trying to run Che on my Mac. I can install Che, create workspaces, and connect to them all fine from my Mac. When I then go to my PC, I can connect to Che, but am unable to connect to my workspaces. I have used this command line to install Che:

docker run --rm -t -v /var/run/docker.sock:/var/run/docker.sock -e CHE_IP=192.168.128.19 -e CHE_HOST_IP=192.168.128.19 -e CHE_DOCKER_MACHINE_HOST_EXTERNAL=192.168.129.19 eclipse/che:5.0.0-latest start

When I look at the network connections in Chrome on my PC, it is showing attempted connections to localhost instead of 192.168.128.19 when I try and open a workspace. Would the change above account for this? Is Che supposed to work on the Mac for remote connections?

Here is what I have installed on my Mac:
Darrins-MacBook-Pro:dhs-cloud dsimmons$ docker version
Client:
Version: 1.12.3
API version: 1.24
Go version: go1.6.3
Git commit: 6b644ec
Built: Wed Oct 26 23:26:11 2016
OS/Arch: darwin/amd64

Server:
Version: 1.12.3
API version: 1.24
Go version: go1.6.3
Git commit: 6b644ec
Built: Wed Oct 26 23:26:11 2016
OS/Arch: linux/amd64

To reproduce:

  1. Install Docker for Mac
  2. Run che-server command as above
  3. From separate machine, connect to 192.168.128.19:8080
  4. Create workspace.
  5. Attempt to connect to workspace.
@l0rd

This comment has been minimized.

Copy link
Contributor

l0rd commented Nov 16, 2016

Hey @darrinsimmons have you tried using Che CLI?

@darrinsimmons

This comment has been minimized.

Copy link

darrinsimmons commented Nov 16, 2016

@l0rd, I have not. I am very much a newbie and therefore I am trying to follow the directions below and not stray too far from that recommended path:

https://eclipse-che.readme.io/docs/usage-docker

That says that the docker launcher is the preferred method of running Eclipse Che. As you can see from the above, I've tried to pass in every environment variable that I can to make Eclipse Che on Mac work from remote machines. I even followed the recommendation from CheConf16 yesterday and added an alias to my lo0 (Which I would prefer to remove as it did not seem to help):

Darrins-MacBook-Pro:dhs-cloud dsimmons$ ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 192.168.65.2 netmask 0xffffff00
nd6 options=201<PERFORMNUD,DAD>

For now, I have gotten Eclipse Che working on a different CentOS box, including remote access to that box, so I can move forward.

Is Eclipse Che supposed to work using the docker launcher with remote access enabled, or is that a use case that is not supported yet? I've tried just about every combination within the context of using the docker launcher to no avail. If it is supposed to work, can I provide any additional info to help sort it out, or should I move this discussion into an issue elsewhere?

I love the work that the team is doing to make Che a dead-simple install and am happy to help in any way I can, if even by just being a "dumb user".

@benoitf

This comment has been minimized.

Copy link
Member

benoitf commented Nov 16, 2016

@darrinsimmons
what happen if you do

$ git clone https://github.com/eclipse/che
$ cd che
$ ./che.sh start

?

also I suggest to file a new issue as this pull request is not related to your problem

@darrinsimmons

This comment has been minimized.

Copy link

darrinsimmons commented Nov 16, 2016

@benoitf, same result. (Great session at CheConf16 yesterday!)

I can access Che, start workspaces, and access workspaces from my Mac. I can access Che and start workspaces from PC, but I cannot access workspaces from my PC. In Chrome on my PC, it shows Che trying to access localhost for the wsagents.

Below is my following the suggestion above along with a docker inspect of che-server. Remember, I still have the lo0 alias to 192.168.65.2. (Don't know if my PC will connect without it or not.) I like the idea of starting Che from a docker instance, so I believe I can just delete the ./che directory on my Mac. Interestingly, When I ran Che directly on my Mac, it found the dockerized Che workspace I had created previously. I've not found where the workspaces are kept on the host machine yet, although I've not looked very hard.

Darrins-MacBook-Pro:dhs-cloud dsimmons$ docker stop che-server
che-server
Darrins-MacBook-Pro:dhs-cloud dsimmons$ docker rm che-server
che-server
Darrins-MacBook-Pro:dhs-cloud dsimmons$ pwd
/Users/dsimmons/Documents/dhs-cloud
Darrins-MacBook-Pro:dhs-cloud dsimmons$ ls
autismpathfinder github gitlib learning report.tar scripts
Darrins-MacBook-Pro:dhs-cloud dsimmons$ git clone https://github.com/eclipse/che
Cloning into 'che'...
remote: Counting objects: 117448, done.
remote: Compressing objects: 100% (2672/2672), done.
remote: Total 117448 (delta 1248), reused 4 (delta 4), pack-reused 113814
Receiving objects: 100% (117448/117448), 34.67 MiB | 4.45 MiB/s, done.
Resolving deltas: 100% (43803/43803), done.
Checking connectivity... done.
Checking out files: 100% (8743/8743), done.
Darrins-MacBook-Pro:dhs-cloud dsimmons$ pwd
/Users/dsimmons/Documents/dhs-cloud
Darrins-MacBook-Pro:dhs-cloud dsimmons$ cd che
Darrins-MacBook-Pro:che dsimmons$ ls
CHANGELOG.md Chefile NUMBERING.md che.bat dashboard samples
CODE_OF_CONDUCT.md Dockerfile README.md che.sh ide wsagent
CONTRIBUTING.md Dockerfile.centos Vagrantfile cli.sh plugins wsmaster
CUSTOMIZING.md LICENSE assembly core pom.xml
Darrins-MacBook-Pro:che dsimmons$ ./che.sh start
INFO: Pulling image curl:latest
INFO: Downloading cli-latest
WARNING: No kernel memory limit support
INFO: (che update): Pulling image eclipse/che-launcher:nightly
nightly: Pulling from eclipse/che-launcher
3690ec4760f9: Already exists
48187e2d8244: Already exists
349f1dce913e: Already exists
0a3cb3a429a2: Pull complete
990dfd0844f1: Pull complete
35ae041e8c01: Pull complete
Digest: sha256:7a2df5d3b5e265dc738d9b89282bd09ae3c66dc8a886c7bd2aee5d76a62d4e6e
Status: Downloaded newer image for eclipse/che-launcher:nightly

INFO: ECLIPSE CHE: Found image eclipse/che-server:5.0.0-latest
INFO: ECLIPSE CHE: Starting container...
INFO: ECLIPSE CHE: Server logs at "docker logs -f che-server"
INFO: ECLIPSE CHE: Server booting...
INFO: ECLIPSE CHE: Booted and reachable
INFO: ECLIPSE CHE: Ver: 5.0.0-M7
INFO: ECLIPSE CHE: Use: http://localhost:8080
INFO: ECLIPSE CHE: API: http://localhost:8080/swagger
Darrins-MacBook-Pro:che dsimmons$
Darrins-MacBook-Pro:che dsimmons$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
388e2e61f631 eclipse-che/workspace8xgr1k2j0mz29znc_machinetczpfdrfkxjdkzn4_che_dev-machine "/bin/sh -c 'tail -f " 7 minutes ago Up 7 minutes 0.0.0.0:33212->22/tcp, 0.0.0.0:33211->3000/tcp, 0.0.0.0:33210->4401/tcp, 0.0.0.0:33209->4403/tcp, 0.0.0.0:33208->4411/tcp, 0.0.0.0:33207->5000/tcp, 0.0.0.0:33206->9000/tcp workspace8xgr1k2j0mz29znc_machinetczpfdrfkxjdkzn4_che_dev-machine
aa8fee229380 eclipse/che-server:5.0.0-latest "/home/user/che/bin/d" 8 minutes ago Up 8 minutes 8000/tcp, 0.0.0.0:8080->8080/tcp che-server
00539d7721f2 ubuntu "bash" 2 weeks ago Up 43 hours stoic_elion
Darrins-MacBook-Pro:che dsimmons$ docker inspect che-server
[
{
"Id": "aa8fee229380a85c6fc9be37ab2a592316bcb496529a4c54698121049f80d03b",
"Created": "2016-11-16T20:00:40.51389237Z",
"Path": "/home/user/che/bin/docker.sh",
"Args": [],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 7809,
"ExitCode": 0,
"Error": "",
"StartedAt": "2016-11-16T20:00:41.119725864Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:6f30b0caa905da39b54f4d5ba6abecdeb16c2b70604ec2eed0a0851ced978970",
"ResolvConfPath": "/var/lib/docker/containers/aa8fee229380a85c6fc9be37ab2a592316bcb496529a4c54698121049f80d03b/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/aa8fee229380a85c6fc9be37ab2a592316bcb496529a4c54698121049f80d03b/hostname",
"HostsPath": "/var/lib/docker/containers/aa8fee229380a85c6fc9be37ab2a592316bcb496529a4c54698121049f80d03b/hosts",
"LogPath": "/var/lib/docker/containers/aa8fee229380a85c6fc9be37ab2a592316bcb496529a4c54698121049f80d03b/aa8fee229380a85c6fc9be37ab2a592316bcb496529a4c54698121049f80d03b-json.log",
"Name": "/che-server",
"RestartCount": 0,
"Driver": "aufs",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": [
"/var/run/docker.sock:/var/run/docker.sock:Z",
"/home/user/che:/data:Z"
],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "bridge",
"PortBindings": {
"8080/tcp": [
{
"HostIp": "",
"HostPort": "8080"
}
]
},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": [],
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": -1,
"OomKillDisable": false,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0
},
"GraphDriver": {
"Name": "aufs",
"Data": null
},
"Mounts": [
{
"Source": "/var/run/docker.sock",
"Destination": "/var/run/docker.sock",
"Mode": "Z",
"RW": true,
"Propagation": "rprivate"
},
{
"Source": "/home/user/che",
"Destination": "/data",
"Mode": "Z",
"RW": true,
"Propagation": "rprivate"
}
],
"Config": {
"Hostname": "aa8fee229380",
"Domainname": "",
"User": "root",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"8000/tcp": {},
"8080/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"CHE_PRODUCT_NAME=ECLIPSE CHE",
"CHE_MINI_PRODUCT_NAME=che",
"CHE_UTILITY_VERSION=nightly",
"CHE_VERSION=5.0.0-latest",
"CHE_CLI_DEBUG=false",
"CHE_DATA=/home/user/che",
"CHE_SERVER_IMAGE_NAME=eclipse/che-server",
"CHE_CLI_INFO=true",
"CHE_SERVER_CONTAINER_NAME=che-server",
"no_proxy=*.local, 169.254/16",
"CHE_LOG_LEVEL=info",
"CHE_IP=192.168.65.2",
"CHE_IN_VM=true",
"CHE_DOCKER_MACHINE_HOST_EXTERNAL=localhost",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/bin",
"LANG=C.UTF-8",
"JAVA_HOME=/usr/lib/jvm/default-jvm/jre",
"DOCKER_VERSION=1.6.0",
"DOCKER_BUCKET=get.docker.com",
"CHE_IN_CONTAINER=true"
],
"Cmd": null,
"Image": "eclipse/che-server:5.0.0-latest",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": [
"/home/user/che/bin/docker.sh"
],
"OnBuild": null,
"Labels": {}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "97a3c83aa6bc90caa3163ed695b466f1fa59c07f0f4f3f41623be8a1c0b37357",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"8000/tcp": null,
"8080/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "8080"
}
]
},
"SandboxKey": "/var/run/docker/netns/97a3c83aa6bc",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "4db171a2d480d5babb927916a2e8d4e9eb1b888c643e79904de0ff83668cb0d1",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:03",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "276937345dd820da004c489eae64113baef3990f9243622d83ad1d3c3cf093bf",
"EndpointID": "4db171a2d480d5babb927916a2e8d4e9eb1b888c643e79904de0ff83668cb0d1",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:03"
}
}
}
}
]
Darrins-MacBook-Pro:che dsimmons$

@TylerJewell

This comment has been minimized.

Copy link
Contributor

TylerJewell commented Nov 16, 2016

@darrinsimmons - Yeah, given the direction you are taking this issue, it would be helpful to open a new ticket, and document all of the steps that you are following to create the connectivity problem between Mac and Windows. I don't think this pull request is related to this particular problem.

@darrinsimmons

This comment has been minimized.

Copy link

darrinsimmons commented Nov 16, 2016

@TylerJewell, thanks.

I have created the following issue:
eclipse/che#3092

Thanks for looking into this. Like yourself, I'm returning to coding (I hope) after a very long sabbatical. Your value proposition of Eclipse Che and Codenvy very much resonated with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment