Chapter 4. Creating an OpenShift application from a Git repository

You can import code from a Git repository and use it to create, build, and deploy a Red Hat OpenShift Data Science application on OpenShift Dedicated.

Prerequisites

  • You have logged in to the OpenShift Dedicated web console.
  • You are in the Developer perspective.
  • You have the appropriate roles and permissions in a project to create applications and other workloads in OpenShift Dedicated.
  • You have a configured Git repository.
  • You have permissions for importing the Git repository.

Procedure

  1. In OpenShift Dedicated, select the project to create the application in, or create a new project for the application.
  2. In the +Add view, click From Git to see the Import from Git form.
  3. In the Git section, enter the Git repository URL for the codebase you want to use to create an application.
  4. Optional: Click Show Advanced Git Options to add details such as:

    • Git Reference to point to code in a specific branch, tag, or commit to be used to build the application.
    • Context Dir to specify the subdirectory for the application source code you want to use to build the application.
    • Source Secret to create a Secret Name with credentials for pulling your source code from a private repository.
  5. In the Builder section the appropriate builder image is detected and selected by default.
  6. In the General section:

    1. In the Application field, enter a unique name for the application grouping. This must be unique in the project.
    2. The Name field is populated automatically based on the Git repository URL. This is used to identify the resources created for this application.
  7. In the Resources section, select Deployment Config, to create an OpenShift style application.
  8. In the Advanced Options section:

    1. The Create a route to the application checkbox is selected by default so that you can access your application using a publicly available URL.

      If you do not want to expose your application on a public route, clear the checkbox.

    2. Optional: Click Routing to display advanced routing options.

      1. Customize the hostname for the route.
      2. Specify the path the router watches.
      3. Select the target port for traffic on the route.
      4. Configure transport security for the route.
    3. Optional: Click Build configuration to display advanced build configuration options, including any environment variables that your model requires to build.
    4. Optional: Click Deployment configuration to display advanced deployment configuration options, including any environment variables that your model requires in its deployment environment.
    5. Optional: Click Scaling to define the number of pods or application instances to deploy initially.
    6. Optional: Click Resource Limit to set the amount of CPU and Memory resources a container is guaranteed or allowed to use when running.
    7. Optional: Click Labels to add custom labels to your application.
  9. Click Create to create the application and see its build status in the Topology view.

Verification

  • You can view your application in the Topology view.
  • Click the application and check the Resources tab of the application details pane. Look for a success message under Builds, for example, Build #1 is complete.