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
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
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
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
Loading