Skip to content

Commit cb26ac0

Browse files
committed
remove ansible-risk-insight (ari)
1 parent 5a109bc commit cb26ac0

Some content is hidden

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

43 files changed

+80
-1005
lines changed

.github/workflows/Build_Push_Image.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,6 @@ jobs:
4141
echo "sha-short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
4242
echo "sha-long=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
4343
44-
- name: Retrieve ari knowledge base from s3
45-
run: |
46-
aws s3 cp --only-show-errors --recursive ${KB_ARI_PATH}/data ari/kb/data
47-
aws s3 cp --only-show-errors --recursive ${KB_ARI_PATH}/rules ari/kb/rules
48-
env:
49-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
50-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
51-
AWS_DEFAULT_REGION: us-east-1
52-
KB_ARI_PATH: ${{ secrets.KB_ARI_PATH }}
53-
5444
- name: Free space on build machine
5545
run: |
5646
rm -rf /opt/hostedtoolcache/Java*

.github/workflows/code_coverage.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ jobs:
2020
ANSIBLE_AI_DATABASE_NAME: wisdom
2121
ANSIBLE_AI_DATABASE_PASSWORD: wisdom
2222
ANSIBLE_AI_DATABASE_USER: wisdom
23-
ARI_KB_PATH: /etc/ari/kb/
2423
DJANGO_SETTINGS_MODULE: ansible_ai_connect.main.settings.development
25-
ENABLE_ARI_POSTPROCESS: False
2624
ENABLE_ANSIBLE_LINT_POSTPROCESS: True
2725
PYTHONUNBUFFERED: 1
2826
SECRET_KEY: somesecret
@@ -59,18 +57,6 @@ jobs:
5957
pip install -r requirements-dev.txt
6058
pip install .
6159
62-
- name: Retrieve ari knowledge base from s3
63-
run: |
64-
sudo mkdir -p /etc/ari/kb
65-
sudo chown -R $USER:$USER /etc/ari/kb
66-
aws s3 cp --only-show-errors --recursive ${KB_ARI_PATH}/data /etc/ari/kb/data
67-
aws s3 cp --only-show-errors --recursive ${KB_ARI_PATH}/rules /etc/ari/kb/rules
68-
env:
69-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
70-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
71-
AWS_DEFAULT_REGION: us-east-1
72-
KB_ARI_PATH: ${{ secrets.KB_ARI_PATH }}
73-
7460
- name: Create CA symlink to use RH's certifi on ubuntu-latest
7561
run: |
7662
sudo mkdir -p /etc/pki/tls/certs

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ ifeq ($(ENVIRONMENT),development)
2121
export ANSIBLE_AI_DATABASE_NAME := wisdom
2222
export ANSIBLE_AI_DATABASE_PASSWORD := wisdom
2323
export ANSIBLE_AI_DATABASE_USER := wisdom
24-
export ARI_KB_PATH := ../ari/kb/
2524
export DJANGO_SETTINGS_MODULE := ansible_ai_connect.main.settings.development
26-
export ENABLE_ARI_POSTPROCESS := False
2725
export PYTHONUNBUFFERED := 1
2826
export SECRET_KEY := somesecret
2927
export DJANGO_SUPERUSER_PASSWORD := somesecret

README.md

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ Populate the `tools/docker-compose/.env` file with the following values:
2323
```bash
2424
DEPLOYMENT_MODE="upstream"
2525
SECRET_KEY="somesecretvalue"
26-
ENABLE_ARI_POSTPROCESS="False"
2726
WCA_SECRET_BACKEND_TYPE="dummy"
2827
# configure model server
2928
ANSIBLE_AI_MODEL_MESH_CONFIG="..."
@@ -350,41 +349,6 @@ To get an authentication token without logging in via GitHub, you also:
350349

351350
To test the API with no authentication, you can empty out `REST_FRAMEWORK.DEFAULT_PERMISSION_CLASSES` in base.py.
352351

353-
## Enabling postprocess with ARI
354-
355-
You can enable postprocess with [Ansible Risk Insight (ARI)](https://github.com/ansible/ansible-risk-insight) for
356-
improving the completion output just by following these 2 steps below.
357-
358-
1. Set the environment variable `ENABLE_ARI_POSTPROCESS` to True
359-
360-
```bash
361-
$ export ENABLE_ARI_POSTPROCESS=True
362-
```
363-
364-
365-
2. Prepare `rules` and `data` directory inside `ari/kb` directory.
366-
367-
`rules` should contain mutation rules for the postprocess, you can refer
368-
to [here](https://github.com/ansible/ari-metrics-for-wisdom/tree/main/rules) for some examples.
369-
370-
`data` should contain the backend data for ARI. We will host this data somewhere in the future, but currently this
371-
file must be placed manually if you want to enable the postprocess.
372-
373-
Once the files are ready, the `ari/kb` directory should look like this.
374-
375-
```bash
376-
ari/kb/
377-
├── data
378-
│   ├── collections
379-
│   └── indices
380-
└── rules
381-
├── W001_module_name_metrics.py
382-
├── W002_module_key_metrics.py
383-
├── ...
384-
```
385-
386-
Then you can build the django image or just run `make docker-compose`.
387-
388352
## Enabling postprocess with Ansible Lint
389353

390354
You can enable postprocess with [Ansible Lint](https://github.com/ansible/ansible-lint) for improving the completion output just by setting the environment variable `ENABLE_ANSIBLE_LINT_POSTPROCESS` to True
@@ -460,7 +424,6 @@ To connect to the Mistal 7b Instruct model running on locally on [llama.cpp](htt
460424
1. Set the appropriate environment variables
461425
```bash
462426
ANSIBLE_AI_MODEL_MESH_CONFIG="..."
463-
ENABLE_ARI_POSTPROCESS=False
464427
```
465428
See the example [ANSIBLE_AI_MODEL_MESH_CONFIG](./docs/config/examples/README-ANSIBLE_AI_MODEL_MESH_CONFIG.md).
466429

@@ -522,17 +485,11 @@ ANSIBLE_AI_DATABASE_HOST=localhost
522485
ANSIBLE_AI_DATABASE_NAME=wisdom
523486
ANSIBLE_AI_DATABASE_PASSWORD=wisdom
524487
ANSIBLE_AI_DATABASE_USER=wisdom
525-
ARI_KB_PATH=../ari/kb/
526488
DJANGO_SETTINGS_MODULE=ansible_wisdom.main.settings.development
527-
ENABLE_ARI_POSTPROCESS=True
528489
PYTHONUNBUFFERED=1
529490
SECRET_KEY=somesecret
530491
```
531492

532-
Note that this `.env` file assumes that the Django
533-
service is executed in the `ansible_wisdom` subdirectory
534-
as `ARI_KB_PATH` is defined as `../ari/kb`.
535-
536493
It is recommended to use `make` to run unit tests since it helps to configure default values.
537494
If you want to execute only specific file/class/method you can use $WISDOM_TEST variable:
538495

@@ -611,20 +568,12 @@ E.g:
611568

612569
If you get a permission denied error when attempting to start the
613570
containers, you may need to set the permissions on the
614-
`ansible_wisdom/`, `prometheus/` and `ari/` directories:
571+
`ansible_wisdom/` and `prometheus/` directories:
615572

616573
```bash
617574
chcon -t container_file_t -R ansible_wisdom/
618575
chcon -t container_file_t -R prometheus/
619576
chcon -t container_file_t -R grafana/
620-
chcon -t container_file_t -R ari/
621-
```
622-
623-
Also run `chmod` against the `ari/` directory so that ARI can
624-
write temporary data in it:
625-
626-
```bash
627-
chmod -R 777 ari/
628577
```
629578

630579
If your django container build fails with the following error, you've

ansible_ai_connect/ai/api/model_pipelines/http/tests/test_ssl_manager_integration.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ def setUp(self):
9292
retry_count=3,
9393
api_key="test-api-key",
9494
enable_health_check=True,
95-
enable_ari_postprocessing=False,
9695
health_check_api_key="test-health-key",
9796
health_check_model_id="test-health-model",
9897
username="test-user",
@@ -122,7 +121,6 @@ def test_wca_pipeline_ssl_disabled(self):
122121
retry_count=3,
123122
api_key="test-api-key",
124123
enable_health_check=True,
125-
enable_ari_postprocessing=False,
126124
health_check_api_key="test-health-key",
127125
health_check_model_id="test-health-model",
128126
username="test-user",

ansible_ai_connect/ai/api/model_pipelines/pipelines.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from typing import Any, Dict, Generic, Optional
1818

1919
from attrs import define, field
20-
from django.conf import settings
2120
from django.http import StreamingHttpResponse
2221
from rest_framework import serializers
2322
from rest_framework.request import Request
@@ -306,9 +305,6 @@ def __init__(self, config: PIPELINE_CONFIGURATION):
306305
def get_model_id(self, user, requested_model_id: Optional[str] = None) -> str:
307306
return requested_model_id or self.config.model_id
308307

309-
def supports_ari_postprocessing(self):
310-
return settings.ENABLE_ARI_POSTPROCESS
311-
312308

313309
class ModelPipeline(
314310
MetaData[PIPELINE_CONFIGURATION],

ansible_ai_connect/ai/api/model_pipelines/tests/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ def mock_pipeline_config(pipeline_provider: t_model_mesh_api_type, **kwargs):
117117
enable_health_check=extract("enable_health_check", False, **kwargs),
118118
verify_ssl=extract("verify_ssl", False, **kwargs),
119119
retry_count=extract("retry_count", 4, **kwargs),
120-
enable_ari_postprocessing=extract("enable_ari_postprocessing", False, **kwargs),
121120
health_check_api_key=extract(
122121
"health_check_api_key", "a-healthcheck-api-key", **kwargs
123122
),
@@ -144,7 +143,6 @@ def mock_pipeline_config(pipeline_provider: t_model_mesh_api_type, **kwargs):
144143
enable_health_check=extract("enable_health_check", False, **kwargs),
145144
verify_ssl=extract("verify_ssl", False, **kwargs),
146145
retry_count=extract("retry_count", 4, **kwargs),
147-
enable_ari_postprocessing=extract("enable_ari_postprocessing", False, **kwargs),
148146
health_check_api_key=extract(
149147
"health_check_api_key", "a-healthcheck-api-key", **kwargs
150148
),

ansible_ai_connect/ai/api/model_pipelines/tests/test_wca_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ def test_infer_wca_validation_failure(self):
11281128
"scope": "ibm openid",
11291129
}
11301130
response = MockResponse(
1131-
json={"detail": "ARI processing failed"},
1131+
json={"detail": "Validation failed"},
11321132
status_code=422,
11331133
headers={"Content-Type": "application/json"},
11341134
)
@@ -1150,7 +1150,7 @@ def test_infer_wca_validation_failure(self):
11501150
self.assertEqual(e.exception.model_id, model_id)
11511151
self.assertInLog(
11521152
"WCA request failed with 422. Content-Type:application/json, "
1153-
'Content:b\'{"detail": "ARI processing failed"}\'',
1153+
'Content:b\'{"detail": "Validation failed"}\'',
11541154
log,
11551155
)
11561156

ansible_ai_connect/ai/api/model_pipelines/wca/configuration_base.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
# ENABLE_HEALTHCHECK_XXX
3434
# ANSIBLE_AI_MODEL_MESH_API_VERIFY_SSL
3535
# ANSIBLE_WCA_RETRY_COUNT
36-
# WCA_ENABLE_ARI_POSTPROCESS
3736
# ANSIBLE_WCA_HEALTHCHECK_API_KEY
3837
# ANSIBLE_WCA_HEALTHCHECK_MODEL_ID
3938

@@ -49,7 +48,6 @@ def __init__(
4948
enable_health_check: Optional[bool],
5049
verify_ssl: bool,
5150
retry_count: int,
52-
enable_ari_postprocessing: bool,
5351
health_check_api_key: str,
5452
health_check_model_id: str,
5553
enable_anonymization: bool,
@@ -58,15 +56,13 @@ def __init__(
5856
self.api_key = api_key
5957
self.verify_ssl = verify_ssl
6058
self.retry_count = retry_count
61-
self.enable_ari_postprocessing = enable_ari_postprocessing
6259
self.health_check_api_key = health_check_api_key
6360
self.health_check_model_id = health_check_model_id
6461
self.enable_anonymization = enable_anonymization
6562

6663
api_key: str
6764
verify_ssl: bool
6865
retry_count: int
69-
enable_ari_postprocessing: bool
7066
health_check_url: str
7167
health_check_model_id: str
7268

@@ -81,7 +77,6 @@ class WCABaseConfigurationSerializer(BaseConfigSerializer):
8177
api_key = serializers.CharField(required=False, allow_null=True, allow_blank=True)
8278
verify_ssl = serializers.BooleanField(required=False, default=True)
8379
retry_count = serializers.IntegerField(required=False, default=4)
84-
enable_ari_postprocessing = serializers.BooleanField(required=False, default=False)
8580
health_check_api_key = serializers.CharField(required=True)
8681
health_check_model_id = serializers.CharField(required=True)
8782
enable_anonymization = serializers.BooleanField(required=False, default=True)

ansible_ai_connect/ai/api/model_pipelines/wca/configuration_onprem.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
# ENABLE_HEALTHCHECK_XXX
3232
# ANSIBLE_AI_MODEL_MESH_API_VERIFY_SSL
3333
# ANSIBLE_WCA_RETRY_COUNT
34-
# WCA_ENABLE_ARI_POSTPROCESS
3534
# ANSIBLE_WCA_HEALTHCHECK_API_KEY
3635
# ANSIBLE_WCA_HEALTHCHECK_MODEL_ID
3736

@@ -51,7 +50,6 @@ def __init__(
5150
enable_health_check: Optional[bool],
5251
verify_ssl: bool,
5352
retry_count: int,
54-
enable_ari_postprocessing: bool,
5553
health_check_api_key: str,
5654
health_check_model_id: str,
5755
username: str,
@@ -65,7 +63,6 @@ def __init__(
6563
enable_health_check,
6664
verify_ssl,
6765
retry_count,
68-
enable_ari_postprocessing,
6966
health_check_api_key,
7067
health_check_model_id,
7168
enable_anonymization,
@@ -90,7 +87,6 @@ def __init__(self, **kwargs):
9087
enable_health_check=kwargs["enable_health_check"],
9188
verify_ssl=kwargs["verify_ssl"],
9289
retry_count=kwargs["retry_count"],
93-
enable_ari_postprocessing=kwargs["enable_ari_postprocessing"],
9490
health_check_api_key=kwargs["health_check_api_key"],
9591
health_check_model_id=kwargs["health_check_model_id"],
9692
username=kwargs["username"],

0 commit comments

Comments
 (0)