[jbosstools-issues] [JBoss JIRA] (JBDS-4777) Please document procedure (if possible) for defining Debug port, Deployment path

André Dietisheim (Jira) issues at jboss.org
Fri Jun 14 17:27:01 EDT 2019


    [ https://issues.jboss.org/browse/JBDS-4777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13747480#comment-13747480 ] 

André Dietisheim edited comment on JBDS-4777 at 6/14/19 5:26 PM:
-----------------------------------------------------------------

Unfortunately the above is only 1 half of the story and at some point things started to work properly (with some timeout glitches at times) out of the box all the time.

Here's what I do:

# EXEC: build the [^Dockerfile] that's attached to this issue via:
{code}
docker build -t openshift-tomcat:5
{code}
# EXEC: tag and push it to hub.docker.com (pushing to minishift or employee.redhat.com doesnt work for me for different reasons)
{code}
docker tag openshift-tomcat:5 adietish/openshift-tomcat:5
docker push adietish/openshift-tomcat:5
{code}
# EXEC: in Eclipse/"Docker Explorer": select the docker image "adietish/openshift-tomcat" & pick "Deploy to OpenShift" in the ctx menu
 !screenshot-1.png|thumbnail! 
# EXEC: in the upcoming connection dialog i provide employee.redhat.com as a server and hit the "retrieve" link so that I get an OAuth token
!screenshot-2.png|thumbnail!  
# EXEC: in the next page I hit "New" and create a new project on the server and pick my docker image "adietish/openshift-tomcat:5" & hit "Finish"
 !screenshot-3.png|thumbnail!
# ASSERT: I then get reported that 4 resources and among them the image stream were created.
 !screenshot-4.png|thumbnail! 
It is especially important that the image stream is created. If it isn't the upcoming steps will fail. Ex. the pod would not be running, get terminated in a "crash back up loop" state. The image stream is also needed to retrieve the docker image labels with the deploy directory, the debug env var and debug port.
# ASSERT: In the OpenShift Explorer I now see my new project, a service and a pod running it:
 !screenshot-5.png|thumbnail! 
(if ex. OpenShift wasn't able to retrieve my docker image or the docker image didnt include a running tomcat, the pod wasnt running, was in "Crash loop back off"
# EXEC: in "OpenShift Explorer", select the project and open the "Properties" view and the "Image Streams" within it. You should find the image stream for the docker image
 !screenshot-6.png|thumbnail! 
# EXEC: git clone the tomcat sample app from github:
{code}
git clone git at github.com:OpenShiftDemos/os-sample-java-web.git
{code}
# EXEC: in "Project Explorer", pick "Import" > "Import" > "Existing Maven Projects" and point it to the clone.
# ASSERT: demo app shows up as maven project in "Project Explorer"
 !screenshot-7.png|thumbnail! 
# EXEC: in "OpenShift Explorer": Select the service and pick "Server Adapter" in the context menu. Make sure that
** the Demo app is selected as "Eclipse Project Source"
** the service in OpenShift is selected as "OpenShift Application Destination"
** all checkboxes for the "Pod Deployment Path", "Enable debugging", "Debugging Port" are checked so that the values in the docker image (aka image stream) are used
 !screenshot-8.png|thumbnail! 
And hit "Finish"
# ASSERT: server adapter appears in the "Servers" view and is launched.
# ASSERT: in the "Progress" view you see the server adapter starting up. It is waiting for the image stream to be available.  
!screenshot-9.png|thumbnail! 
OpenShift creates the image stream by importing the docker image. This can take some time if it's the first time that you're using the image in OpenShift. It should be quick once this initial import is successful. It also happens to me that this initial start of the server adapter errors with a message that it took more than 450 secs and thus timed out. I then stop the server adapter and start it again.
# ASSERT: once the initial start is successful, the server adapter is successfully started, the "Console" view is shown and displays what files were copied over from the local project to the (deployment directory of the) pod.
!screenshot-10.png|thumbnail! 


was (Author: adietish):
Unfortunately the above is only 1 half of the story and at some point things started to work properly (with some timeout glitches at times) out of the box all the time.
Here's what I do:

# EXEC: build the [^Dockerfile] that's attached to this issue via:
{code}
docker build -t openshift-tomcat:5
{code}
# EXEC: tag and push it to hub.docker.com (pushing to minishift or employee.redhat.com doesnt work for me for different reasons)
{code}
docker tag openshift-tomcat:5 adietish/openshift-tomcat:5
docker push adietish/openshift-tomcat:5
{code}
# EXEC: in Eclipse/"Docker Explorer": select the docker image "adietish/openshift-tomcat" & pick "Deploy to OpenShift" in the ctx menu
 !screenshot-1.png|thumbnail! 
# EXEC: in the upcoming connection dialog i provide employee.redhat.com as a server and hit the "retrieve" link so that I get an OAuth token
!screenshot-2.png|thumbnail!  
# EXEC: in the next page I hit "New" and create a new project on the server and pick my docker image "adietish/openshift-tomcat:5" & hit "Finish"
 !screenshot-3.png|thumbnail!
# ASSERT: I then get reported that 4 resources and among them the image stream were created.
 !screenshot-4.png|thumbnail! 
It is especially important that the image stream is created. If it isn't the upcoming steps will fail. Ex. the pod would not be running, get terminated in a "crash back up loop" state. The image stream is also needed to retrieve the docker image labels with the deploy directory, the debug env var and debug port.
# ASSERT: In the OpenShift Explorer I now see my new project, a service and a pod running it:
 !screenshot-5.png|thumbnail! 
(if ex. OpenShift wasn't able to retrieve my docker image or the docker image didnt include a running tomcat, the pod wasnt running, was in "Crash loop back off"
# EXEC: in "OpenShift Explorer", select the project and open the "Properties" view and the "Image Streams" within it. You should find the image stream for the docker image
 !screenshot-6.png|thumbnail! 
# EXEC: git clone the tomcat sample app from github:
{code}
git clone git at github.com:OpenShiftDemos/os-sample-java-web.git
{code}
# EXEC: in "Project Explorer", pick "Import" > "Import" > "Existing Maven Projects" and point it to the clone.
# ASSERT: demo app shows up as maven project in "Project Explorer"
 !screenshot-7.png|thumbnail! 
# EXEC: in "OpenShift Explorer": Select the service and pick "Server Adapter" in the context menu. Make sure that
** the Demo app is selected as "Eclipse Project Source"
** the service in OpenShift is selected as "OpenShift Application Destination"
** all checkboxes for the "Pod Deployment Path", "Enable debugging", "Debugging Port" are checked so that the values in the docker image (aka image stream) are used
 !screenshot-8.png|thumbnail! 
And hit "Finish"
# ASSERT: server adapter appears in the "Servers" view and is launched.
# ASSERT: in the "Progress" view you see the server adapter starting up. It is waiting for the image stream to be available.  
!screenshot-9.png|thumbnail! 
OpenShift creates the image stream by importing the docker image. This can take some time if it's the first time that you're using the image in OpenShift. It should be quick once this initial import is successful. It also happens to me that this initial start of the server adapter errors with a message that it took more than 450 secs and thus timed out. I then stop the server adapter and start it again.
# ASSERT: once the initial start is successful, the server adapter is successfully started, the "Console" view is shown and displays what files were copied over from the local project to the (deployment directory of the) pod.
!screenshot-10.png|thumbnail! 

> Please document procedure (if possible) for defining Debug port, Deployment path
> --------------------------------------------------------------------------------
>
>                 Key: JBDS-4777
>                 URL: https://issues.jboss.org/browse/JBDS-4777
>             Project: Red Hat CodeReady Studio (devstudio)
>          Issue Type: Feature Request
>          Components: openshift
>    Affects Versions: 12.11.0.GA
>         Environment: CodeReady Studio 12.11
>            Reporter: Rick Wagner
>            Assignee: Jeff MAURY
>            Priority: Major
>              Labels: openshift
>             Fix For: 12.x
>
>         Attachments: Dockerfile, Problem_Description.pdf, screenshot-1.png, screenshot-10.png, screenshot-2.png, screenshot-3.png, screenshot-4.png, screenshot-5.png, screenshot-6.png, screenshot-7.png, screenshot-8.png, screenshot-9.png
>
>
> Please document procedure for pre-filling the following in Adapter Server Settings:
> - Pod Deployment Path
> - Debugging Key
> - Debugging Port
> Can this be done via image Labels from an imported Docker image?



--
This message was sent by Atlassian Jira
(v7.12.1#712002)



More information about the jbosstools-issues mailing list