Skip to content
Open
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ Documentation
Want to contribute to MAS Command Line Interface?
-------------------------------------------------------------------------------
We welcome every Maximo Application Suite users, developers and enthusiasts to contribute to the MAS Command Line Interface while fixing code issues and implementing new automated functionalities.
You can contribute to this collection by raising [a new issue](https://github.com/ibm-mas/cli/issues) with suggestions on how to make our MAS automation engine even better, or if you want to become a new code contributor, please refer to the [Contributing Guidelines](CONTRIBUTING.md) and learn more about how to get started.
You can contribute to this collection by raising [a new issue](https://github.com/ibm-mas/cli/issues) with suggestions on how to make our MAS automation engine even better, or if you want to become a new code contributor, please refer to the [Contributing Guidelines](CONTRIBUTING.md) and learn more about how to get started.
10 changes: 6 additions & 4 deletions image/cli/app-root/src/run-playbook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ if [ -n "$SLACK_TOKEN" ] && [ -n "$SLACK_CHANNEL" ]; then
--action ansible-start \
--task-name "$DEVOPS_SUITE_NAME" \
--pipeline-name "${PIPELINERUN_NAME:-unknown}" \
--instance-id "${DEVOPS_ENVIRONMENT:-}" || true
echo "# ----------------- Sending Start Notification Suite: $DEVOPS_SUITE_NAME | pipeline: $PIPELINE_NAME($PIPELINERUN_NAME) | Instance id: $DEVOPS_ENVIRONMENT -------------------- #"
--instance-id "${DEVOPS_ENVIRONMENT:-}" \
--namespace "${PIPELINE_NAMESPACE:-}" || true
echo "# ----------------- Sending Start Notification Suite: $DEVOPS_SUITE_NAME | pipeline: $PIPELINE_NAME($PIPELINERUN_NAME) | Instance id: $DEVOPS_ENVIRONMENT -------------------- #"
fi

ansible-playbook ibm.mas_devops."$@"
Expand All @@ -39,8 +40,9 @@ if [ -n "$SLACK_TOKEN" ] && [ -n "$SLACK_CHANNEL" ]; then
--rc $rc \
--task-name "$DEVOPS_SUITE_NAME" \
--pipeline-name "${PIPELINERUN_NAME:-unknown}" \
--instance-id "${DEVOPS_ENVIRONMENT:-}" || true
echo "# ----------------- Sending Start Notification Suite: $DEVOPS_SUITE_NAME | pipeline: $PIPELINE_NAME($PIPELINERUN_NAME) | Instance id: $DEVOPS_ENVIRONMENT -------------------- #"
--instance-id "${DEVOPS_ENVIRONMENT:-}" \
--namespace "${PIPELINE_NAMESPACE:-}" || true
echo "# ----------------- Sending Start Notification Suite: $DEVOPS_SUITE_NAME | pipeline: $PIPELINE_NAME($PIPELINERUN_NAME) | Instance id: $DEVOPS_ENVIRONMENT -------------------- #"
fi

python3 /opt/app-root/src/save-junit-to-mongo.py
Expand Down
7 changes: 4 additions & 3 deletions image/cli/app-root/src/run-role.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ python3 /opt/app-root/src/register-start.py

export ROLE_NAME=$1
shift

# Send Slack start notification if configured
if [ -n "$SLACK_TOKEN" ] && [ -n "$SLACK_CHANNEL" ]; then
python3 /opt/app-root/bin/mas-devops-notify-slack \
--action ansible-start \
--task-name "$DEVOPS_SUITE_NAME" \
--pipeline-name "${PIPELINERUN_NAME:-unknown}" \
--instance-id "${DEVOPS_ENVIRONMENT:-}" || true
--instance-id "${DEVOPS_ENVIRONMENT:-}" \
--namespace "${PIPELINE_NAMESPACE:-}" || true
echo "# ----------------- Sending Start Notification Suite: $DEVOPS_SUITE_NAME | pipeline: $PIPELINE_NAME($PIPELINERUN_NAME) | Instance id: $DEVOPS_ENVIRONMENT -------------------- #"
fi

Expand All @@ -36,7 +36,8 @@ if [ -n "$SLACK_TOKEN" ] && [ -n "$SLACK_CHANNEL" ]; then
--rc $rc \
--task-name "$DEVOPS_SUITE_NAME" \
--pipeline-name "${PIPELINERUN_NAME:-unknown}" \
--instance-id "${DEVOPS_ENVIRONMENT:-}" || true
--instance-id "${DEVOPS_ENVIRONMENT:-}" \
--namespace "${PIPELINE_NAMESPACE:-}" || true
echo "# ----------------- Sending Stop Notification Suite: $DEVOPS_SUITE_NAME | pipeline: $PIPELINE_NAME($PIPELINERUN_NAME) | Instance id: $DEVOPS_ENVIRONMENT -------------------- #"
fi

Expand Down
8 changes: 0 additions & 8 deletions python/src/mas/cli/aiservice/install/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
from mas.devops.tekton import (
installOpenShiftPipelines,
updateTektonDefinitions,
prepareAiServicePipelinesNamespace,
prepareInstallSecrets,
testCLI,
launchInstallPipeline
Expand Down Expand Up @@ -582,13 +581,6 @@ def install(self, argv):

with Halo(text=f'Preparing namespace ({pipelinesNamespace})', spinner=self.spinner) as h:
createNamespace(self.dynamicClient, pipelinesNamespace)
prepareAiServicePipelinesNamespace(
dynClient=self.dynamicClient,
instanceId=self.getParam("aiservice_instance_id"),
storageClass=self.pipelineStorageClass,
accessMode=self.pipelineStorageAccessMode,
configureRBAC=(self.getParam("service_account_name") == "")
)
prepareInstallSecrets(
dynClient=self.dynamicClient,
namespace=pipelinesNamespace,
Expand Down
12 changes: 12 additions & 0 deletions python/src/mas/cli/aiservice/install/argParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,18 @@ def isValidFile(parser, arg) -> str:
required=False,
help="Run the install pipeline under a custom service account (also disables creation of the default 'pipeline' service account)",
)
otherArgGroup.add_argument(
"--slack-token",
dest="slack_token",
required=False,
help="Slack bot token for sending pipeline notifications"
)
otherArgGroup.add_argument(
"--slack-channel",
dest="slack_channel",
required=False,
help="Slack channel(s) for notifications (comma-separated for multiple channels)"
)

otherArgGroup.add_argument(
"-h", "--help",
Expand Down
1 change: 1 addition & 0 deletions python/src/mas/cli/aiservice/install/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"rsl_token",
"rsl_ca_crt",
"environment_type",
"configure_aiassistant",

# Certificate Issuer
"aiservice_certificate_issuer",
Expand Down
12 changes: 12 additions & 0 deletions python/src/mas/cli/aiservice/upgrade/argParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@
default=False,
help="Configure upgrade for development mode",
)
otherArgGroup.add_argument(
"--slack-token",
dest="slack_token",
required=False,
help="Slack bot token for sending pipeline notifications"
)
otherArgGroup.add_argument(
"--slack-channel",
dest="slack_channel",
required=False,
help="Slack channel(s) for notifications (comma-separated for multiple channels)"
)
otherArgGroup.add_argument(
'-h', "--help",
action='help',
Expand Down
9 changes: 8 additions & 1 deletion python/src/mas/cli/install/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1880,7 +1880,14 @@ def nonInteractiveMode(self) -> None:
self.setParam("manage_bind_aiservice_tenant_id", "user")
elif key == "configure_aiassistant":
if value is not None and value != "":
self.setParam("configure_aiassistant", value)
# Convert boolean-like values to "pipeline" or "none"
if value in ["true", "True", "TRUE", "1", "yes", "Yes", "YES"]:
self.setParam("configure_aiassistant", "pipeline")
elif value in ["false", "False", "FALSE", "0", "no", "No", "NO"]:
self.setParam("configure_aiassistant", "none")
else:
# Use the value as-is (should be "pipeline", "none", or "configure")
self.setParam("configure_aiassistant", value)
elif key == "manage_bind_aiservice_instance_id":
# only set if AI Service not being installed
if not vars(self.args).get("aiservice_instance_id") and value is not None and value != "":
Expand Down
2 changes: 2 additions & 0 deletions python/src/mas/cli/install/argBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ def buildCommand(self) -> str:
command += f" --facilities-channel \"{self.getParam('mas_app_channel_facilities')}\"{newline}"
if self.installAIService:
command += f" --aiservice-channel \"{self.getParam('aiservice_channel')}\"{newline}"
if self.getParam('configure_aiassistant') != "":
command += f" --configure-aiassistant \"{self.getParam('configure_aiassistant')}\"{newline}"

# Arcgis
# -----------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions python/src/mas/cli/install/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@
"rsl_token",
"rsl_ca_crt",
"environment_type",
"configure_aiassistant",

# Certificate Issuer
"aiservice_certificate_issuer",
Expand Down
1 change: 1 addition & 0 deletions python/src/mas/cli/mirror/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

("Optional Dependencies", "aiservice", "ibm-aiservice", "aiservice_version"),
("Optional Dependencies", "aiservice", "ibm-aiservice-tenant", "aiservice_version"),
("Optional Dependencies", "odh", "opendatahub", "odh_version"),

("Optional Dependencies", "data-dictionary", "ibm-data-dictionary", "dd_version"),

Expand Down
3 changes: 0 additions & 3 deletions python/test/aiservice/install/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def test_install_noninteractive(tmpdir):
mock.patch('mas.cli.aiservice.install.app.getCurrentCatalog') as get_current_catalog,
mock.patch('mas.cli.aiservice.install.app.installOpenShiftPipelines'),
mock.patch('mas.cli.aiservice.install.app.updateTektonDefinitions'),
mock.patch('mas.cli.aiservice.install.app.prepareAiServicePipelinesNamespace'),
mock.patch('mas.cli.aiservice.install.app.launchInstallPipeline') as launch_ai_service_install_pipeline
):
dynamic_client_class.return_value = dynamic_client
Expand Down Expand Up @@ -148,7 +147,6 @@ def test_install_interactive_advanced(tmpdir):
mock.patch('mas.cli.aiservice.install.app.getCurrentCatalog') as get_current_catalog,
mock.patch('mas.cli.aiservice.install.app.installOpenShiftPipelines'),
mock.patch('mas.cli.aiservice.install.app.updateTektonDefinitions'),
mock.patch('mas.cli.aiservice.install.app.prepareAiServicePipelinesNamespace'),
mock.patch('mas.cli.aiservice.install.app.launchInstallPipeline') as launch_ai_service_install_pipeline,
mock.patch('mas.cli.cli.isSNO') as is_sno,
mock.patch('mas.cli.displayMixins.prompt') as mixins_prompt,
Expand Down Expand Up @@ -278,7 +276,6 @@ def test_install_interactive_simplified(tmpdir):
mock.patch('mas.cli.aiservice.install.app.getCurrentCatalog') as get_current_catalog,
mock.patch('mas.cli.aiservice.install.app.installOpenShiftPipelines'),
mock.patch('mas.cli.aiservice.install.app.updateTektonDefinitions'),
mock.patch('mas.cli.aiservice.install.app.prepareAiServicePipelinesNamespace'),
mock.patch('mas.cli.aiservice.install.app.launchInstallPipeline') as launch_ai_service_install_pipeline,
mock.patch('mas.cli.cli.isSNO') as is_sno,
mock.patch('mas.cli.displayMixins.prompt') as mixins_prompt,
Expand Down
3 changes: 0 additions & 3 deletions python/test/utils/install_test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,9 @@ def run_install_test(self):
from mas.cli.aiservice.install.app import AiServiceInstallApp
app_class = AiServiceInstallApp
app_module = 'mas.cli.aiservice.install.app'
prepare_namespace_func = 'prepareAiServicePipelinesNamespace'
else:
app_class = InstallApp
app_module = 'mas.cli.install.app'
prepare_namespace_func = 'preparePipelinesNamespace'

self.setup_test_files()
self.start_watchdog()
Expand All @@ -305,7 +303,6 @@ def run_install_test(self):
mock.patch(f'{app_module}.installOpenShiftPipelines'),
mock.patch(f'{app_module}.updateTektonDefinitions'),
mock.patch(f'{app_module}.createNamespace'),
mock.patch(f'{app_module}.{prepare_namespace_func}'),
mock.patch(f'{app_module}.launchInstallPipeline') as launch_install_pipeline,
mock.patch('mas.cli.install.app.configureIngressForPathBasedRouting') as configure_ingress,
mock.patch('mas.cli.cli.isSNO') as is_sno,
Expand Down
1 change: 1 addition & 0 deletions python/test/utils/mirror_test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def setup_mocks(self):
'db2u_version': '11.5.9.0+123',
'amlen_extras_version': '1.0.0',
'aiservice_version': {'9.1.x': '1.0.0'},
'odh_version': '2.32.0',
'dd_version': '1.0.0',
'mongo_extras_version_default': '6.0.0',
'couchdb_version': '1.0.13',
Expand Down
6 changes: 5 additions & 1 deletion tekton/src/params/install-aiservice.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
type: string
description: Environment type
default: ""
- name: configure_aiassistant
type: string
description: Configure AI Assistant integration
default: ""

# MAS Application Configuration - IBM Maximo AI Service - S3
# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -172,4 +176,4 @@
- name: aiservice_certificate_issuer
type: string
description: Name of the Issuer to configure AI Service to issue certificates
default: ""
default: ""
3 changes: 3 additions & 0 deletions tekton/src/pipelines/mas-install.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,9 @@ spec:
- input: "$(params.aiservice_channel)"
operator: notin
values: [""]
- input: "$(params.configure_aiassistant)"
operator: in
values: ["pipeline"]

# 15. Verify health of the cluster before we consider the install complete
# -------------------------------------------------------------------------
Expand Down
Loading