Using JBoss Developer Studio 9.x's Container Development Kit Tooling

Updated -

Note: The Red Hat Container Development Kit tooling in JBoss Developer Studio 9.0 is released as a Technology Preview.

There are two ways to use the Red Hat Container Development Kit with JBoss Developer Studio:

  1. Installation and configuration in one of two ways:
    a. Automatically install and configure the Red Hat Container Development Kit and Red Hat JBoss Developer Studio using the Red Hat JBoss Developer Studio Platform Installer.
    b. Manually download, install, and configure the Red Hat Container Development Kit and Red Hat JBoss Developer Studio.
  2. Use the installed components for Container-Based Development.

Automatic Installation and Configuration

Use the Red Hat JBoss Developer Studio Platform Installer to install the Container Development Kit, JBoss Developer Studio, and other relevant components. The Installer automatically configures these components for use together. This option is currently in Technical Preview and only available for 64-bit Windows.

For instructions about using the Red Hat JBoss Developer Studio Platform Installer, see https://access.redhat.com/articles/2255391

Manual Installation and Configuration

Manually download and install the Red Hat Container Development Kit and Red Hat JBoss Developer Studio separately. This option requires some additional configuration steps before the two can be used together.

Prerequisites

Ensure that the following are installed on your system:

  • A virtualization system such as VirtualBox, VMWare, or Linux KVM/libvirt.
  • Vagrant, which is an open source tool to create and distribute portable development environments.
  • Red Hat Container Development Kit 2.0

For details about installing these prerequisites, see https://access.redhat.com/documentation/en/red-hat-enterprise-linux-atomic-host/version-7/container-development-kit-installation-guide/

Known Issues

  • When the explorer is first started, attempting to extend the Containers or Images causes the explorer to fail and throw an exception. To work around this issue, restart Eclipse/JBoss Developer Studio. Details are in JBIDE-21983
  • When the Container Development Kit is first started, you can use the OpenShift Explorer as expected with the automatically created connection. However, if the CDK is stopped and started again, the OpenShift connection requests the OpenShift password because it did not save this information when the connection was created. The default password for this is devel and when asked, you can choose to save the password for future use. For details about this issue, see JBIDE-22186.

Set Up the Container Development Kit in JBoss Developer Studio

  1. Run JBoss Developer Studio.
  2. Press the Ctrl and 3 keys and in the Quick Access bar, type Launch CDK.
  3. From the results, click Launch CDK Server.
  4. In the New Server dialog box:
    a. Ensure that the Show downloadable server adapters option is selected.
    b. Add the desired Server host name in the relevant field.
    c. Add the desired Server Name in the relevant field.
    d. Click Next to continue.
  5. Next, add the security information and users must add their access.redhat.com credentials:
    a. Click Add to add a new Username for the Red Hat Customer Portal or select an existing user from the drop-down menu.
    b. In the Folder field, navigate to the directory that contains your local Vagrantfile file. If Vagrantfile does not exist on your system, use the Vagrantfiles supplied in the cdk.zip file to initialize the CDK box.
    d. Click Finish to conclude setting up the CDK Server Adapter.
  6. Run the Container Development Kit server.
  7. Add the OpenShift server.
  8. Test the OpenShift Console at https://10.1.2.2:8443 with the username openshift-dev and password devel.
  9. You can now choose to continue working with OpenShift within JBoss Developer Studio or view instructions for Container-Based Development with JBoss Developer Studio.

Container-Based Development

After starting the CDK server in JBoss Developer Studio, you can follow one of two container development workflows:

Using docker service for Container-Based Development

Use the docker service for Container-Based Development as follows:

  1. Create a new Dynamic Web Project with your Dockerfile.
    a. Click File > New and select Project.
    b. Type java in the search bar and from the results, select Java Project and click Next to continue.
    c. Add a name for the new project and click Finish.
    d. Click File > New and select File.
    e. Enter the Dockerfile as the name and click Finish.
    f. Edit the Dockerfile as desired and then save (for example, by creating a new container image to customize a given version of JBoss/WildFly by adding a datasource definition and its associated driver). The Dockerfile may also package your application as a war file via a Maven command, and copy it into the container in the WildFly deployments directory. See https://docs.docker.com/engine/reference/builder for more information about the Dockerfile instructions.
  2. Do an image build using the CDK
    a. In the Project Explorer, right-click the Dockerfile and select Run As > docker Image Build.
    b. In the dialog box, add your CDK server adapter in the Connection field.
    c. For Repository Name, enter the desired name for the docker image and click OK.
    d. Once the build is done, a new image with the given name will be listed in the docker Explorer view and in the docker Images view.
  3. Run the using the CDK
    a. Open the docker Explorer view using the quick access menu using Ctrl+3.
    b. Navigate to CDK Server Adapter > Images.
    c. Right-click your image and click Run.
    d. Fill in the necessary details and click Finish to run your image. Add an optional container name to be able to locate it in a list of containers.
  4. In the docker Explorer view, select the container and expand its node and select the 8080 port and click on Show In>Web browser to access the application deployed in the Docker-formatted container.

Using OpenShift for Container-Based Development

Use OpenShift for Container-Based Development as follows:

  1. Create a new OpenShift project. Note that OpenShift projects are not the same as Eclipse projects, although Eclipse projects can be mapped to OpenShift applications.
    a. In the OpenShift Explorer tab, click New Connection Wizard to create a new OpenShift 3 connection.
    b. Add details for your connections, such as Connection name, Server type, Server URL and Authentication information.
    c. Click Finish to create the connection.
    d. The OpenShift Explorer tab now displays your new connection. Right-click the name of the connection and select New > Project to create a new OpenShift project.
    e. Add the name and any other relevant details for your new OpenShift project and click Finish.
  2. Create an application in your OpenShift project using the OpenShift templates.
    a. Right-click your new project’s name and click New > Application.
    b. In the Select Template dialog box, type the application type required. For example, for a node.js application, type nodejs and from the displayed list, select nodejs-example and click Finish.
    c. Click OK to accept the results of the application creation process.
    d. When prompted, enter a new git location or click Finish in the dialog box to use the listed default git location for your application.
  3. Create a new OpenShift server adapter for your project and application.
    a. In the Servers tab, right-click a blank area and select New > Server to create a new server.
    b. In the Select a server type field, type openshift, and from the listed results, select OpenShift 3 Server Adapter and click Next.
    c. The next screen asks for connection details. Edit the connection information or use the default information, which is for the previously defined OpenShift 3 connection.
    d. The next step asks for a service for the new server. Click the name of the project to see the applications bound to the project and click the desired application. Click Finish.
  4. Debug the application, if required.
    a. Right-click the project name and click Show In > Debug to debug the application.

Comments