Skip to content

Commit 4621893

Browse files
authored
feat: full refactor of modules and DA (#34)
BREAKING CHANGE: No supported migration from v1.x.x
1 parent 42d10a6 commit 4621893

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1199
-203
lines changed

.catalog-onboard-pipeline.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
apiVersion: v1
3+
offerings:
4+
- name: deploy-arch-ibm-watsonx-self-managed
5+
kind: solution
6+
catalog_id: 7df1e4ca-d54c-4fd0-82ce-3d13247308cd
7+
offering_id: 86425cf1-a763-4d17-9bb9-75276274a5f6
8+
variations:
9+
- name: fully-configurable
10+
mark_ready: true
11+
install_type: fullstack
12+
pre_validation: "tests/scripts/pre-validation-deploy-ocp-instances.sh"
13+
post_validation: "tests/scripts/post-validation-destroy-ocp-instances.sh"
14+
scc:
15+
instance_id: 1c7d5f78-9262-44c3-b779-b28fe4d88c37
16+
region: us-south

.releaserc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
}],
1111
["@semantic-release/exec", {
1212
"successCmd": "echo \"SEMVER_VERSION=${nextRelease.version}\" >> $GITHUB_ENV"
13+
}],
14+
["@semantic-release/exec",{
15+
"publishCmd": "./ci/trigger-catalog-onboarding-pipeline.sh --version=v${nextRelease.version}"
1316
}]
1417
]
1518
}

.secrets.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.sum|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2025-02-11T22:49:03Z",
6+
"generated_at": "2025-02-11T22:49:04Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"

README.md

Lines changed: 130 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,141 @@
1-
<!-- Update this title with a descriptive name. Use sentence case. -->
2-
# IBM Cloud Pak for Data deployment on OpenShift
1+
# Watsonx (Self-Managed) on Red Hat OpenShift
32

4-
<!--
5-
Update status and "latest release" badges:
6-
1. For the status options, see https://terraform-ibm-modules.github.io/documentation/#/badge-status
7-
2. Update the "latest release" badge to point to the correct module's repo. Replace "terraform-ibm-module-template" in two places.
8-
-->
9-
[![Incubating (Not yet consumable)](https://img.shields.io/badge/status-Incubating%20(Not%20yet%20consumable)-red)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)
10-
[![latest release](https://img.shields.io/github/v/release/terraform-ibm-modules/terraform-ibm-cloudpak-data?logo=GitHub&sort=semver)](https://github.com/terraform-ibm-modules/terraform-ibm-cloudpak-data/releases/latest)
3+
[![Stable (With quality checks)](https://img.shields.io/badge/Status-Stable%20(With%20quality%20checks)-green)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)
4+
[![latest release](https://img.shields.io/github/v/release/terraform-ibm-modules/terraform-ibm-watsonx-self-managed-ocp?logo=GitHub&sort=semver)](https://github.com/terraform-ibm-modules/terraform-ibm-watsonx-self-managed-ocp/releases/latest)
115
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
126
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)
137
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
148

9+
Deploy Watsonx services on an existing Red Hat OpenShift cluster.
10+
11+
<!--
12+
If this repo contains any reference architectures, uncomment the heading below and links to them.
13+
(Usually in the `/reference-architectures` directory.)
14+
See "Reference architecture" in Authoring Guidelines in the public documentation at
15+
https://terraform-ibm-modules.github.io/documentation/#/implementation-guidelines?id=reference-architecture
16+
-->
17+
<!-- ## Reference architectures -->
18+
19+
<!-- Below content is automatically populated via pre-commit hook -->
20+
<!-- BEGIN OVERVIEW HOOK -->
21+
## Overview
22+
* [terraform-ibm-watsonx-self-managed-ocp](#terraform-ibm-watsonx-self-managed-ocp)
23+
* [Submodules](./modules)
24+
* [Examples](./examples)
25+
* [Basic example](./examples/basic)
26+
* [Contributing](#contributing)
27+
<!-- END OVERVIEW HOOK -->
28+
29+
## terraform-ibm-watsonx-self-managed-ocp
30+
31+
### Usage
32+
33+
```hcl
34+
module "watsonx_self_managed_ocp" {
35+
source = "terraform-ibm-modules/watsonx-self-managed-ocp/ibm"
36+
version = "X.X.X" # Replace "X.X.X" with a release version to lock into a specific release
37+
ibmcloud_api_key = "xxxxxxxxxxxxxxxxx" # pragma: allowlist secret
38+
resource_group_id = "xxxxxxxxxxxxxxxxx"
39+
region = "us-south"
40+
prefix = "cp4d"
41+
cluster_name = "my-ocp-cluster"
42+
cluster_rg_id = "xxxxxxxxxxxxxxxxx"
43+
install_odf_cluster_addon = true
44+
watsonx_ai_install = true
45+
watsonx_data_install = true
46+
watson_assistant_install = true
47+
watson_discovery_install = true
48+
cpd_admin_password = "Passw0rd!" # pragma: allowlist secret
49+
cpd_entitlement_key = "entitlementKey"
50+
# Add other configuration options as needed
51+
}
52+
```
53+
54+
### Required IAM access policies
55+
56+
You need the following permissions to run this module.
57+
58+
* Account Management
59+
* **All Resource Groups** service
60+
* `Viewer` platform access
61+
* IAM Services
62+
* **Kubernetes Service** (OpenShift)
63+
* `Administrator` platform access
64+
* `Manager` service access
65+
* **VPC Infrastructure**
66+
* `Administrator` platform access
67+
* `Manager` service access
68+
* **Container Registry**
69+
* `Administrator` platform access
70+
* `Manager` service access
71+
72+
For more information on access and permissions, see [IBM Cloud IAM service roles and actions](https://cloud.ibm.com/docs/account?topic=account-iam-service-roles-actions).
73+
74+
<!-- Below content is automatically populated via pre-commit hook -->
75+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
76+
### Requirements
77+
78+
| Name | Version |
79+
|------|---------|
80+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9.0 |
81+
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >=1.79.1 |
82+
83+
### Modules
84+
85+
| Name | Source | Version |
86+
|------|--------|---------|
87+
| <a name="module_build_cpd_image"></a> [build\_cpd\_image](#module\_build\_cpd\_image) | ./modules/cpd-image-build | n/a |
88+
| <a name="module_cloud_pak_deployer"></a> [cloud\_pak\_deployer](#module\_cloud\_pak\_deployer) | ./modules/cloud-pak-deployer | n/a |
89+
| <a name="module_config"></a> [config](#module\_config) | ./modules/cloud-pak-deployer/config | n/a |
90+
| <a name="module_watsonx_ai"></a> [watsonx\_ai](#module\_watsonx\_ai) | ./modules/watsonx-ai | n/a |
91+
| <a name="module_watsonx_data"></a> [watsonx\_data](#module\_watsonx\_data) | ./modules/watsonx-data | n/a |
92+
93+
### Resources
94+
95+
| Name | Type |
96+
|------|------|
97+
| [ibm_container_addons.odf_cluster_addon](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/resources/container_addons) | resource |
98+
| [ibm_container_vpc_cluster.cluster_info](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/data-sources/container_vpc_cluster) | data source |
99+
100+
### Inputs
101+
102+
| Name | Description | Type | Default | Required |
103+
|------|-------------|------|---------|:--------:|
104+
| <a name="input_cloud_pak_deployer_image"></a> [cloud\_pak\_deployer\_image](#input\_cloud\_pak\_deployer\_image) | Cloud Pak Deployer image to use. If `null`, the image will be built using Code Engine. | `string` | `null` | no |
105+
| <a name="input_cloud_pak_deployer_release"></a> [cloud\_pak\_deployer\_release](#input\_cloud\_pak\_deployer\_release) | Release of Cloud Pak Deployer version to use. View releases at: https://github.com/IBM/cloud-pak-deployer/releases. | `string` | `"v3.1.8"` | no |
106+
| <a name="input_cloud_pak_deployer_secret"></a> [cloud\_pak\_deployer\_secret](#input\_cloud\_pak\_deployer\_secret) | Secret for accessing the Cloud Pak Deployer image. If `null`, a default secret will be created # pragma: allowlist secret. | <pre>object({<br/> username = string<br/> password = string<br/> server = string<br/> email = string<br/> })</pre> | `null` | no |
107+
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Name of Red Hat OpenShift cluster to install watsonx onto | `string` | n/a | yes |
108+
| <a name="input_cluster_rg_id"></a> [cluster\_rg\_id](#input\_cluster\_rg\_id) | Resource group id of the cluster | `string` | n/a | yes |
109+
| <a name="input_code_engine_project_id"></a> [code\_engine\_project\_id](#input\_code\_engine\_project\_id) | If you want to use an existing project, you can pass the code engine project ID and the Cloud Pak Deployer build will be built within the existing project instead of creating a new one. | `string` | `null` | no |
110+
| <a name="input_code_engine_project_name"></a> [code\_engine\_project\_name](#input\_code\_engine\_project\_name) | If `cloud_pak_deployer_image` is `null`, it will build the image with code engine and store it within a private ICR registry. Provide a name if you want to set the name. If not defined, default will be `{prefix}-cpd-{random-suffix}`. | `string` | `null` | no |
111+
| <a name="input_cpd_accept_license"></a> [cpd\_accept\_license](#input\_cpd\_accept\_license) | When set to 'true', it is understood that the user has read the terms of the Cloud Pak license(s) and agrees to the terms outlined. | `bool` | `true` | no |
112+
| <a name="input_cpd_admin_password"></a> [cpd\_admin\_password](#input\_cpd\_admin\_password) | Password for the Cloud Pak for Data admin user. | `string` | n/a | yes |
113+
| <a name="input_cpd_entitlement_key"></a> [cpd\_entitlement\_key](#input\_cpd\_entitlement\_key) | Cloud Pak for Data entitlement key for access to the IBM Entitled Registry. Can be fetched from https://myibm.ibm.com/products-services/containerlibrary. | `string` | n/a | yes |
114+
| <a name="input_cpd_version"></a> [cpd\_version](#input\_cpd\_version) | Cloud Pak for Data version to install. Only version 5.x.x is supported, latest versions can be found [here](https://www.ibm.com/docs/en/cloud-paks/cp-data?topic=versions-cloud-pak-data). | `string` | `"5.0.3"` | no |
115+
| <a name="input_ibmcloud_api_key"></a> [ibmcloud\_api\_key](#input\_ibmcloud\_api\_key) | The IBM Cloud API key to deploy resources. | `string` | n/a | yes |
116+
| <a name="input_install_odf_cluster_addon"></a> [install\_odf\_cluster\_addon](#input\_install\_odf\_cluster\_addon) | Install the ODF cluster addon. | `bool` | `true` | no |
117+
| <a name="input_odf_config"></a> [odf\_config](#input\_odf\_config) | Configuration for the ODF addon. | `map(string)` | <pre>{<br/> "addSingleReplicaPool": "false",<br/> "billingType": "essentials",<br/> "clusterEncryption": "false",<br/> "disableNoobaaLB": "false",<br/> "enableNFS": "false",<br/> "encryptionInTransit": "false",<br/> "hpcsBaseUrl": "",<br/> "hpcsEncryption": "false",<br/> "hpcsInstanceId": "",<br/> "hpcsSecretName": "",<br/> "hpcsServiceName": "",<br/> "hpcsTokenUrl": "",<br/> "ignoreNoobaa": "true",<br/> "numOfOsd": "1",<br/> "ocsUpgrade": "false",<br/> "odfDeploy": "true",<br/> "osdDevicePaths": "",<br/> "osdSize": "512Gi",<br/> "osdStorageClassName": "ibmc-vpc-block-metro-10iops-tier",<br/> "prepareForDisasterRecovery": "false",<br/> "resourceProfile": "balanced",<br/> "taintNodes": "false",<br/> "useCephRBDAsDefaultStorageClass": "false",<br/> "workerNodes": "all",<br/> "workerPool": ""<br/>}</pre> | no |
118+
| <a name="input_odf_version"></a> [odf\_version](#input\_odf\_version) | Version of ODF to install. | `string` | `"4.16.0"` | no |
119+
| <a name="input_prefix"></a> [prefix](#input\_prefix) | A unique identifier for resources that is prepended to resources that are provisioned. Must begin with a lowercase letter and end with a lowercase letter or number. Must be 16 or fewer characters. | `string` | `null` | no |
120+
| <a name="input_region"></a> [region](#input\_region) | Region where resources will be created. To find your VPC region, use `ibmcloud is regions` command to find available regions. | `string` | n/a | yes |
121+
| <a name="input_resource_group"></a> [resource\_group](#input\_resource\_group) | Resource group to provision services within. If not defined, a resource group called `{prefix}-cpd` will be created. | `string` | `null` | no |
122+
| <a name="input_watson_assistant_install"></a> [watson\_assistant\_install](#input\_watson\_assistant\_install) | If watsonx.ai is being installed, also install watson assistant | `bool` | `false` | no |
123+
| <a name="input_watson_discovery_install"></a> [watson\_discovery\_install](#input\_watson\_discovery\_install) | If watsonx.ai is being installed, also install watson discovery | `bool` | `false` | no |
124+
| <a name="input_watsonx_ai_install"></a> [watsonx\_ai\_install](#input\_watsonx\_ai\_install) | Determine whether the watsonx.ai cartridge for the deployer will be installed | `bool` | `false` | no |
125+
| <a name="input_watsonx_ai_models"></a> [watsonx\_ai\_models](#input\_watsonx\_ai\_models) | List of watsonx.ai models to install. Information on the foundation models including pre-reqs can be found here - https://www.ibm.com/docs/en/cloud-paks/cp-data/5.0.x?topic=install-foundation-models. Use the ModelID as input | `list(string)` | <pre>[<br/> "ibm-granite-13b-instruct-v2"<br/>]</pre> | no |
126+
| <a name="input_watsonx_data_install"></a> [watsonx\_data\_install](#input\_watsonx\_data\_install) | Determine whether the watsonx.data cartridge for the deployer will be installed | `bool` | `false` | no |
15127

16-
This repository contains the following deployment on an Red Hat OpenShift cluster:
17-
- [IBM Cloud Pak for Data](./solutions/deploy)
128+
### Outputs
18129

19-
**NB:** These solutions are not intended to be called by one or more other modules since they contain a provider configurations, meaning they are not compatible with the `for_each`, `count`, and `depends_on` arguments. For more information see [Providers Within Modules](https://developer.hashicorp.com/terraform/language/modules/develop/providers)
130+
| Name | Description |
131+
|------|-------------|
132+
| <a name="output_cloud_pak_deployer_image"></a> [cloud\_pak\_deployer\_image](#output\_cloud\_pak\_deployer\_image) | The Cloud Pak Deployer image used. |
133+
| <a name="output_cloud_pak_deployer_secret"></a> [cloud\_pak\_deployer\_secret](#output\_cloud\_pak\_deployer\_secret) | The secret used for accessing the Cloud Pak Deployer image. |
134+
| <a name="output_cluster_name"></a> [cluster\_name](#output\_cluster\_name) | The name of the OpenShift cluster. |
135+
| <a name="output_code_engine_project_name"></a> [code\_engine\_project\_name](#output\_code\_engine\_project\_name) | The name of the code engine project that was created |
136+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
20137

21-
<!-- Leave this section as is so that your module has a link to local development environment set-up steps for contributors to follow -->
138+
<!-- Leave this section as is so that your module has a link to local development environment set up steps for contributors to follow -->
22139
## Contributing
23140

24141
You can report issues and request features for this module in GitHub issues in the module repo. See [Report an issue or request a feature](https://github.com/terraform-ibm-modules/.github/blob/main/.github/SUPPORT.md).

chart/cloud-pak-deployer/templates/install-job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
labels:
77
App: {{ .Values.deployer.prefix }}
88
annotations:
9-
# https://github.com/terraform-ibm-modules/terraform-ibm-cloudpak-data/issues/14
9+
# https://github.com/terraform-ibm-modules/terraform-ibm-watsonx-self-managed-ocp/issues/14
1010
checkov.io/skip1: CKV_K8S_10
1111
checkov.io/skip2: CKV_K8S_11
1212
checkov.io/skip3: CKV_K8S_12

chart/cloud-pak-deployer/templates/uninstall-job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
"helm.sh/hook": pre-delete
1010
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
1111
"helm.sh/hook-weight": "4"
12-
# https://github.com/terraform-ibm-modules/terraform-ibm-cloudpak-data/issues/14
12+
# https://github.com/terraform-ibm-modules/terraform-ibm-watsonx-self-managed-ocp/issues/14
1313
checkov.io/skip1: CKV_K8S_21
1414
checkov.io/skip2: CKV_K8S_30
1515
checkov.io/skip3: CKV_K8S_28

cra-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ CRA_TARGETS: [] # disable CRA since no SCC instance exists in the test account
1313
# # SCC_INSTANCE_ID: "" # The SCC instance ID to use to download profile for CRA scan. If not provided, a default global value will be used.
1414
# # SCC_REGION: "" # The IBM Cloud region that the SCC instance is in. If not provided, a default global value will be used.
1515
# CRA_ENVIRONMENT_VARIABLES: # An optional map of environment variables for CRA, where the key is the variable name and value is the value. Useful for providing TF_VARs.
16-
# TF_VAR_prefix: "roks-cpd"
16+
# TF_VAR_prefix: "ocp-cpd"
1717
# TF_VAR_region: "au-syd"

examples/basic/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Basic example
2+
3+
<!--
4+
The basic example should call the module(s) stored in this repository with a basic configuration.
5+
Note, there is a pre-commit hook that will take the title of each example and include it in the repos main README.md.
6+
The text below should describe exactly what resources are provisioned / configured by the example.
7+
-->
8+
9+
This basic example demonstrates how to deploy IBM Cloud Pak for Data and optional watsonx services on a new Red Hat OpenShift cluster using this module.
10+
11+
It provisions the following resources:
12+
13+
- A new resource group (if not provided)
14+
- A new VPC, subnet, and public gateway
15+
- A new Red Hat OpenShift cluster with configurable worker pools
16+
- IBM Cloud Pak for Data installation
17+
- Optional watsonx services (watsonx.ai, watsonx.data, Watson Assistant, Watson Discovery)

0 commit comments

Comments
 (0)