How to select Docker host to use with new Eclipse Liberty WDT tools - eclipse

With last version of Liberty WDT tools for Eclipse, a Liberty server running in a Docker can be configured as server. It works for me and detects the dockers running in a remote host, not locally. I wonder how Liberty has decided to use that specific docker host and how I can configure another one. I mean, the equivalent to the comand:
#eval $(docker-machine env MY_HOST)
I use in shell to select where my docker commands go to.
I see nowhere in preferences where I can set which set of "docker-machine env" will the tool use.
Thanks

The tools don't assume any particular Docker machine but should be listing containers running WebSphere Application Server Liberty on all machines with the machine name in brackets next to the container name. The tools will handle setting up the environment required for the container that is chosen. Containers must be started to show in the list.

Related

Jprofiler and WebSphere 8 Integration Issue

I'm having some issues getting JProfiler connected to a remote WebSphere 8.5.5 instance that is running on Linux. When I start JProfiler on my Windows 10 machine I select the "Profile an application server, locally or remotely" and select the option to integrate with IBM WebSphere 8.x Application Server.
The part I'm having an issue with is the "Specify the remote address" section of setting up the profile. The setup says I need the profiling agent running on target JVM. I download the tar file from the JProfiler website and extract it on Linux machine and run jpenable as it says I should but I get this message.
"No suitable Java Virtual Machine could be found on your system. The version of the JVM must be at least 1.6 and at most 11. Please define INSTALL4J_JAVA_HOME to point to a suitable JVM."
I have made edits to the arguments file that came with the JProfiler in order to remedy this issue but I just can't seem to get JProfiler to see the IBM Java that WebSphere is using on this machine. I have tried using the INSTALL_JAVA_HOME_OVERRIDE variable in the arguments file by putting the full path to the WebSphere Java install. I have tried using the INSTALL4J_JAVA_PREFIX variable and I have created a INSTALL4J_JAVA_HOME variable in the arguments file and put the full path to the WebSphere Java.
Any help would be appreciated greatly appreciated in getting me around this issue. I have verified that WebSphere is using Java version 1.8.0_171.
but I just can't seem to get JProfiler to see the IBM Java that WebSphere is using on this machine.
That's because IBM JVMs are not supported for attach mode.
The setup says I need the profiling agent running on target JVM.
Generally, this is achieved by adding an -agentpath VM parameter to the profiled VM. The remote address that you are asked for in the wizard will be added as an option to that parameter. The wizard will then modify the server config file and add the complete VM parameter, so you don't have to it manually.
More information is available at
https://www.ej-technologies.com/resources/jprofiler/help/doc/main/profiling.html

VSCode: Using dev container remotely without local installation of docker

Currently, I have:
a desktop with low system specs, Windows 7 Pro (without Admin Rights), without docker.
a Virtual Machine with Centos7, and docker installed.
On my desktop, I can either use:
my local installation of VSCode, and Remote - SSH to develop remotely on my VM. It works well, but I can't combine this with Remote - Containers.
X11Forwarding to develop directly with VSCode installed on this VM. I can use Remote - Containers, but X11 is very slow.
Is there a way, with local VSCode, to develop in a remote container, without local installation of docker (obviously with docker installed on the host)?
Is there a way, with local VSCode, to develop in a remote container,
without local installation of docker (obviously with docker installed
on the host)?
No. In the 'advanced containers' docs it says
You can use the Docker CLI locally with a remote Docker host by
setting local environment variables like DOCKER_HOST,
DOCKER_CERT_PATH, DOCKER_TLS_VERIFY. Since VS Code uses the Docker CLI
under the hood, you can use these same environment variables to
connect the Remote - Containers extension to the same remote host.
I added the bolding. Note that it is referring to the client not the remote there. This is from Developing inside a container on a remote Docker host.
Though not officially supported, it seems that it is possible to install Docker CLI without the daemon...
Is it possible to install only the docker cli and not the daemon
Maybe you can do this without admin?
That would, though, certainly be swimming against the grain. Probably your best bet is to stick with the 'remote - SSH' setup you've got going.
I just achieved this using the solution linked by #Tom (but with admin rights, I didn't test it without them)
I downloaded the docker-cli from the docker-cli-builder github repo and created the docker context successfully.
After selecting it in VSCode, it has started using the context allowing me to see the containers on the remote machine.
We have build a small tool called LiveSync which could solve your problem. You simply run
python3 -m pip install livesync
livesync <virtual-machine>
from inside your vscode workspace. It will start watching for changes and push them immediately to the remote. Hence you can code locally (even run your tests) and have all changes synced with your target system.

Docker microsoft/nanoserver won't start

I have a problem with Docker running the nanoserver.
My environment: I Installed docker on a Win10 (developer build from microsoft) Virtual Machine (cause host is still Win7 with no default Docker support because of Hyper-V). I installed docker on the virgin image so no 3rd-party programs can cause the error. I also have already checked if Hyper-V is enabled.
But I think this Screenshot says everything:
Also Googled the problem, but everything i found wasn't in a Docker context.
FYI: I want to use the Docker container for running a network rendering slave which should only see one cpu core (for licensing reasons), maybe someone has another option for this.
so you are trying to run Docker on Windows 10 which is a VM on Windows 7? I suppose this is not possible. You are trying to run a virtualization platform inside a virtualized Host (your Windows 10 machine). This nested virtualization is not supported by Windows 7 afaik.
Nested virtualization is supported on Windows 10 Build 10565 and later (this must be your virtualization host).
Have you tried to create and run a Hyper-V VM inside that Windows 10 VM? this will also fail.

Eclipse dev in host or guest os

Hi iam new to ambari/vagrant development , want to contribute towards the same . Iam using vagrant to set up my dev environment . Iam using cent os 6.4 as described here
https://cwiki.apache.org/confluence/display/AMBARI/Ambari+Development
But iam bit confused as in where will i intall my eclipse and compile the source code in host machine or in vm . If it is in vm , then how can i see the gui to do development . Since i modified the vagrant file to include the following line of code .
config.vm.provider :virtualbox do |vb|
vb.gui = true
vb.customize ["modifyvm", :id, "--memory", 3072] # RAM allocated to each VM
end
But when i reload the vm and enter the credentials as vagrant/vagrant , i only see the terminal . How can i see a proper gui of the VM ?
The VM that is produced by vagrant isn't intended to develop code on using Eclipse. It's used to test your code or to build from source. This is detailed in the quick start guide. Here are two excerpts from that document stating the same.
Using a vm to build Ambari from source:
Simply edit Vagrantfile to launch a VM with all the tools necessary to build Ambari from source.
The benefit of doing this would be that you could easily provision this VM and build ambari without a lot of overhead.
Using a vm to test Ambari:
This document shows how to quickly set up a cluster using Ambari on your local machine using virtual machines.
The benefit of doing this is you have an isolated environment in which you can test the software you're developing.
The vagrant files that Ambari provides use minimal installs of centos (ie. they dont have GUI software (X) pre-installed.). In order to launch eclipse on those vms you would need to install GUI software or use x-forwarding and ssh to open a view on your host OS. But that would be incredibly slow and not conducive to a good development environment.
If you want to develop using eclipse then you should install it on your host OS along with the other development tools that Ambari requires. There are instructions on how to do that in the link you posted in your original question.

Eclipse - Docker integration

I'm looking for a way to integrate Docker containers with the Eclipse platform.
I would like to run all build/test/debug command inside containers and use same containers in Continuous Integration build and later in production.
The simplest way I looked on, was just to configure custom command but besides permissions problem (docker must run as sudo/root) it doesn't give me all the flexibility of real integration.
Any ideas on the best way to proceed?
it is not a full answer to your question but we (JBoss Tools team) started working on this and here are a few blogs about what is possible todo today and where we are with Eclipse docker tooling.
http://tools.jboss.org/blog/2015-03-02-getting-started-with-docker-and-wildfly.html
http://tools.jboss.org/blog/2015-03-03-docker-and-wildfly-2.html
http://tools.jboss.org/blog/2015-03-30-Eclipse_Docker_Tooling.html
To do that, i think you work on a Linux platform :-)
What i do for a classic java project :
Build a Docker image that contains a jdk and maven for example
In Eclipse, via "Run Configurations", create a "build in Docker" configuration that launch a command like this :
docker run --rm -v <eclipse_workspace_dir>:/usr/src/myapp -w /usr/src/myapp myrepo/myimage mvn clean install
it should work.
For your continuous integration, you can use Docker Jenkins plugin to do the same or with a sh script.
There is Docker Tooling for Eclipse, available from this update site (you also need to add this update site as for now).
Try Eclipse-Che
https://eclipse.org/che/
You can install it as a Docker runs.
These links were very useful to me :
https://github.com/docker/labs/blob/master/developer-tools/java-debugging/Eclipse-README.md
https://github.com/docker/labs/blob/master/developer-tools/java/chapters/ch07-eclipse.adoc
https://docs.docker.com/samples/
It is all about Tutorial: Debugging Java Applications in Docker, Install Docker Tooling in Eclipse
You can also Watch a quick video explaining the key steps in https://www.youtube.com/watch?v=XmhEZiS26os
To configure remote debugging in Eclipse, click on Run > Debug Configurations...
Tomcat for instance supports remote debugging the Java Platform Debugger Architecture (JPDA). Make sure that the remote debugging was enabled when the tomcat image (registration-webserver) was built.