Skip to content

Commit

Permalink
Merge branch 'main' into redhat-sso
Browse files Browse the repository at this point in the history
  • Loading branch information
fketelaars committed Mar 7, 2024
2 parents 0421346 + 8492ce6 commit 00e609c
Show file tree
Hide file tree
Showing 16 changed files with 427 additions and 33 deletions.
2 changes: 1 addition & 1 deletion automation-generators/generic/cp4d/preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def preprocessor(attributes=None, fullConfig=None, moduleVariables=None):
g('sequential_install').isOptional().mustBeOneOf([True, False])
g('accept_licenses').isOptional().mustBeOneOf([True, False])
g('change_node_settings').isOptional()
g('cp4d_entitlement').isOptional().mustBeOneOf(['cpd-enterprise', 'cpd-standard'])
g('cp4d_entitlement').isOptional().mustBeOneOf(['cpd-enterprise', 'cpd-standard', 'watsonx-data', 'watsonx-ai', 'watsonx-gov-model-management', 'watsonx-gov-risk-compliance'])
g('cp4d_production_license').isOptional().mustBeOneOf([True, False])

# Expand storage if no errors yet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@
loop_control:
loop_var: _machine_set_name

- name: Label storage nodes as infra nodes so they are not used for customer workload
shell: |
oc label nodes \
$(oc get machine -n openshift-machine-api -l machine.openshift.io/cluster-api-machineset={{ _machine_set_name }} -o jsonpath='{.items[0].metadata.name}') \
node-role.kubernetes.io/infra="" --overwrite
with_items:
- "{{ _infrastructure_id }}-{{ current_openshift_storage.ocs_storage_label }}-{{ azure_location }}1"
- "{{ _infrastructure_id }}-{{ current_openshift_storage.ocs_storage_label }}-{{ azure_location }}2"
- "{{ _infrastructure_id }}-{{ current_openshift_storage.ocs_storage_label }}-{{ azure_location }}3"
loop_control:
loop_var: _machine_set_name

- name: Install ODF operator
include_role:
name: odf-operator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@
loop_control:
loop_var: _machine_set_name

- name: Label storage nodes as infra nodes so they are not used for customer workload
shell: |
oc label nodes \
$(oc get machine -n openshift-machine-api -l machine.openshift.io/cluster-api-machineset={{ _machine_set_name }} -o jsonpath='{.items[0].metadata.name}') \
node-role.kubernetes.io/infra="" --overwrite
with_items:
- "{{ _infrastructure_id }}-{{ current_openshift_storage.ocs_storage_label }}-{{ azure_location }}1"
- "{{ _infrastructure_id }}-{{ current_openshift_storage.ocs_storage_label }}-{{ azure_location }}2"
- "{{ _infrastructure_id }}-{{ current_openshift_storage.ocs_storage_label }}-{{ azure_location }}3"
loop_control:
loop_var: _machine_set_name

- name: Install ODF operator
include_role:
name: odf-operator
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- name: Insert wkc options into {{ status_dir }}/cp4d/{{ _p_current_cp4d_cluster.project }}-install-options.yml
blockinfile:
path: "{{ status_dir }}/cp4d/{{ _p_current_cp4d_cluster.project }}-install-options.yml"
marker: "# {mark} watsonx_governance options #"
block: |2
watsonx_governance:
installType: {{ _current_cp4d_cartridge.installation_options.installType | default(all) }}
enableFactsheet: {{ _current_cp4d_cartridge.installation_options.enableFactsheet | default(true) }}
enableOpenpages: {{ _current_cp4d_cartridge.installation_options.enableOpenpages | default(true) }}
enableOpenscale: {{ _current_cp4d_cartridge.installation_options.enableOpenscale | default(true) }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@
_cp4d_entitlement: "{{ current_cp4d_cluster.cp4d_entitlement | default('cpd-enterprise') }}"
_cp4d_production_license: "{{ current_cp4d_cluster.cp4d_production_license | default('False') }}"

- debug:
var: current_cp4d_cluster

- name: Generate apply-entitlement command
template:
src: apply-entitlement.j2
dest: "{{ status_dir }}/cp4d/{{ current_cp4d_cluster.project }}-apply-entitlement.sh"
mode: u=rwx

- name: Run apply-entitlement command
- name: Run apply-entitlement command, logs are in {{ status_dir }}/log/{{ current_cp4d_cluster.project }}-apply-entitlement.log
shell: |
{{ status_dir }}/cp4d/{{ current_cp4d_cluster.project }}-apply-entitlement.sh
{{ status_dir }}/cp4d/{{ current_cp4d_cluster.project }}-apply-entitlement.sh
register: _apply_entitlement_result
retries: 5
delay: 30
until: _apply_entitlement_result.rc == 0
vars:
ansible_callback_diy_runner_retry_msg: >-
{%- set result = ansible_callback_diy.result.output -%}
{%- set retries_left = result.retries - result.attempts -%}
Retrying: {{ ansible_callback_diy.task.name }} ({{ retries_left }} Retries left) ...
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@
_p_openshift_cluster_name: "{{ current_cp4d_cluster.openshift_cluster_name }}"
_p_openshift_storage_name: "{{ current_cp4d_cluster.openshift_storage_name }}"

- name: Retrieve Cloud Pak Foundational Services
set_fact:
_cp_fs: "{{ current_cp4d_cluster.cartridges | json_query(query) | first | default({}) }}"
vars:
query: >-
[?name == 'cpfs' || name == 'cp-foundation']
- name: Show foundational services element
debug:
var: _cp_fs

# TODO: Temporary patch
- name: Patch version config file for CP4D 4.0.9
copy:
Expand Down Expand Up @@ -34,7 +45,9 @@
include_role:
name: cp-fs-cluster-components
vars:
_p_openshift_cluster_name: "{{ current_cp4d_cluster.openshift_cluster_name }}"
_p_cp4d_version: "{{ current_cp4d_cluster.cp4d_version }}"
_p_license_threads_per_core: "{{ _cp_fs.license_service.threads_per_core | default(1) }}"
_p_migrate_topology: False
_p_preview: False
when: current_cp4d_cluster.cp4d_version >= "4.7.0"
Expand Down Expand Up @@ -90,17 +103,6 @@
include_role:
name: cp4d-configure-ssl-certificate

- name: Retrieve Cloud Pak Foundational Services
set_fact:
_cp_fs: "{{ current_cp4d_cluster.cartridges | json_query(query) | first | default({}) }}"
vars:
query: >-
[?name == 'cpfs' || name == 'cp-foundation']
- name: Show foundational services element
debug:
var: _cp_fs

- name: Activate or deactivate license service for older versions of Cloud Pak for Data
include_role:
name: cp-fs-license-service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
set -o pipefail
apply-entitlement \
--cpd_instance_ns={{ current_cp4d_cluster.project }} \
--entitlement={{ _cp4d_entitlement }} \
--production={{ _cp4d_production_license }}
--production={{ _cp4d_production_license }} \
--apply_branding=true | tee {{ status_dir }}/log/{{ current_cp4d_cluster.project }}-apply-entitlement.log
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,16 @@ cartridge_cr:
cr_status_attribute: wxdStatus
cr_status_completed: Completed
force_sequential_install: False
- name: watsonx-governance
olm_utils_name: watsonx_governance
cr_preprocessing_script: cp4d-prep-watsonx-governance.yml
cr_cr: Watsonxgovernance
cr_name: watsonxgovernance-cr
cr_status_attribute: watsonxGovernanceStatus
cr_status_completed: Completed
force_sequential_install: False
db2u_dependency: True
db2u_kubelet: True
- name: wkc
olm_utils_name: wkc
cr_preprocessing_script: cp4d-prep-wkc.yml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
- name: Validate that mandatory parameters have been specified
assert:
that:
- _p_cp4d_version is defined
- set_fact:
_threads_per_core: "{{ _p_license_threads_per_core | default(1) }}"

- name: Delete offline directory
file:
Expand All @@ -16,14 +14,20 @@
remote_src: True
when: (cpd_airgap | default(False) | bool)

- name: Generate apply-cluster-components script {{ status_dir }}/cp4d/{{ current_cp4d_cluster.openshift_cluster_name }}-{{ current_cp4d_cluster.project }}-apply-cluster-components.sh
- name: Generate apply-cluster-components script {{ status_dir }}/cp4d/{{ _p_openshift_cluster_name }}-apply-cluster-components.sh
template:
src: apply-cluster-components.j2
dest: "{{ status_dir }}/cp4d/{{ current_cp4d_cluster.openshift_cluster_name }}-{{ current_cp4d_cluster.project }}-apply-cluster-components.sh"
dest: "{{ status_dir }}/cp4d/{{ _p_openshift_cluster_name }}-apply-cluster-components.sh"
mode: u+rwx

- name: Run shell script to apply cluster components on OpenShift cluster {{ current_cp4d_cluster.openshift_cluster_name }}, logs are in {{ status_dir }}/log/{{ current_cp4d_cluster.openshift_cluster_name }}-{{ current_cp4d_cluster.project }}-apply-cluster-components.log
- name: Run shell script to apply cluster components on OpenShift cluster {{ _p_openshift_cluster_name }}, logs are in {{ status_dir }}/log/{{ _p_openshift_cluster_name }}-apply-cluster-components.log
shell: |
{{ status_dir }}/cp4d/{{ current_cp4d_cluster.openshift_cluster_name }}-{{ current_cp4d_cluster.project }}-apply-cluster-components.sh
{{ status_dir }}/cp4d/{{ _p_openshift_cluster_name }}-apply-cluster-components.sh
when:
- not _p_preview
- not _p_preview

- name: Set number of threads per core to {{ _threads_per_core }}
shell: |
oc patch ibmlicensing instance \
--type=merge \
-p '{"spec": {"features": {"hyperThreading": {"threadsPerCore" : {{ _threads_per_core }} }}}}'
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ apply-cluster-components \
--migrate_from_cs_ns={{ foundational_services_project }} \
{% endif -%}
--cert_manager_ns={{ cert_manager_project }} \
--licensing_ns={{ license_service_project }} 2>&1 | tee {{ status_dir }}/log/{{ current_cp4d_cluster.openshift_cluster_name }}-{{ current_cp4d_cluster.project }}-apply-cluster-components.log 2>&1
--licensing_ns={{ license_service_project }} 2>&1 | tee {{ status_dir }}/log/{{ _p_openshift_cluster_name }}-apply-cluster-components.log 2>&1
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
- (_p_delete_all_instances | default(False)) == False
- (_p_wait_instances | default(False)) == False

# Delete OpenPages instances if there is no longer a dependency by other cartridges
- include_tasks: delete_openpages_instances.yml
when:
- (_p_wait_instances | default(False)) == False
- _surviving_cartridges | selectattr('CR_Kind','equalto',(_openpages_cartridge.CR_Kind | default(''))) | list | count == 0

- include_tasks: wait_openpages_instances.yml
when:
Expand Down
2 changes: 1 addition & 1 deletion docs/src/30-reference/configuration/cloud-pak.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ cp4d:
| change_node_settings | Controls whether the node settings using the machine configs will be applied onto the OpenShift cluster. | No | True, False |
| db2u_limited_privileges | Depicts whether Db2U containers run with limited privileges. If they do (`True`), Deployer will create KubeletConfig and Tuned OpenShift resources as per the documentation. | No | False (default), True |
| accept_licenses | Set to 'True' to accept Cloud Pak licenses. Alternatively the `--accept-all-licenses` can be used for the `cp-deploy.sh` command | No | True, False (default) |
| cp4d_entitlement | Set to `cpd-enterprise` or `cpd-standard`, dependent on the deployed license | No | cpd-enterprise (default), cpd-standard |
| cp4d_entitlement | Set to `cpd-enterprise`, `cpd-standard`, `watsonx-data`, `watsonx-ai`, `watsonx-gov-model-management`, `watsonx-gov-risk-compliance`, dependent on the deployed license | No | cpd-enterprise (default), cpd-standard, watsonx-data, watsonx-ai, watsonx-gov-model-management, watsonx-gov-risk-compliance |
| cp4d_production_license | Whether the Cloud Pak for Data is a production license | No | True (default), False |
| image_registry_name | When using private registry, specify name of `image_registry` | No | |
| openshift_storage_name | References an `openshift_storage` element in the OpenShift cluster that was defined for this Cloud Pak for Data instance. The name must exist under `openshift.[openshift_cluster_name].openshift_storage. | No, inferred from openshift->openshift_storage | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ cp4d:
cartridges:
- name: cp-foundation
license_service:
state: disabled
threads_per_core: 2

- name: lite
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ cp4d:
cartridges:
- name: cp-foundation
license_service:
state: disabled
threads_per_core: 2

- name: lite
Expand Down Expand Up @@ -252,8 +251,12 @@ cp4d:
state: removed
- model_id: ibm-granite-13b-chat-v1
state: removed
- model_id: ibm-granite-13b-chat-v2
state: removed
- model_id: ibm-granite-13b-instruct-v1
state: removed
- model_id: ibm-granite-13b-instruct-v2
state: removed
- model_id: meta-llama-llama-2-70b-chat
state: removed
- model_id: ibm-mpt-7b-instruct2
Expand Down
Loading

0 comments on commit 00e609c

Please sign in to comment.