Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions src/mas/devops/tekton.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,12 +563,12 @@ def prepareRestoreSecrets(dynClient: DynamicClient, namespace: str, restoreConfi
secretsAPI.create(body=restoreConfigs, namespace=namespace)


def prepareInstallSecrets(dynClient: DynamicClient, namespace: str, slsLicenseFile: str = None, additionalConfigs: dict = None, certs: str = None, podTemplates: str = None, slack_token: str = None, slack_channel: str = None) -> None:
def prepareInstallSecrets(dynClient: DynamicClient, namespace: str, slsLicenseFile: str = None, additionalConfigs: dict = None, certs: str = None, podTemplates: str = None, slack_token: str = None, slack_channel: str = None, aiserviceConfig: str = None) -> None:
"""
Create or update secrets required for MAS installation pipelines.

Creates five secrets in the specified namespace: mas-devops-slack, pipeline-additional-configs,
pipeline-sls-entitlement, pipeline-certificates, and pipeline-pod-templates.
pipeline-sls-entitlement, pipeline-certificates, pipeline-pod-templates and pipeline-aiservice-config.

Parameters:
dynClient (DynamicClient): OpenShift Dynamic Client
Expand All @@ -579,6 +579,7 @@ def prepareInstallSecrets(dynClient: DynamicClient, namespace: str, slsLicenseFi
podTemplates (str, optional): Pod template data. Defaults to None (empty secret).
slack_token (str, optional): Slack bot token for notifications. Defaults to None.
slack_channel (str, optional): Slack channel ID for notifications. Defaults to None.
aiserviceConfig (str, optional): AI Service tenant config data. Defaults to None (empty secret).

Returns:
None
Expand Down Expand Up @@ -701,6 +702,24 @@ def prepareInstallSecrets(dynClient: DynamicClient, namespace: str, slsLicenseFi
}
secretsAPI.create(body=podTemplates, namespace=namespace)

# 5. Secret/pipeline-aiservice-config
# -------------------------------------------------------------------------
try:
secretsAPI.delete(name="pipeline-aiservice-config", namespace=namespace)
except NotFoundError:
pass

if aiserviceConfig is None:
aiserviceConfig = {
"apiVersion": "v1",
"kind": "Secret",
"type": "Opaque",
"metadata": {
"name": "pipeline-aiservice-config"
}
}
secretsAPI.create(body=aiserviceConfig, namespace=namespace)


def prepareUpdateSlackSecrets(dynClient: DynamicClient, slack_token: str = None, slack_channel: str = None) -> None:
"""
Expand Down
12 changes: 11 additions & 1 deletion src/mas/devops/templates/pipelinerun-install.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,10 @@ spec:
value: "{{ tenant_entitlement_start_date }}"
- name: tenant_entitlement_end_date
value: "{{ tenant_entitlement_end_date }}"
{%- if tenant_scheduling_config_file is defined and tenant_scheduling_config_file != "" %}
- name: tenant_scheduling_cfg_file
value: "{{ tenant_scheduling_config_file }}"
{%- endif %}

# RSL
# -------------------------------------------------------------------------
Expand Down Expand Up @@ -901,7 +905,7 @@ spec:
- name: aiservice_watsonxai_on_prem
value: "{{ aiservice_watsonxai_on_prem }}"

# AI Service - watsonX
# AI Service - Certificate Issuer
# -------------------------------------------------------------------------
{%- if aiservice_certificate_issuer is defined and aiservice_certificate_issuer != "" %}
- name: aiservice_certificate_issuer
Expand Down Expand Up @@ -944,3 +948,9 @@ spec:
- name: shared-certificates
secret:
secretName: pipeline-certificates

# AI Service configurations
# -------------------------------------------------------------------------
- name: shared-aiservice-config
secret:
secretName: pipeline-aiservice-config
Loading