This repository defines the automated redaction that is available to PINS services.
├── redaction-system/ // The redaction-system folder can be in a directory of your choice
│ ├── redactor/ // Where the redaction tool is defined
│ │ ├── core/ // Where the core functionality of the tool is defined
│ │ │ ├── config/ // Where config files for redaction are defined
│ │ │ ├── io/ // Where functionality for reading/writing files is defined
│ │ │ ├── util/ // Where misc utility functionality is defined
│ │ │ ├── redaction/ // Where functionality for redaction processes is defined
│ │ │ │ ├── redactor.py // Where scripts for redacting pieces of data are defined. *Files are composed of data
│ │ │ │ ├── file_processor.py // Module for redacting files
│ │ │ │ ├── config_processor.py // Module for processing config files
│ │ │ │ ├── main.py // Script for executing the redaction process via terminal for a file
│ │ │ │ ├── config.py // Redaction config classes
│ │ │ │ ├── result.py // Redaction result classes
│ │ │ │ ├── exceptions.py // Custom exceptions
│ │ ├── test/ // Tests
│ │ │ ├── unit_test/ // Unit tests
│ │ │ ├── integration_test/ // Integration tests
│ │ │ ├── e2e_test/ // End-to-end tests
│ │ │ ├── resources/ // Resources for tests
│ ├── pipelines/
│ │ ├── jobs/ // Where pipeline jobs are defined
│ │ ├── steps/ // Where pipeline steps are defined
│ │ └── scripts/ // Utility python/bash scripts are defined here
│ ├── infrastructure/
│ │ └── environments/ // Utility python/bash scripts are defined here
- Create a
.envfile in the project's root directory- Set the content of the env file based on the
Environment variablessection of the readme
- Set the content of the env file based on the
- Install Python 3.13
- Create a virtual environment
- Install the requirements using
python3 -m pip install -r redactor/requirements.txt - You may need to run the below command to set up your Python environment
export PYTHONPATH="${PYTHONPATH}:/./"
- Run specific Python files using
python3 path/to/file/to/run.py- NOTE: Currently the redaction process can be run using
redactor/core/main.py, more info cam be found within this file
- NOTE: Currently the redaction process can be run using
- Install the core functions tools https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=macos%2Cisolated-process%2Cnode-v4%2Cpython-v2%2Chttp-trigger%2Ccontainer-apps&pivots=programming-language-python
- run
func start - You can then connect to the function via http requests, or via the Azure portal
Below are the environment variables used by the project
| Variable | Description |
|---|---|
| OPENAI_ENDPOINT | The Open AI host. For example: "https://myazurefoundryresource.openai.azure.com/" |
- Be connected to the PINS VPN (required for cloud-backed E2E/perf and Azure Storage access).
- Be logged into Azure CLI (
az login) and using the expected subscription. - Ensure
.envin repo root contains E2E values (E2E_STORAGE_ACCOUNT,E2E_CONTAINER_NAME, etc.). - Install local runtime tools: Azure Functions Core Tools (
func) and Azurite (azurite).
- Start local services:
make run
- In another terminal, run E2E:
make e2e
- Run perf tests:
make perf
Optional perf tuning:
PERF_TOTAL=20 PERF_CONCURRENCY=5 PERF_TIMEOUT_S=1200 make perf