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
- In OpenShift Dedicated, select the project to create the application in, or create a new project for the application.
- In the +Add view, click From Git to see the Import from Git form.
- In the Git section, enter the Git repository URL for the codebase you want to use to create an application.
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.
- In the Builder section the appropriate builder image is detected and selected by default.
In the General section:
- In the Application field, enter a unique name for the application grouping. This must be unique in the project.
- The Name field is populated automatically based on the Git repository URL. This is used to identify the resources created for this application.
- In the Resources section, select Deployment Config, to create an OpenShift style application.
In the Advanced Options section:
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.
Optional: Click Routing to display advanced routing options.
- Customize the hostname for the route.
- Specify the path the router watches.
- Select the target port for traffic on the route.
- Configure transport security for the route.
- Optional: Click Build configuration to display advanced build configuration options, including any environment variables that your model requires to build.
- Optional: Click Deployment configuration to display advanced deployment configuration options, including any environment variables that your model requires in its deployment environment.
- Optional: Click Scaling to define the number of pods or application instances to deploy initially.
- Optional: Click Resource Limit to set the amount of CPU and Memory resources a container is guaranteed or allowed to use when running.
- Optional: Click Labels to add custom labels to your application.
- 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
.