Skip to content

Commit 9dc67a4

Browse files
author
Tech901 Bot
committed
Update template from monorepo
Activity: activity02-architect-platform
0 parents  commit 9dc67a4

23 files changed

+2171
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "Activity 2 - Architect the Platform",
3+
"image": "mcr.microsoft.com/devcontainers/python:3.11",
4+
"postCreateCommand": "pip install -r requirements.txt",
5+
"customizations": {
6+
"vscode": {
7+
"extensions": [
8+
"ms-python.python",
9+
"ms-python.vscode-pylance",
10+
"github.copilot",
11+
"github.copilot-chat"
12+
]
13+
}
14+
}
15+
}

.env.example

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Azure OpenAI
2+
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
3+
AZURE_OPENAI_API_KEY=your-key-here
4+
AZURE_OPENAI_DEPLOYMENT=gpt-4o
5+
6+
# Azure AI Search
7+
AZURE_AI_SEARCH_ENDPOINT=https://your-resource.search.windows.net
8+
AZURE_AI_SEARCH_KEY=your-key-here
9+
10+
# Azure Document Intelligence
11+
AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT=https://your-resource.cognitiveservices.azure.com/
12+
AZURE_DOCUMENT_INTELLIGENCE_KEY=your-key-here
13+
14+
# Azure AI Language
15+
AZURE_AI_LANGUAGE_ENDPOINT=https://your-resource.cognitiveservices.azure.com/
16+
AZURE_AI_LANGUAGE_KEY=your-key-here

.github/copilot-instructions.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copilot Chat Instructions - Activity 2: Architect the Platform
2+
3+
You are a Socratic tutor helping a student complete Activity 2 of the AI-102 course. This activity covers Azure AI service selection, configuration security, and cost estimation for the Memphis City AI Platform.
4+
5+
## Your Role
6+
7+
- Guide students through architecture decisions without giving complete answers
8+
- Ask probing questions to help them reason through service selection
9+
- Point students toward Azure documentation when they need reference material
10+
- Help them understand security best practices for Azure AI services
11+
12+
## Topics in Scope
13+
14+
- Azure AI service capabilities and selection (Azure OpenAI, Document Intelligence, AI Search, AI Language, Speech, Vision, Content Safety)
15+
- SDK package identification for each service
16+
- Authentication models: key-based, RBAC, managed identity
17+
- Configuration validation with regex patterns
18+
- Security auditing (no hardcoded secrets, .gitignore practices)
19+
- Cost estimation using pricing catalogs
20+
- Azure Monitor metrics and alert rules
21+
- Responsible AI considerations
22+
23+
## Rules
24+
25+
1. **Never provide complete function implementations.** If a student asks "write select_service for me", instead ask: "What capability does the 311 Call Center need? Which service in the catalog supports that?"
26+
2. **Never reveal hidden test expectations.** Do not mention specific test names, expected values, or grading criteria.
27+
3. **Use guiding questions.** Instead of "use re.match()", ask "How would you check if a string matches a URL pattern in Python?"
28+
4. **Reference the service catalog.** Remind students to check `app/services.py` and `app/cost_estimator.py` for available data.
29+
5. **Stay within scope.** Do not help with unrelated Python topics, other courses, or non-Azure cloud services.
30+
6. **Encourage testing.** Suggest running `pytest tests/ -v` after each implementation step.
31+
32+
## Common Student Questions
33+
34+
- "Which service should I pick for X?" -> Ask what capability X requires, then have them check the catalog
35+
- "How do I validate an endpoint?" -> Ask what a valid Azure endpoint URL looks like
36+
- "What metrics should I track?" -> Point them to `AZURE_MONITOR_METRICS` in `cost_estimator.py`
37+
- "Why is my test failing?" -> Ask them to read the assertion message and check their output structure

.github/workflows/autograde.yml

Lines changed: 310 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,310 @@
1+
name: Autograding
2+
on:
3+
push:
4+
branches: [main]
5+
workflow_dispatch:
6+
7+
env:
8+
STUDENT_CORPUS_SEED: ${{ github.actor }}
9+
10+
jobs:
11+
grade:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 15
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.11"
20+
21+
- name: Install dependencies
22+
run: pip install -r requirements.txt
23+
24+
- name: Run student code
25+
run: python app/main.py
26+
continue-on-error: true
27+
28+
- name: Clone autograder
29+
uses: actions/checkout@v4
30+
with:
31+
repository: Tech901/ai102-autograder-tests
32+
token: ${{ secrets.AUTOGRADER_PAT }}
33+
path: .autograder
34+
35+
# --- 27 tests, 100 points ---
36+
- name: "test_student_modified_select_service"
37+
id: test1
38+
uses: classroom-resources/autograding-command-grader@v1
39+
with:
40+
test-name: "test_student_modified_select_service"
41+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_student_modified_select_service -v --tb=short"
42+
timeout: "5"
43+
max-score: "4"
44+
45+
- name: "test_student_modified_estimate_cost"
46+
id: test2
47+
uses: classroom-resources/autograding-command-grader@v1
48+
with:
49+
test-name: "test_student_modified_estimate_cost"
50+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_student_modified_estimate_cost -v --tb=short"
51+
timeout: "5"
52+
max-score: "4"
53+
54+
- name: "test_design_has_architecture"
55+
id: test3
56+
uses: classroom-resources/autograding-command-grader@v1
57+
with:
58+
test-name: "test_design_has_architecture"
59+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_design_has_architecture -v --tb=short"
60+
timeout: "5"
61+
max-score: "4"
62+
63+
- name: "test_design_is_valid_json"
64+
id: test4
65+
uses: classroom-resources/autograding-command-grader@v1
66+
with:
67+
test-name: "test_design_is_valid_json"
68+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_design_is_valid_json -v --tb=short"
69+
timeout: "5"
70+
max-score: "4"
71+
72+
- name: "test_correct_services_per_department"
73+
id: test5
74+
uses: classroom-resources/autograding-command-grader@v1
75+
with:
76+
test-name: "test_correct_services_per_department"
77+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_correct_services_per_department -v --tb=short"
78+
timeout: "5"
79+
max-score: "4"
80+
81+
- name: "test_unique_justifications"
82+
id: test6
83+
uses: classroom-resources/autograding-command-grader@v1
84+
with:
85+
test-name: "test_unique_justifications"
86+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_unique_justifications -v --tb=short"
87+
timeout: "5"
88+
max-score: "4"
89+
90+
- name: "test_rai_not_empty"
91+
id: test7
92+
uses: classroom-resources/autograding-command-grader@v1
93+
with:
94+
test-name: "test_rai_not_empty"
95+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_rai_not_empty -v --tb=short"
96+
timeout: "5"
97+
max-score: "4"
98+
99+
- name: "test_min_distinct_services"
100+
id: test8
101+
uses: classroom-resources/autograding-command-grader@v1
102+
with:
103+
test-name: "test_min_distinct_services"
104+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_min_distinct_services -v --tb=short"
105+
timeout: "5"
106+
max-score: "4"
107+
108+
- name: "test_valid_sdk_names"
109+
id: test9
110+
uses: classroom-resources/autograding-command-grader@v1
111+
with:
112+
test-name: "test_valid_sdk_names"
113+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_valid_sdk_names -v --tb=short"
114+
timeout: "5"
115+
max-score: "4"
116+
117+
- name: "test_auth_model_mentioned"
118+
id: test10
119+
uses: classroom-resources/autograding-command-grader@v1
120+
with:
121+
test-name: "test_auth_model_mentioned"
122+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_auth_model_mentioned -v --tb=short"
123+
timeout: "5"
124+
max-score: "4"
125+
126+
- name: "test_comprehensive_audit_fields"
127+
id: test11
128+
uses: classroom-resources/autograding-command-grader@v1
129+
with:
130+
test-name: "test_comprehensive_audit_fields"
131+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_comprehensive_audit_fields -v --tb=short"
132+
timeout: "5"
133+
max-score: "4"
134+
135+
- name: "test_auth_comparison_mentions_three_models"
136+
id: test12
137+
uses: classroom-resources/autograding-command-grader@v1
138+
with:
139+
test-name: "test_auth_comparison_mentions_three_models"
140+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_auth_comparison_mentions_three_models -v --tb=short"
141+
timeout: "5"
142+
max-score: "4"
143+
144+
- name: "test_four_services_validated"
145+
id: test13
146+
uses: classroom-resources/autograding-command-grader@v1
147+
with:
148+
test-name: "test_four_services_validated"
149+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_four_services_validated -v --tb=short"
150+
timeout: "5"
151+
max-score: "4"
152+
153+
- name: "test_exact_math_311"
154+
id: test14
155+
uses: classroom-resources/autograding-command-grader@v1
156+
with:
157+
test-name: "test_exact_math_311"
158+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_exact_math_311 -v --tb=short"
159+
timeout: "5"
160+
max-score: "4"
161+
162+
- name: "test_exact_math_public_works"
163+
id: test15
164+
uses: classroom-resources/autograding-command-grader@v1
165+
with:
166+
test-name: "test_exact_math_public_works"
167+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_exact_math_public_works -v --tb=short"
168+
timeout: "5"
169+
max-score: "4"
170+
171+
- name: "test_budget_flag_logic"
172+
id: test16
173+
uses: classroom-resources/autograding-command-grader@v1
174+
with:
175+
test-name: "test_budget_flag_logic"
176+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_budget_flag_logic -v --tb=short"
177+
timeout: "5"
178+
max-score: "4"
179+
180+
- name: "test_total_equals_sum"
181+
id: test17
182+
uses: classroom-resources/autograding-command-grader@v1
183+
with:
184+
test-name: "test_total_equals_sum"
185+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_total_equals_sum -v --tb=short"
186+
timeout: "5"
187+
max-score: "4"
188+
189+
- name: "test_metric_names_valid"
190+
id: test18
191+
uses: classroom-resources/autograding-command-grader@v1
192+
with:
193+
test-name: "test_metric_names_valid"
194+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_metric_names_valid -v --tb=short"
195+
timeout: "5"
196+
max-score: "4"
197+
198+
- name: "test_alert_rules_have_condition_and_action"
199+
id: test19
200+
uses: classroom-resources/autograding-command-grader@v1
201+
with:
202+
test-name: "test_alert_rules_have_condition_and_action"
203+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_alert_rules_have_condition_and_action -v --tb=short"
204+
timeout: "5"
205+
max-score: "4"
206+
207+
- name: "test_result_json_is_valid_json"
208+
id: test20
209+
uses: classroom-resources/autograding-command-grader@v1
210+
with:
211+
test-name: "test_result_json_is_valid_json"
212+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_result_json_is_valid_json -v --tb=short"
213+
timeout: "5"
214+
max-score: "3"
215+
216+
- name: "test_no_leaked_endpoints"
217+
id: test21
218+
uses: classroom-resources/autograding-command-grader@v1
219+
with:
220+
test-name: "test_no_leaked_endpoints"
221+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_no_leaked_endpoints -v --tb=short"
222+
timeout: "5"
223+
max-score: "3"
224+
225+
- name: "test_no_hardcoded_secrets_ast"
226+
id: test22
227+
uses: classroom-resources/autograding-command-grader@v1
228+
with:
229+
test-name: "test_no_hardcoded_secrets_ast"
230+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_no_hardcoded_secrets_ast -v --tb=short"
231+
timeout: "5"
232+
max-score: "3"
233+
234+
- name: "test_pricing_version_present"
235+
id: test23
236+
uses: classroom-resources/autograding-command-grader@v1
237+
with:
238+
test-name: "test_pricing_version_present"
239+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_pricing_version_present -v --tb=short"
240+
timeout: "5"
241+
max-score: "3"
242+
243+
- name: "test_justification_minimum_length"
244+
id: test24
245+
uses: classroom-resources/autograding-command-grader@v1
246+
with:
247+
test-name: "test_justification_minimum_length"
248+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_justification_minimum_length -v --tb=short"
249+
timeout: "5"
250+
max-score: "3"
251+
252+
- name: "test_validation_has_required_fields"
253+
id: test25
254+
uses: classroom-resources/autograding-command-grader@v1
255+
with:
256+
test-name: "test_validation_has_required_fields"
257+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_validation_has_required_fields -v --tb=short"
258+
timeout: "5"
259+
max-score: "3"
260+
261+
- name: "test_shared_resources_complete"
262+
id: test26
263+
uses: classroom-resources/autograding-command-grader@v1
264+
with:
265+
test-name: "test_shared_resources_complete"
266+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_shared_resources_complete -v --tb=short"
267+
timeout: "5"
268+
max-score: "3"
269+
270+
- name: "test_alternative_differs_from_primary"
271+
id: test27
272+
uses: classroom-resources/autograding-command-grader@v1
273+
with:
274+
test-name: "test_alternative_differs_from_primary"
275+
command: "python -m pytest .autograder/activity02-architect-platform/test_hidden.py::test_alternative_differs_from_primary -v --tb=short"
276+
timeout: "5"
277+
max-score: "3"
278+
279+
- name: Autograding Reporter
280+
uses: classroom-resources/autograding-grading-reporter@v1
281+
env:
282+
TEST1_RESULTS: "${{ steps.test1.outputs.result }}"
283+
TEST2_RESULTS: "${{ steps.test2.outputs.result }}"
284+
TEST3_RESULTS: "${{ steps.test3.outputs.result }}"
285+
TEST4_RESULTS: "${{ steps.test4.outputs.result }}"
286+
TEST5_RESULTS: "${{ steps.test5.outputs.result }}"
287+
TEST6_RESULTS: "${{ steps.test6.outputs.result }}"
288+
TEST7_RESULTS: "${{ steps.test7.outputs.result }}"
289+
TEST8_RESULTS: "${{ steps.test8.outputs.result }}"
290+
TEST9_RESULTS: "${{ steps.test9.outputs.result }}"
291+
TEST10_RESULTS: "${{ steps.test10.outputs.result }}"
292+
TEST11_RESULTS: "${{ steps.test11.outputs.result }}"
293+
TEST12_RESULTS: "${{ steps.test12.outputs.result }}"
294+
TEST13_RESULTS: "${{ steps.test13.outputs.result }}"
295+
TEST14_RESULTS: "${{ steps.test14.outputs.result }}"
296+
TEST15_RESULTS: "${{ steps.test15.outputs.result }}"
297+
TEST16_RESULTS: "${{ steps.test16.outputs.result }}"
298+
TEST17_RESULTS: "${{ steps.test17.outputs.result }}"
299+
TEST18_RESULTS: "${{ steps.test18.outputs.result }}"
300+
TEST19_RESULTS: "${{ steps.test19.outputs.result }}"
301+
TEST20_RESULTS: "${{ steps.test20.outputs.result }}"
302+
TEST21_RESULTS: "${{ steps.test21.outputs.result }}"
303+
TEST22_RESULTS: "${{ steps.test22.outputs.result }}"
304+
TEST23_RESULTS: "${{ steps.test23.outputs.result }}"
305+
TEST24_RESULTS: "${{ steps.test24.outputs.result }}"
306+
TEST25_RESULTS: "${{ steps.test25.outputs.result }}"
307+
TEST26_RESULTS: "${{ steps.test26.outputs.result }}"
308+
TEST27_RESULTS: "${{ steps.test27.outputs.result }}"
309+
with:
310+
runners: test1,test2,test3,test4,test5,test6,test7,test8,test9,test10,test11,test12,test13,test14,test15,test16,test17,test18,test19,test20,test21,test22,test23,test24,test25,test26,test27

0 commit comments

Comments
 (0)