agentops-accelerator 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentops/__init__.py +10 -0
- agentops/__main__.py +6 -0
- agentops/agent/__init__.py +12 -0
- agentops/agent/_legacy_ids.py +92 -0
- agentops/agent/analyzer.py +207 -0
- agentops/agent/checks/__init__.py +1 -0
- agentops/agent/checks/catalog.py +880 -0
- agentops/agent/checks/errors.py +279 -0
- agentops/agent/checks/foundry_config.py +75 -0
- agentops/agent/checks/latency.py +84 -0
- agentops/agent/checks/opex.py +157 -0
- agentops/agent/checks/opex_workspace.py +874 -0
- agentops/agent/checks/posture.py +36 -0
- agentops/agent/checks/posture_rules/__init__.py +53 -0
- agentops/agent/checks/posture_rules/content_filter.py +59 -0
- agentops/agent/checks/posture_rules/diagnostics.py +74 -0
- agentops/agent/checks/posture_rules/local_auth.py +55 -0
- agentops/agent/checks/posture_rules/managed_identity.py +59 -0
- agentops/agent/checks/posture_rules/network.py +68 -0
- agentops/agent/checks/regression.py +78 -0
- agentops/agent/checks/release_readiness.py +182 -0
- agentops/agent/checks/safety.py +247 -0
- agentops/agent/checks/spec_conformance.py +375 -0
- agentops/agent/cockpit.py +5159 -0
- agentops/agent/config.py +240 -0
- agentops/agent/findings.py +113 -0
- agentops/agent/history.py +142 -0
- agentops/agent/knowledge/__init__.py +182 -0
- agentops/agent/knowledge/waf-checklist.csv +39 -0
- agentops/agent/llm_assist/__init__.py +16 -0
- agentops/agent/llm_assist/_base.py +124 -0
- agentops/agent/llm_assist/_bundle_rule.py +154 -0
- agentops/agent/llm_assist/_client.py +347 -0
- agentops/agent/llm_assist/_dataset_rules.py +191 -0
- agentops/agent/llm_assist/_engine.py +106 -0
- agentops/agent/llm_assist/_prompt_rules.py +291 -0
- agentops/agent/llm_assist/_spec_rules.py +235 -0
- agentops/agent/production_telemetry.py +430 -0
- agentops/agent/report.py +207 -0
- agentops/agent/server/__init__.py +1 -0
- agentops/agent/server/app.py +84 -0
- agentops/agent/server/auth.py +94 -0
- agentops/agent/server/chat.py +44 -0
- agentops/agent/server/protocol.py +72 -0
- agentops/agent/sources/__init__.py +1 -0
- agentops/agent/sources/azure_monitor.py +523 -0
- agentops/agent/sources/azure_resources.py +602 -0
- agentops/agent/sources/foundry_control.py +174 -0
- agentops/agent/sources/results_history.py +494 -0
- agentops/agent/sources/spec_detectors/__init__.py +42 -0
- agentops/agent/sources/spec_detectors/_base.py +58 -0
- agentops/agent/sources/spec_detectors/agents_md.py +75 -0
- agentops/agent/sources/spec_detectors/spec_kit.py +172 -0
- agentops/agent/time_range.py +117 -0
- agentops/cli/__init__.py +1 -0
- agentops/cli/app.py +4823 -0
- agentops/core/__init__.py +1 -0
- agentops/core/agentops_config.py +592 -0
- agentops/core/config_loader.py +22 -0
- agentops/core/evaluators.py +480 -0
- agentops/core/release_evidence.py +56 -0
- agentops/core/results.py +117 -0
- agentops/mcp/__init__.py +10 -0
- agentops/mcp/server.py +232 -0
- agentops/pipeline/__init__.py +8 -0
- agentops/pipeline/cloud_results.py +189 -0
- agentops/pipeline/cloud_runner.py +901 -0
- agentops/pipeline/comparison.py +108 -0
- agentops/pipeline/diagnostics.py +51 -0
- agentops/pipeline/invocations.py +535 -0
- agentops/pipeline/official_eval.py +414 -0
- agentops/pipeline/orchestrator.py +775 -0
- agentops/pipeline/prompt_deploy.py +377 -0
- agentops/pipeline/publisher.py +121 -0
- agentops/pipeline/reporter.py +202 -0
- agentops/pipeline/runtime.py +409 -0
- agentops/pipeline/thresholds.py +84 -0
- agentops/services/__init__.py +1 -0
- agentops/services/cicd.py +720 -0
- agentops/services/eval_analysis.py +848 -0
- agentops/services/evidence_pack.py +757 -0
- agentops/services/initializer.py +86 -0
- agentops/services/preflight.py +470 -0
- agentops/services/setup_wizard.py +709 -0
- agentops/services/skills.py +643 -0
- agentops/services/trace_promotion.py +300 -0
- agentops/services/workflow_analysis.py +1129 -0
- agentops/templates/.gitignore +15 -0
- agentops/templates/__init__.py +1 -0
- agentops/templates/agent-server/Dockerfile +23 -0
- agentops/templates/agent-server/README.md +61 -0
- agentops/templates/agent-server/main.bicep +94 -0
- agentops/templates/agent.yaml +87 -0
- agentops/templates/agentops.yaml +58 -0
- agentops/templates/foundry.svg +71 -0
- agentops/templates/icon.png +0 -0
- agentops/templates/pipelines/azuredevops/agentops-deploy-dev-azd.yml +118 -0
- agentops/templates/pipelines/azuredevops/agentops-deploy-dev.yml +73 -0
- agentops/templates/pipelines/azuredevops/agentops-deploy-prod-azd.yml +141 -0
- agentops/templates/pipelines/azuredevops/agentops-deploy-prod.yml +94 -0
- agentops/templates/pipelines/azuredevops/agentops-deploy-prompt-agent.yml +167 -0
- agentops/templates/pipelines/azuredevops/agentops-deploy-qa-azd.yml +118 -0
- agentops/templates/pipelines/azuredevops/agentops-deploy-qa.yml +68 -0
- agentops/templates/pipelines/azuredevops/agentops-pr-prompt-agent.yml +210 -0
- agentops/templates/pipelines/azuredevops/agentops-pr.yml +155 -0
- agentops/templates/pipelines/azuredevops/agentops-watchdog.yml +106 -0
- agentops/templates/project.gitignore +36 -0
- agentops/templates/sample-traces.jsonl +3 -0
- agentops/templates/skills/agentops-agent/SKILL.md +137 -0
- agentops/templates/skills/agentops-config/SKILL.md +113 -0
- agentops/templates/skills/agentops-dataset/SKILL.md +84 -0
- agentops/templates/skills/agentops-eval/SKILL.md +189 -0
- agentops/templates/skills/agentops-report/SKILL.md +71 -0
- agentops/templates/skills/agentops-workflow/SKILL.md +471 -0
- agentops/templates/smoke.jsonl +3 -0
- agentops/templates/waf-checklist.README.md +84 -0
- agentops/templates/waf-checklist.csv +22 -0
- agentops/templates/workflows/agentops-deploy-dev-azd.yml +166 -0
- agentops/templates/workflows/agentops-deploy-dev.yml +187 -0
- agentops/templates/workflows/agentops-deploy-prod-azd.yml +183 -0
- agentops/templates/workflows/agentops-deploy-prod.yml +171 -0
- agentops/templates/workflows/agentops-deploy-prompt-agent.yml +197 -0
- agentops/templates/workflows/agentops-deploy-qa-azd.yml +156 -0
- agentops/templates/workflows/agentops-deploy-qa.yml +145 -0
- agentops/templates/workflows/agentops-pr-prompt-agent.yml +210 -0
- agentops/templates/workflows/agentops-pr.yml +148 -0
- agentops/templates/workflows/agentops-watchdog.yml +122 -0
- agentops/utils/__init__.py +1 -0
- agentops/utils/azd_env.py +435 -0
- agentops/utils/azure_endpoints.py +62 -0
- agentops/utils/colors.py +47 -0
- agentops/utils/dotenv_loader.py +105 -0
- agentops/utils/foundry_discovery.py +229 -0
- agentops/utils/logging.py +59 -0
- agentops/utils/telemetry.py +554 -0
- agentops/utils/yaml.py +36 -0
- agentops_accelerator-0.3.0.dist-info/METADATA +278 -0
- agentops_accelerator-0.3.0.dist-info/RECORD +142 -0
- agentops_accelerator-0.3.0.dist-info/WHEEL +5 -0
- agentops_accelerator-0.3.0.dist-info/entry_points.txt +2 -0
- agentops_accelerator-0.3.0.dist-info/licenses/LICENSE +21 -0
- agentops_accelerator-0.3.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# AgentOps - Deploy Foundry prompt agent to __ENV_LABEL__
|
|
2
|
+
#
|
|
3
|
+
# agentops:deploy-mode=prompt-agent
|
|
4
|
+
#
|
|
5
|
+
# This workflow treats the repo prompt file as the source of truth for agent
|
|
6
|
+
# instructions and uses Foundry to manage candidate agent versions:
|
|
7
|
+
# 1. create/reuse a candidate Foundry prompt-agent version from prompt_file;
|
|
8
|
+
# 2. run AgentOps eval against that exact candidate version;
|
|
9
|
+
# 3. record the candidate as deployed only after the gate passes.
|
|
10
|
+
#
|
|
11
|
+
# Generated by `agentops workflow generate --deploy-mode prompt-agent`.
|
|
12
|
+
|
|
13
|
+
name: AgentOps Deploy (__ENV_LABEL__)
|
|
14
|
+
|
|
15
|
+
on:
|
|
16
|
+
push:
|
|
17
|
+
branches:
|
|
18
|
+
__BRANCHES__
|
|
19
|
+
workflow_dispatch:
|
|
20
|
+
inputs:
|
|
21
|
+
config:
|
|
22
|
+
description: "Path to agentops.yaml (defaults to ./agentops.yaml at repo root)"
|
|
23
|
+
required: false
|
|
24
|
+
default: "agentops.yaml"
|
|
25
|
+
|
|
26
|
+
permissions:
|
|
27
|
+
contents: read
|
|
28
|
+
id-token: write
|
|
29
|
+
|
|
30
|
+
concurrency:
|
|
31
|
+
group: agentops-deploy-__ENV_KEY__-${{ github.ref }}
|
|
32
|
+
cancel-in-progress: false
|
|
33
|
+
|
|
34
|
+
jobs:
|
|
35
|
+
stage-candidate:
|
|
36
|
+
name: Stage Foundry prompt candidate (__ENV_LABEL__)
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
environment: __ENV_NAME__
|
|
39
|
+
timeout-minutes: 20
|
|
40
|
+
steps:
|
|
41
|
+
- name: Checkout
|
|
42
|
+
uses: actions/checkout@v6
|
|
43
|
+
|
|
44
|
+
- name: Azure login (OIDC)
|
|
45
|
+
uses: azure/login@v3
|
|
46
|
+
with:
|
|
47
|
+
client-id: ${{ vars.AZURE_CLIENT_ID }}
|
|
48
|
+
tenant-id: ${{ vars.AZURE_TENANT_ID }}
|
|
49
|
+
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
|
|
50
|
+
|
|
51
|
+
- name: Set up Python
|
|
52
|
+
uses: actions/setup-python@v6
|
|
53
|
+
with:
|
|
54
|
+
python-version: "3.11"
|
|
55
|
+
|
|
56
|
+
- name: Install uv
|
|
57
|
+
uses: astral-sh/setup-uv@v7
|
|
58
|
+
with:
|
|
59
|
+
enable-cache: false
|
|
60
|
+
|
|
61
|
+
- name: Install AgentOps Toolkit
|
|
62
|
+
run: |
|
|
63
|
+
uv pip install --system "agentops-accelerator[foundry,agent] @ git+https://github.com/Azure/agentops.git@main"
|
|
64
|
+
|
|
65
|
+
- name: Create candidate agent version from prompt_file
|
|
66
|
+
env:
|
|
67
|
+
AZURE_AI_FOUNDRY_PROJECT_ENDPOINT: ${{ vars.AZURE_AI_FOUNDRY_PROJECT_ENDPOINT }}
|
|
68
|
+
AGENTOPS_AGENT_PROMPT_FILE: ${{ vars.AGENTOPS_AGENT_PROMPT_FILE || '' }}
|
|
69
|
+
run: |
|
|
70
|
+
python -m agentops.pipeline.prompt_deploy stage \
|
|
71
|
+
--config "${{ inputs.config || 'agentops.yaml' }}" \
|
|
72
|
+
--environment "__ENV_NAME__" \
|
|
73
|
+
--out ".agentops/deployments/foundry-agent.json" \
|
|
74
|
+
--eval-config ".agentops/deployments/agentops.candidate.yaml"
|
|
75
|
+
|
|
76
|
+
- name: Upload candidate deployment record
|
|
77
|
+
uses: actions/upload-artifact@v7
|
|
78
|
+
with:
|
|
79
|
+
name: foundry-agent-__ENV_KEY__-candidate
|
|
80
|
+
path: |
|
|
81
|
+
.agentops/deployments/foundry-agent.json
|
|
82
|
+
.agentops/deployments/agentops.candidate.yaml
|
|
83
|
+
if-no-files-found: error
|
|
84
|
+
|
|
85
|
+
eval:
|
|
86
|
+
name: __EVAL_JOB_NAME__
|
|
87
|
+
needs: stage-candidate
|
|
88
|
+
runs-on: ubuntu-latest
|
|
89
|
+
environment: __ENV_NAME__
|
|
90
|
+
timeout-minutes: 30
|
|
91
|
+
steps:
|
|
92
|
+
- name: Checkout
|
|
93
|
+
uses: actions/checkout@v6
|
|
94
|
+
|
|
95
|
+
- name: Download candidate deployment record
|
|
96
|
+
uses: actions/download-artifact@v4
|
|
97
|
+
with:
|
|
98
|
+
name: foundry-agent-__ENV_KEY__-candidate
|
|
99
|
+
path: .agentops/deployments
|
|
100
|
+
|
|
101
|
+
- name: Azure login (OIDC)
|
|
102
|
+
uses: azure/login@v3
|
|
103
|
+
with:
|
|
104
|
+
client-id: ${{ vars.AZURE_CLIENT_ID }}
|
|
105
|
+
tenant-id: ${{ vars.AZURE_TENANT_ID }}
|
|
106
|
+
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
|
|
107
|
+
|
|
108
|
+
- name: Set up Python
|
|
109
|
+
uses: actions/setup-python@v6
|
|
110
|
+
with:
|
|
111
|
+
python-version: "3.11"
|
|
112
|
+
|
|
113
|
+
- name: Install uv
|
|
114
|
+
uses: astral-sh/setup-uv@v7
|
|
115
|
+
with:
|
|
116
|
+
enable-cache: false
|
|
117
|
+
|
|
118
|
+
- name: Install AgentOps Toolkit
|
|
119
|
+
run: |
|
|
120
|
+
uv pip install --system "agentops-accelerator[foundry] @ git+https://github.com/Azure/agentops.git@main"
|
|
121
|
+
|
|
122
|
+
__EVAL_STEPS__
|
|
123
|
+
|
|
124
|
+
- name: Generate release evidence
|
|
125
|
+
if: always()
|
|
126
|
+
env:
|
|
127
|
+
AZURE_AI_FOUNDRY_PROJECT_ENDPOINT: ${{ vars.AZURE_AI_FOUNDRY_PROJECT_ENDPOINT }}
|
|
128
|
+
AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }}
|
|
129
|
+
AZURE_OPENAI_DEPLOYMENT: ${{ vars.AZURE_OPENAI_DEPLOYMENT }}
|
|
130
|
+
APPLICATIONINSIGHTS_CONNECTION_STRING: ${{ secrets.APPLICATIONINSIGHTS_CONNECTION_STRING || vars.APPLICATIONINSIGHTS_CONNECTION_STRING }}
|
|
131
|
+
run: |
|
|
132
|
+
agentops doctor --workspace . --out .agentops/agent/report.md \
|
|
133
|
+
--severity-fail critical --evidence-pack
|
|
134
|
+
|
|
135
|
+
- name: Upload AgentOps results
|
|
136
|
+
if: always()
|
|
137
|
+
uses: actions/upload-artifact@v7
|
|
138
|
+
with:
|
|
139
|
+
name: agentops-__ENV_KEY__-results
|
|
140
|
+
path: |
|
|
141
|
+
__EVAL_ARTIFACT_PATHS__
|
|
142
|
+
.agentops/agent/report.md
|
|
143
|
+
.agentops/release/latest/evidence.json
|
|
144
|
+
.agentops/release/latest/evidence.md
|
|
145
|
+
if-no-files-found: warn
|
|
146
|
+
|
|
147
|
+
- name: Step summary
|
|
148
|
+
if: always()
|
|
149
|
+
run: |
|
|
150
|
+
{
|
|
151
|
+
echo "## AgentOps Eval (__ENV_LABEL__ candidate gate)"
|
|
152
|
+
echo
|
|
153
|
+
if [ -f .agentops/results/latest/report.md ]; then
|
|
154
|
+
cat .agentops/results/latest/report.md
|
|
155
|
+
fi
|
|
156
|
+
if [ -f .agentops/release/latest/evidence.md ]; then
|
|
157
|
+
echo
|
|
158
|
+
echo "---"
|
|
159
|
+
echo
|
|
160
|
+
cat .agentops/release/latest/evidence.md
|
|
161
|
+
fi
|
|
162
|
+
} >> "$GITHUB_STEP_SUMMARY"
|
|
163
|
+
|
|
164
|
+
deploy:
|
|
165
|
+
name: Record Foundry prompt deploy (__ENV_LABEL__)
|
|
166
|
+
needs: eval
|
|
167
|
+
runs-on: ubuntu-latest
|
|
168
|
+
environment: __ENV_NAME__
|
|
169
|
+
timeout-minutes: 10
|
|
170
|
+
steps:
|
|
171
|
+
- name: Download candidate deployment record
|
|
172
|
+
uses: actions/download-artifact@v4
|
|
173
|
+
with:
|
|
174
|
+
name: foundry-agent-__ENV_KEY__-candidate
|
|
175
|
+
path: .agentops/deployments
|
|
176
|
+
|
|
177
|
+
- name: Set up Python
|
|
178
|
+
uses: actions/setup-python@v6
|
|
179
|
+
with:
|
|
180
|
+
python-version: "3.11"
|
|
181
|
+
|
|
182
|
+
- name: Install AgentOps Toolkit
|
|
183
|
+
run: |
|
|
184
|
+
python -m pip install "agentops-accelerator @ git+https://github.com/Azure/agentops.git@main"
|
|
185
|
+
|
|
186
|
+
- name: Mark candidate as deployed
|
|
187
|
+
run: |
|
|
188
|
+
python -m agentops.pipeline.prompt_deploy summarize \
|
|
189
|
+
--deployment ".agentops/deployments/foundry-agent.json" \
|
|
190
|
+
--environment "__ENV_NAME__"
|
|
191
|
+
|
|
192
|
+
- name: Upload Foundry deployment record
|
|
193
|
+
uses: actions/upload-artifact@v7
|
|
194
|
+
with:
|
|
195
|
+
name: foundry-agent-__ENV_KEY__-deployment
|
|
196
|
+
path: .agentops/deployments/foundry-agent.json
|
|
197
|
+
if-no-files-found: error
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# AgentOps - Deploy to QA with azd
|
|
2
|
+
#
|
|
3
|
+
# agentops:deploy-mode=azd
|
|
4
|
+
#
|
|
5
|
+
# Runs on push to release/**. Delegates deployment to Azure Developer CLI.
|
|
6
|
+
# Infrastructure changes are opt-in for QA via workflow_dispatch input.
|
|
7
|
+
#
|
|
8
|
+
# Generated by `agentops workflow generate --deploy-mode azd`.
|
|
9
|
+
|
|
10
|
+
name: AgentOps Deploy (QA)
|
|
11
|
+
|
|
12
|
+
on:
|
|
13
|
+
push:
|
|
14
|
+
branches:
|
|
15
|
+
- "release/**"
|
|
16
|
+
workflow_dispatch:
|
|
17
|
+
inputs:
|
|
18
|
+
config:
|
|
19
|
+
description: "Path to agentops.yaml (defaults to ./agentops.yaml at repo root)"
|
|
20
|
+
required: false
|
|
21
|
+
default: "agentops.yaml"
|
|
22
|
+
provision:
|
|
23
|
+
description: "Run azd provision before deploy"
|
|
24
|
+
required: false
|
|
25
|
+
type: boolean
|
|
26
|
+
default: false
|
|
27
|
+
|
|
28
|
+
permissions:
|
|
29
|
+
contents: read
|
|
30
|
+
id-token: write
|
|
31
|
+
packages: write
|
|
32
|
+
|
|
33
|
+
concurrency:
|
|
34
|
+
group: agentops-deploy-qa-${{ github.ref }}
|
|
35
|
+
cancel-in-progress: false
|
|
36
|
+
|
|
37
|
+
jobs:
|
|
38
|
+
provision:
|
|
39
|
+
name: azd environment (QA)
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
environment: qa
|
|
42
|
+
timeout-minutes: 45
|
|
43
|
+
steps:
|
|
44
|
+
- name: Checkout
|
|
45
|
+
uses: actions/checkout@v6
|
|
46
|
+
|
|
47
|
+
- name: Set up azd
|
|
48
|
+
uses: Azure/setup-azd@v2
|
|
49
|
+
|
|
50
|
+
- name: Azure login (OIDC)
|
|
51
|
+
uses: azure/login@v3
|
|
52
|
+
with:
|
|
53
|
+
client-id: ${{ vars.AZURE_CLIENT_ID }}
|
|
54
|
+
tenant-id: ${{ vars.AZURE_TENANT_ID }}
|
|
55
|
+
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
|
|
56
|
+
|
|
57
|
+
- name: Prepare azd environment
|
|
58
|
+
env:
|
|
59
|
+
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME || 'qa' }}
|
|
60
|
+
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
|
|
61
|
+
run: |
|
|
62
|
+
test -f azure.yaml || {
|
|
63
|
+
echo "::error file=azure.yaml::No azure.yaml found. Ask your coding agent to generate a zero-trust azd deployment, then re-run this workflow."
|
|
64
|
+
exit 1
|
|
65
|
+
}
|
|
66
|
+
azd env new "$AZURE_ENV_NAME" --no-prompt --subscription "${{ vars.AZURE_SUBSCRIPTION_ID }}" ${AZURE_LOCATION:+--location "$AZURE_LOCATION"} \
|
|
67
|
+
|| azd env select "$AZURE_ENV_NAME"
|
|
68
|
+
azd env set AZURE_SUBSCRIPTION_ID "${{ vars.AZURE_SUBSCRIPTION_ID }}"
|
|
69
|
+
if [ -n "$AZURE_LOCATION" ]; then
|
|
70
|
+
azd env set AZURE_LOCATION "$AZURE_LOCATION"
|
|
71
|
+
fi
|
|
72
|
+
|
|
73
|
+
- name: Run azd provision when requested
|
|
74
|
+
env:
|
|
75
|
+
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME || 'qa' }}
|
|
76
|
+
run: |
|
|
77
|
+
SHOULD_PROVISION="false"
|
|
78
|
+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
79
|
+
SHOULD_PROVISION="${{ inputs.provision }}"
|
|
80
|
+
fi
|
|
81
|
+
if [ "$SHOULD_PROVISION" = "true" ]; then
|
|
82
|
+
__AILZ_PREFLIGHT_COMMAND__
|
|
83
|
+
azd provision --no-prompt
|
|
84
|
+
else
|
|
85
|
+
echo "Skipping azd provision for QA. Use workflow_dispatch with provision=true for infra changes."
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
eval:
|
|
89
|
+
name: Eval (gate)
|
|
90
|
+
needs: provision
|
|
91
|
+
runs-on: ubuntu-latest
|
|
92
|
+
timeout-minutes: 30
|
|
93
|
+
steps:
|
|
94
|
+
- name: Checkout
|
|
95
|
+
uses: actions/checkout@v6
|
|
96
|
+
- name: Azure login (OIDC)
|
|
97
|
+
uses: azure/login@v3
|
|
98
|
+
with:
|
|
99
|
+
client-id: ${{ vars.AZURE_CLIENT_ID }}
|
|
100
|
+
tenant-id: ${{ vars.AZURE_TENANT_ID }}
|
|
101
|
+
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
|
|
102
|
+
- name: Set up Python
|
|
103
|
+
uses: actions/setup-python@v6
|
|
104
|
+
with:
|
|
105
|
+
python-version: "3.11"
|
|
106
|
+
- name: Install uv
|
|
107
|
+
uses: astral-sh/setup-uv@v7
|
|
108
|
+
with:
|
|
109
|
+
enable-cache: false
|
|
110
|
+
|
|
111
|
+
- name: Install AgentOps Toolkit
|
|
112
|
+
run: uv pip install --system "agentops-accelerator[foundry] @ git+https://github.com/Azure/agentops.git@main"
|
|
113
|
+
__EVAL_STEPS__
|
|
114
|
+
- name: Upload AgentOps results
|
|
115
|
+
if: always()
|
|
116
|
+
uses: actions/upload-artifact@v7
|
|
117
|
+
with:
|
|
118
|
+
name: agentops-qa-results
|
|
119
|
+
path: |
|
|
120
|
+
__EVAL_ARTIFACT_PATHS__
|
|
121
|
+
if-no-files-found: warn
|
|
122
|
+
|
|
123
|
+
deploy:
|
|
124
|
+
name: azd deploy (QA)
|
|
125
|
+
needs: eval
|
|
126
|
+
runs-on: ubuntu-latest
|
|
127
|
+
environment: qa
|
|
128
|
+
timeout-minutes: 45
|
|
129
|
+
steps:
|
|
130
|
+
- name: Checkout
|
|
131
|
+
uses: actions/checkout@v6
|
|
132
|
+
- name: Set up azd
|
|
133
|
+
uses: Azure/setup-azd@v2
|
|
134
|
+
- name: Azure login (OIDC)
|
|
135
|
+
uses: azure/login@v3
|
|
136
|
+
with:
|
|
137
|
+
client-id: ${{ vars.AZURE_CLIENT_ID }}
|
|
138
|
+
tenant-id: ${{ vars.AZURE_TENANT_ID }}
|
|
139
|
+
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
|
|
140
|
+
- name: Run azd deploy
|
|
141
|
+
env:
|
|
142
|
+
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME || 'qa' }}
|
|
143
|
+
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
|
|
144
|
+
run: |
|
|
145
|
+
test -f azure.yaml || {
|
|
146
|
+
echo "::error file=azure.yaml::No azure.yaml found. Ask your coding agent to generate a zero-trust azd deployment, then re-run this workflow."
|
|
147
|
+
exit 1
|
|
148
|
+
}
|
|
149
|
+
azd env new "$AZURE_ENV_NAME" --no-prompt --subscription "${{ vars.AZURE_SUBSCRIPTION_ID }}" ${AZURE_LOCATION:+--location "$AZURE_LOCATION"} \
|
|
150
|
+
|| azd env select "$AZURE_ENV_NAME"
|
|
151
|
+
azd env set AZURE_SUBSCRIPTION_ID "${{ vars.AZURE_SUBSCRIPTION_ID }}"
|
|
152
|
+
if [ -n "$AZURE_LOCATION" ]; then
|
|
153
|
+
azd env set AZURE_LOCATION "$AZURE_LOCATION"
|
|
154
|
+
fi
|
|
155
|
+
azd env refresh "$AZURE_ENV_NAME" --no-prompt
|
|
156
|
+
azd deploy --no-prompt
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# AgentOps — Deploy to QA
|
|
2
|
+
#
|
|
3
|
+
# Triggers on every push to a `release/**` branch. Runs the AgentOps
|
|
4
|
+
# eval as a quality gate, then builds and deploys to the `qa` GitHub
|
|
5
|
+
# Environment.
|
|
6
|
+
#
|
|
7
|
+
# To finish wiring this for your project:
|
|
8
|
+
# 1. Configure the `qa` GitHub Environment (Settings -> Environments).
|
|
9
|
+
# Add any environment-specific variables/secrets there.
|
|
10
|
+
# 2. Fill in the `Build` and `Deploy` steps below to match your stack
|
|
11
|
+
# (see commented examples).
|
|
12
|
+
# 3. Recommended: tighten thresholds in your bundle for QA-grade gating.
|
|
13
|
+
#
|
|
14
|
+
# Generated by `agentops workflow generate`.
|
|
15
|
+
|
|
16
|
+
name: AgentOps Deploy (QA)
|
|
17
|
+
|
|
18
|
+
on:
|
|
19
|
+
push:
|
|
20
|
+
branches:
|
|
21
|
+
- "release/**"
|
|
22
|
+
workflow_dispatch:
|
|
23
|
+
inputs:
|
|
24
|
+
config:
|
|
25
|
+
description: "Path to agentops.yaml (defaults to ./agentops.yaml at repo root)"
|
|
26
|
+
required: false
|
|
27
|
+
default: "agentops.yaml"
|
|
28
|
+
|
|
29
|
+
permissions:
|
|
30
|
+
contents: read
|
|
31
|
+
id-token: write
|
|
32
|
+
packages: write
|
|
33
|
+
|
|
34
|
+
concurrency:
|
|
35
|
+
group: agentops-deploy-qa-${{ github.ref }}
|
|
36
|
+
cancel-in-progress: false
|
|
37
|
+
|
|
38
|
+
jobs:
|
|
39
|
+
eval:
|
|
40
|
+
name: Eval (gate)
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
timeout-minutes: 30
|
|
43
|
+
steps:
|
|
44
|
+
- name: Checkout
|
|
45
|
+
uses: actions/checkout@v6
|
|
46
|
+
|
|
47
|
+
- name: Azure login (OIDC)
|
|
48
|
+
uses: azure/login@v3
|
|
49
|
+
with:
|
|
50
|
+
client-id: ${{ vars.AZURE_CLIENT_ID }}
|
|
51
|
+
tenant-id: ${{ vars.AZURE_TENANT_ID }}
|
|
52
|
+
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
|
|
53
|
+
|
|
54
|
+
- name: Set up Python
|
|
55
|
+
uses: actions/setup-python@v6
|
|
56
|
+
with:
|
|
57
|
+
python-version: "3.11"
|
|
58
|
+
|
|
59
|
+
# uv is ~5-10x faster than pip on cold installs; the AgentOps stack
|
|
60
|
+
# (azure-* + opentelemetry-instrumentation-*) pulls dozens of small
|
|
61
|
+
# wheels so the speed-up is very visible in CI.
|
|
62
|
+
- name: Install uv
|
|
63
|
+
uses: astral-sh/setup-uv@v7
|
|
64
|
+
with:
|
|
65
|
+
enable-cache: false
|
|
66
|
+
|
|
67
|
+
- name: Install AgentOps Toolkit
|
|
68
|
+
run: |
|
|
69
|
+
# NOTE: pinned to GitHub main until the next package release includes this flow.
|
|
70
|
+
# Switch to `uv pip install --system "agentops-accelerator[foundry]"` after release.
|
|
71
|
+
uv pip install --system "agentops-accelerator[foundry] @ git+https://github.com/Azure/agentops.git@main"
|
|
72
|
+
|
|
73
|
+
__EVAL_STEPS__
|
|
74
|
+
|
|
75
|
+
- name: Upload AgentOps results
|
|
76
|
+
if: always()
|
|
77
|
+
uses: actions/upload-artifact@v7
|
|
78
|
+
with:
|
|
79
|
+
name: agentops-qa-results
|
|
80
|
+
path: |
|
|
81
|
+
__EVAL_ARTIFACT_PATHS__
|
|
82
|
+
if-no-files-found: warn
|
|
83
|
+
|
|
84
|
+
- name: Step summary
|
|
85
|
+
if: always()
|
|
86
|
+
run: |
|
|
87
|
+
{
|
|
88
|
+
echo "## AgentOps Eval (QA gate)"
|
|
89
|
+
echo
|
|
90
|
+
if [ -f .agentops/results/latest/report.md ]; then
|
|
91
|
+
cat .agentops/results/latest/report.md
|
|
92
|
+
fi
|
|
93
|
+
} >> "$GITHUB_STEP_SUMMARY"
|
|
94
|
+
|
|
95
|
+
build:
|
|
96
|
+
name: Build
|
|
97
|
+
needs: eval
|
|
98
|
+
runs-on: ubuntu-latest
|
|
99
|
+
timeout-minutes: 30
|
|
100
|
+
steps:
|
|
101
|
+
- name: Checkout
|
|
102
|
+
uses: actions/checkout@v6
|
|
103
|
+
|
|
104
|
+
- name: Azure login (OIDC)
|
|
105
|
+
uses: azure/login@v3
|
|
106
|
+
with:
|
|
107
|
+
client-id: ${{ vars.AZURE_CLIENT_ID }}
|
|
108
|
+
tenant-id: ${{ vars.AZURE_TENANT_ID }}
|
|
109
|
+
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
|
|
110
|
+
|
|
111
|
+
# ---------------------------------------------------------------
|
|
112
|
+
# TODO: replace this placeholder with your build step.
|
|
113
|
+
# See agentops-deploy-dev.yml for example snippets (wheel,
|
|
114
|
+
# docker, az acr build, azd package).
|
|
115
|
+
# ---------------------------------------------------------------
|
|
116
|
+
- name: Build (placeholder)
|
|
117
|
+
run: |
|
|
118
|
+
echo "TODO: replace this step with your build."
|
|
119
|
+
|
|
120
|
+
deploy:
|
|
121
|
+
name: Deploy to QA
|
|
122
|
+
needs: build
|
|
123
|
+
runs-on: ubuntu-latest
|
|
124
|
+
environment: qa
|
|
125
|
+
timeout-minutes: 30
|
|
126
|
+
steps:
|
|
127
|
+
- name: Checkout
|
|
128
|
+
uses: actions/checkout@v6
|
|
129
|
+
|
|
130
|
+
- name: Azure login (OIDC)
|
|
131
|
+
uses: azure/login@v3
|
|
132
|
+
with:
|
|
133
|
+
client-id: ${{ vars.AZURE_CLIENT_ID }}
|
|
134
|
+
tenant-id: ${{ vars.AZURE_TENANT_ID }}
|
|
135
|
+
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
|
|
136
|
+
|
|
137
|
+
# ---------------------------------------------------------------
|
|
138
|
+
# TODO: replace this placeholder with your deploy step.
|
|
139
|
+
# See agentops-deploy-dev.yml for example snippets (ACA, App
|
|
140
|
+
# Service, Foundry hosted agent, azd deploy).
|
|
141
|
+
# ---------------------------------------------------------------
|
|
142
|
+
- name: Deploy (placeholder)
|
|
143
|
+
run: |
|
|
144
|
+
echo "TODO: replace this step with your deploy."
|
|
145
|
+
echo "Target environment: qa"
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# AgentOps - PR evaluation gate (Foundry prompt agent)
|
|
2
|
+
#
|
|
3
|
+
# agentops:deploy-mode=prompt-agent
|
|
4
|
+
#
|
|
5
|
+
# For Foundry prompt-agent flows, the PR gate must evaluate the prompt
|
|
6
|
+
# the PR is proposing, not the seed agent version pinned in
|
|
7
|
+
# `agentops.yaml`. So this PR workflow stages an ephemeral candidate
|
|
8
|
+
# Foundry prompt-agent version in the dev project from the
|
|
9
|
+
# source-controlled `prompt_file`, evaluates that exact candidate, and
|
|
10
|
+
# runs Doctor against it. The merge gate is the eval + Doctor result.
|
|
11
|
+
#
|
|
12
|
+
# Notes:
|
|
13
|
+
# - Each PR run creates or reuses a candidate version in the dev
|
|
14
|
+
# Foundry project. AgentOps deduplicates only when the prompt is
|
|
15
|
+
# byte-identical to the current seed version's instructions; PR
|
|
16
|
+
# candidates can therefore accumulate over time and may need to be
|
|
17
|
+
# cleaned up out-of-band.
|
|
18
|
+
# - Merge is what promotes the candidate via the deploy workflow.
|
|
19
|
+
# This PR workflow does not record the candidate as deployed.
|
|
20
|
+
#
|
|
21
|
+
# Generated by `agentops workflow generate --deploy-mode prompt-agent`.
|
|
22
|
+
|
|
23
|
+
name: AgentOps PR
|
|
24
|
+
|
|
25
|
+
on:
|
|
26
|
+
pull_request:
|
|
27
|
+
branches:
|
|
28
|
+
- develop
|
|
29
|
+
- "release/**"
|
|
30
|
+
- main
|
|
31
|
+
workflow_dispatch:
|
|
32
|
+
inputs:
|
|
33
|
+
config:
|
|
34
|
+
description: "Path to agentops.yaml (defaults to ./agentops.yaml at repo root)"
|
|
35
|
+
required: false
|
|
36
|
+
default: "agentops.yaml"
|
|
37
|
+
|
|
38
|
+
permissions:
|
|
39
|
+
contents: read
|
|
40
|
+
pull-requests: write
|
|
41
|
+
id-token: write
|
|
42
|
+
|
|
43
|
+
concurrency:
|
|
44
|
+
group: agentops-pr-${{ github.workflow }}-${{ github.ref }}
|
|
45
|
+
cancel-in-progress: true
|
|
46
|
+
|
|
47
|
+
jobs:
|
|
48
|
+
stage-candidate:
|
|
49
|
+
name: Stage Foundry prompt candidate (PR)
|
|
50
|
+
runs-on: ubuntu-latest
|
|
51
|
+
# Stage candidates in the dev Foundry project. Sandbox is the
|
|
52
|
+
# author's playground; dev is where CI proves a change is safe to
|
|
53
|
+
# merge.
|
|
54
|
+
environment: __ENV_NAME__
|
|
55
|
+
timeout-minutes: 20
|
|
56
|
+
steps:
|
|
57
|
+
- name: Checkout
|
|
58
|
+
uses: actions/checkout@v6
|
|
59
|
+
|
|
60
|
+
- name: Azure login (OIDC)
|
|
61
|
+
uses: azure/login@v3
|
|
62
|
+
with:
|
|
63
|
+
client-id: ${{ vars.AZURE_CLIENT_ID }}
|
|
64
|
+
tenant-id: ${{ vars.AZURE_TENANT_ID }}
|
|
65
|
+
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
|
|
66
|
+
|
|
67
|
+
- name: Set up Python
|
|
68
|
+
uses: actions/setup-python@v6
|
|
69
|
+
with:
|
|
70
|
+
python-version: "3.11"
|
|
71
|
+
|
|
72
|
+
- name: Install uv
|
|
73
|
+
uses: astral-sh/setup-uv@v7
|
|
74
|
+
with:
|
|
75
|
+
enable-cache: false
|
|
76
|
+
|
|
77
|
+
- name: Install AgentOps Toolkit
|
|
78
|
+
run: |
|
|
79
|
+
uv pip install --system "agentops-accelerator[foundry,agent] @ git+https://github.com/Azure/agentops.git@main"
|
|
80
|
+
|
|
81
|
+
- name: Create candidate agent version from prompt_file
|
|
82
|
+
env:
|
|
83
|
+
AZURE_AI_FOUNDRY_PROJECT_ENDPOINT: ${{ vars.AZURE_AI_FOUNDRY_PROJECT_ENDPOINT }}
|
|
84
|
+
AGENTOPS_AGENT_PROMPT_FILE: ${{ vars.AGENTOPS_AGENT_PROMPT_FILE || '' }}
|
|
85
|
+
run: |
|
|
86
|
+
python -m agentops.pipeline.prompt_deploy stage \
|
|
87
|
+
--config "${{ inputs.config || 'agentops.yaml' }}" \
|
|
88
|
+
--environment "__ENV_NAME__" \
|
|
89
|
+
--out ".agentops/deployments/foundry-agent.json" \
|
|
90
|
+
--eval-config ".agentops/deployments/agentops.candidate.yaml"
|
|
91
|
+
|
|
92
|
+
- name: Upload candidate deployment record
|
|
93
|
+
uses: actions/upload-artifact@v7
|
|
94
|
+
with:
|
|
95
|
+
name: foundry-agent-__ENV_KEY__-candidate
|
|
96
|
+
path: |
|
|
97
|
+
.agentops/deployments/foundry-agent.json
|
|
98
|
+
.agentops/deployments/agentops.candidate.yaml
|
|
99
|
+
if-no-files-found: error
|
|
100
|
+
|
|
101
|
+
eval:
|
|
102
|
+
name: __EVAL_JOB_NAME__
|
|
103
|
+
needs: stage-candidate
|
|
104
|
+
runs-on: ubuntu-latest
|
|
105
|
+
environment: __ENV_NAME__
|
|
106
|
+
timeout-minutes: 30
|
|
107
|
+
steps:
|
|
108
|
+
- name: Checkout
|
|
109
|
+
uses: actions/checkout@v6
|
|
110
|
+
|
|
111
|
+
- name: Download candidate deployment record
|
|
112
|
+
uses: actions/download-artifact@v4
|
|
113
|
+
with:
|
|
114
|
+
name: foundry-agent-__ENV_KEY__-candidate
|
|
115
|
+
path: .agentops/deployments
|
|
116
|
+
|
|
117
|
+
- name: Azure login (OIDC)
|
|
118
|
+
uses: azure/login@v3
|
|
119
|
+
with:
|
|
120
|
+
client-id: ${{ vars.AZURE_CLIENT_ID }}
|
|
121
|
+
tenant-id: ${{ vars.AZURE_TENANT_ID }}
|
|
122
|
+
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
|
|
123
|
+
|
|
124
|
+
- name: Set up Python
|
|
125
|
+
uses: actions/setup-python@v6
|
|
126
|
+
with:
|
|
127
|
+
python-version: "3.11"
|
|
128
|
+
|
|
129
|
+
- name: Install uv
|
|
130
|
+
uses: astral-sh/setup-uv@v7
|
|
131
|
+
with:
|
|
132
|
+
enable-cache: false
|
|
133
|
+
|
|
134
|
+
- name: Install AgentOps Toolkit
|
|
135
|
+
run: |
|
|
136
|
+
uv pip install --system "agentops-accelerator[foundry,agent] @ git+https://github.com/Azure/agentops.git@main"
|
|
137
|
+
|
|
138
|
+
__EVAL_STEPS__
|
|
139
|
+
|
|
140
|
+
- name: Generate release evidence
|
|
141
|
+
if: always()
|
|
142
|
+
env:
|
|
143
|
+
AZURE_AI_FOUNDRY_PROJECT_ENDPOINT: ${{ vars.AZURE_AI_FOUNDRY_PROJECT_ENDPOINT }}
|
|
144
|
+
AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }}
|
|
145
|
+
AZURE_OPENAI_DEPLOYMENT: ${{ vars.AZURE_OPENAI_DEPLOYMENT }}
|
|
146
|
+
APPLICATIONINSIGHTS_CONNECTION_STRING: ${{ secrets.APPLICATIONINSIGHTS_CONNECTION_STRING || vars.APPLICATIONINSIGHTS_CONNECTION_STRING }}
|
|
147
|
+
run: |
|
|
148
|
+
# Doctor gate severity is configured at workflow generation time via
|
|
149
|
+
# `agentops workflow generate --doctor-gate critical|warning|none`.
|
|
150
|
+
agentops doctor --workspace . --out .agentops/agent/report.md \
|
|
151
|
+
--severity-fail __DOCTOR_GATE__ --evidence-pack
|
|
152
|
+
|
|
153
|
+
- name: Upload AgentOps results
|
|
154
|
+
if: always()
|
|
155
|
+
uses: actions/upload-artifact@v7
|
|
156
|
+
with:
|
|
157
|
+
name: agentops-pr-results
|
|
158
|
+
path: |
|
|
159
|
+
__EVAL_ARTIFACT_PATHS__
|
|
160
|
+
.agentops/agent/report.md
|
|
161
|
+
.agentops/release/latest/evidence.json
|
|
162
|
+
.agentops/release/latest/evidence.md
|
|
163
|
+
if-no-files-found: warn
|
|
164
|
+
|
|
165
|
+
- name: Step summary
|
|
166
|
+
if: always()
|
|
167
|
+
run: |
|
|
168
|
+
{
|
|
169
|
+
echo "## AgentOps PR Eval (Foundry prompt candidate)"
|
|
170
|
+
echo
|
|
171
|
+
echo "Result: \`${{ steps.eval.outputs.result }}\` (exit code \`${{ steps.eval.outputs.exit_code }}\`)"
|
|
172
|
+
echo
|
|
173
|
+
if [ -f .agentops/results/latest/report.md ]; then
|
|
174
|
+
cat .agentops/results/latest/report.md
|
|
175
|
+
fi
|
|
176
|
+
if [ -f .agentops/release/latest/evidence.md ]; then
|
|
177
|
+
echo
|
|
178
|
+
echo "---"
|
|
179
|
+
echo
|
|
180
|
+
cat .agentops/release/latest/evidence.md
|
|
181
|
+
fi
|
|
182
|
+
} >> "$GITHUB_STEP_SUMMARY"
|
|
183
|
+
|
|
184
|
+
- name: Comment AgentOps report on PR
|
|
185
|
+
if: always() && github.event_name == 'pull_request'
|
|
186
|
+
uses: actions/github-script@v8
|
|
187
|
+
with:
|
|
188
|
+
script: |
|
|
189
|
+
const fs = require('fs');
|
|
190
|
+
const path = '.agentops/results/latest/report.md';
|
|
191
|
+
const marker = '<!-- agentops-pr-report -->';
|
|
192
|
+
let body = `${marker}\n## AgentOps PR Eval (Foundry prompt candidate)\n\nNo report produced.`;
|
|
193
|
+
if (fs.existsSync(path)) {
|
|
194
|
+
const md = fs.readFileSync(path, 'utf8');
|
|
195
|
+
body = `${marker}\n${md}`;
|
|
196
|
+
}
|
|
197
|
+
const evidencePath = '.agentops/release/latest/evidence.md';
|
|
198
|
+
if (fs.existsSync(evidencePath)) {
|
|
199
|
+
const evidence = fs.readFileSync(evidencePath, 'utf8');
|
|
200
|
+
body = `${body}\n\n---\n\n${evidence}`;
|
|
201
|
+
}
|
|
202
|
+
const { owner, repo } = context.repo;
|
|
203
|
+
const issue_number = context.payload.pull_request.number;
|
|
204
|
+
const { data: comments } = await github.rest.issues.listComments({ owner, repo, issue_number });
|
|
205
|
+
const existing = comments.find(c => c.body && c.body.startsWith(marker));
|
|
206
|
+
if (existing) {
|
|
207
|
+
await github.rest.issues.updateComment({ owner, repo, comment_id: existing.id, body });
|
|
208
|
+
} else {
|
|
209
|
+
await github.rest.issues.createComment({ owner, repo, issue_number, body });
|
|
210
|
+
}
|