# Products: a self-paced Azure RAG workshop

This directory contains documentation, staged infrastructure and verification tools for an estimated 3½-hour core path **after tools/access are ready**. Application source is maintained in the three separate repositories below. The estimate has not been confirmed by a timed participant walkthrough.

From the repository root, with Python 3.12+:

```bash
python3 scripts/build.py
python3 scripts/serve.py --port 8000
```

Open **http://127.0.0.1:8000/workshop/**, or use the workshop link from the existing home page. No Azure credentials, Java, Docker or package install are needed to build/serve the website. Static files also work beneath the GitHub Pages repository base `/ai200/`; all asset/page/source URLs are relative.

The production build exports a clean `.site/` tree. GitHub Pages publishes that export. The local server uses the same public-file allowlist: `.state`, `.tools`, virtual environments, Git metadata, kubeconfig and private TLS keys are never served. Do not replace it with an unrestricted HTTP server while deployment state is present.

The workshop provides copyable commands for **Windows PowerShell** and **Bash on Linux**. On Windows, Docker Desktop runs the Linux containers and participants use the Docker CLI from PowerShell. The Windows path works without installing a Linux distribution.

Start with [Install software](prerequisites.html), then select a subscription and confirm your permissions in [Azure access](azure-access.html). Each app chapter introduces its own dependencies and quota checks where needed.

Workshop pages reuse the default site header, language/theme controls and shared jargon tooltips. Workshop instructions remain in English; definitions and sources belong to the root jargon catalog rather than a second glossary.

## Layout

| Path | Purpose |
| --- | --- |
| [Products](https://github.com/tuba-labs/ai200-workshop1-products) | Separate Java / Flyway application repository |
| [ProductsEmbedder](https://github.com/tuba-labs/ai200-workshop1-products-embedder) | Separate Python Function repository |
| [ProductsChat](https://github.com/tuba-labs/ai-200-products-chat) | Separate Python worker repository |
| `infra/` | Shared services, private PostgreSQL, AKS, Function host and staged model templates |
| `k8s/` | Products, one chat worker, Service and inspection Job |
| `scripts/` | Ordered Bash setup, readiness, deployment, observation and confirmed cleanup stages |
| `tools/` | Prerequisite checks, canonical render/package tools, real-deployment smoke/load/replay |
| `samples/` | Three fictional UTF-8 manuals and objectively checkable supporting passages |
| `contracts/` | Versioned request/reply JSON schemas |
| `content/`, `assets/` | Authored documentation and accessible static interface |
| `tests/` | Real pgvector integration, deterministic model fixtures and browser/static checks |

## Deployment path

1. [Products](products.html) deploys the Java app and checks that a manual reaches Blob Storage.
2. [ProductsEmbedder](embedder.html) deploys the Function and embedding model, then verifies indexing with a new manual.
3. [ProductsChat](chat.html) deploys the worker and chat model, then tests a question about the indexed manual.
4. [Full-chain test](finish.html) follows one fresh manual from upload to cited answer and ends with cleanup.

Save the lab settings in `lab.properties` when creating the resource group in the Products chapter. Load that file from each new terminal. Your source IPv4 /32 restricts the Products load balancer, PostgreSQL uses private VNet networking, and passwords stay in Key Vault.

**Selected exam objectives only:** AKS, ACR images, PostgreSQL/RAG filters, Service Bus, Event Grid/Functions, Key Vault and App Configuration. See `reference.html` for the dated mapping and official sources.

## Maintainer validation from a checkout

```bash
# Requires Docker, Java 21, Python 3.12+, Node and a browser installed for Playwright.
bash workshop/scripts/verify-local.sh

# After deploying with the maintainer scripts in commands.sh:
source workshop/.tools/venv/bin/activate
python workshop/tools/smoke.py

# Only this workshop's tagged group, after showing resources and typed confirmation:
bash workshop/scripts/cleanup.sh
```

Install the local test browser with `python -m playwright install chromium`, or set `BROWSER_EXECUTABLE` to an installed compatible Chromium/Edge executable. Integration tests use a disposable loopback-only PostgreSQL/pgvector container and deterministic model fixtures. The real Azure smoke uploads a new manual and checks indexing, correlation, a nonempty answer and relevant source passages; it never asserts exact model wording.

See [VALIDATION.md](VALIDATION.md) for observed checks versus remaining Azure validation, and [VERSIONS.md](VERSIONS.md) for versions. Never treat a static chapter's expected output as an observed Azure success.

## Application repositories

Application code is maintained only in the three GitHub repositories above. This website links to their files; it does not contain submodules or app-source copies. The documentation builds without app checkouts or Azure credentials.

Participants use the Git command in each app chapter. For cross-application tests, `bash workshop/scripts/get-apps.sh` clones the pinned test revisions from `repositories.json` into sibling folders. Set `AI200_APPS_DIR` to a different parent directory when needed. Existing checkouts are never reset or overwritten. To advance the workshop baseline, update the manifest after validating the three apps together.

Both Python repos vendor `rag_core/` and include flattened requirements/constraints. Integration checks verify their shared runtime code agrees. The chat image includes its own database inspection tool; Function packaging lives in its own repository.

Edit `content/*.inc` and the templates, then run `python3 scripts/build.py`. The build renders the command blocks, manifests and source links in the HTML.
