Skip to content

Commit dc449be

Browse files
committed
Run the Cloud course in an instance per participant
The Cloud course no longer starts from a team card. Each participant gets an instance in the hackathon organization and a service account from the organizers, creates a Kafka cluster, an agent workspace and a SQL workspace in it, and fills in .env with snctl lookups in Lab 0. - Lab 0 reads each address with snctl, creates the login topic and loads it. The seeders accept the cloud stack and name the course in their hints. - Lab 2 selects from the source named after the topic, security.login_events, and offers psql through the SQL workspace gateway. - Lab 4 says the SQL workspace needs read-write MCP access, and its deny example matches what the scripts print. - Troubleshooting covers the snctl context, the SQL tools failing with connection_unavailable, read-only MCP access, and a slow approval. - The doctor and the setup hints point at the instance, not a team card. - What was run: Labs 1, 3 and 4 with every check on all three paths against a test instance on StreamNative Cloud.
1 parent 2a5808f commit dc449be

32 files changed

Lines changed: 562 additions & 203 deletions

‎.env.cloud.example‎

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
1-
# The Cloud course: copy this file to .env (in the repo root) and paste the
2-
# values from your team card. .env is git-ignored: never commit it.
1+
# The Cloud course: copy this file to .env (in the repo root) and fill it in
2+
# from your instance on StreamNative Cloud. .env is git-ignored: never commit it.
33
#
44
# cp .env.cloud.example .env
55
#
6+
# labs/cloud/00-set-up.md, step 2, has the snctl command for each address.
67
# (The Local course writes its own .env: see labs/local/00-set-up.md.)
78

8-
# ---------------------------------------------------------------- team card --
9+
# -------------------------------------------------- from the organizers --
910

10-
# Service-account API key (API Key v2) for the hosted Agent Engine API,
11-
# Kafka and Schema Registry. OAuth MCP servers use a separate browser login.
11+
# Your service account's API key (API Key v2). It authenticates the hosted Agent
12+
# Engine API, Kafka and Schema Registry. The MCP server uses a separate browser
13+
# login, in Lab 3.
1214
SN_API_KEY=
1315

14-
# Service-account principal, used as the Kafka SASL username.
16+
# Your service account's principal, used as the Kafka SASL username.
1517
# Looks like: <service-account>@<org>.auth.streamnative.cloud
1618
SN_SERVICE_ACCOUNT=
1719

18-
# Agent Engine registry endpoint (the External one). Host root only, no /v1.
19-
# Looks like: https://<workspace-host>
20+
# ------------------------------------------------ from your instance --
21+
22+
# Your agent workspace's external endpoint, with https:// in front. Host root
23+
# only, no /v1. Looks like: https://<host>
2024
ORCA_BASE_URL=
2125

22-
# Your team's Kafka cluster and its Schema Registry.
26+
# Your Kafka cluster's external endpoint, with its port (host:9093), and its
27+
# schema registry's external endpoint, with https:// in front.
2328
KAFKA_BOOTSTRAP_SERVERS=
2429
SCHEMA_REGISTRY_URL=
2530

26-
# StreamNative MCP server for your SQL Workspace (the agent's data tools).
31+
# Your SQL workspace's MCP route (the agent's data tools):
32+
# https://mcp.streamnative.cloud/mcp/x/<org>/sqlworkspace.compute.streamnative.io/<SQL workspace>
2733
SN_MCP_URL=
2834

2935
# MCP authentication: oauth (default) or static_bearer for API-key MCP servers.
@@ -39,15 +45,14 @@ SN_MCP_OAUTH_SCOPE="openid profile email offline_access"
3945

4046
# ------------------------------------------------------------- your choices --
4147

42-
# The Kafka topic name. Injectors and doctor read this value.
43-
# The SQL files in sql/cloud/ use the default below: edit their quoted
44-
# "avro.<LOGIN_TOPIC>" source name to match this value before running them in
45-
# SQL Workspace.
48+
# The Kafka topic you create and load in Lab 0. The seeder, the injector and the
49+
# doctor read this value. Your SQL catalog imports the topic as a source with the
50+
# same name, and the SQL files in sql/cloud/ use the default below: if you change
51+
# it, change the quoted source name in them too. SQL Workspace does not read .env.
4652
LOGIN_TOPIC=security.login_events
4753

48-
# The model your agent runs on (served by the event's AI gateway).
54+
# The model your agent runs on (served by the Agent Engine's AI gateway).
4955
ORCA_MODEL=claude-sonnet-4-6
5056

51-
# Names your agent, environment, and vault so teammates sharing a workspace
52-
# don't collide. Defaults to your OS user name.
57+
# Names your agent, environment, and vault. Defaults to your OS user name.
5358
PARTICIPANT=

‎README.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ The same five labs, on two stacks.
2525

2626
| | [Cloud course](labs/cloud/README.md) | [Local course](labs/local/README.md) |
2727
|---|---|---|
28-
| Runs on | StreamNative Cloud: your team's Kafka cluster, SQL Workspace, and a hosted Agent Engine | Your laptop: [Ursa for Kafka](https://openlakestream.org/docs/ursa-for-kafka), [RisingWave](https://risingwave.com), and the Orca Agent Engine (`ork local`) |
29-
| You need | A team card, handed out at the hackathon | Docker and an Anthropic API key |
30-
| Time | About 30 minutes | About 45 minutes, plus image downloads |
28+
| Runs on | StreamNative Cloud: your own instance, with a Kafka cluster, a SQL workspace, and an agent workspace | Your laptop: [Ursa for Kafka](https://openlakestream.org/docs/ursa-for-kafka), [RisingWave](https://risingwave.com), and the Orca Agent Engine (`ork local`) |
29+
| You need | A StreamNative Cloud login with your own instance, from the hackathon organizers | Docker and an Anthropic API key |
30+
| Time | About 40 minutes | About 45 minutes, plus image downloads |
3131
| Start | [Lab 0: Set up](labs/cloud/00-set-up.md) | [Lab 0: Set up](labs/local/00-set-up.md) |
3232

3333
At the hackathon, take the Cloud course: see
34-
[Before you arrive](docs/before-you-arrive.md). Without a team card, or to see
35-
every part run on your own machine, take the Local course.
34+
[Before you arrive](docs/before-you-arrive.md). Without a StreamNative Cloud
35+
instance, or to see every part run on your own machine, take the Local course.
3636

3737
## Pick your path
3838

39-
The agent steps work three ways. Pick one; a teammate can pick another.
39+
The agent steps work three ways. Pick one.
4040

4141
- **CLI**: the [`ork`](https://github.com/orca-ae/orca-cli) command line
4242
- **Python**: the [`runorca`](https://pypi.org/project/runorca/) SDK

‎cli/env.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ hello_setup_hint() {
5050
if [ "$(hello_trim "${TUTORIAL_STACK:-}")" = local ]; then
5151
printf '%s' "Run local/write-env.sh in the repo root to write .env again (Local course, Lab 0)."
5252
else
53-
printf '%s' "Copy .env.cloud.example to .env in the repo root and fill it in from your team card, or run local/write-env.sh for the Local course."
53+
printf '%s' "Copy .env.cloud.example to .env in the repo root and fill it in from your StreamNative Cloud instance (Cloud course, Lab 0), or run local/write-env.sh for the Local course."
5454
fi
5555
}
5656

@@ -84,7 +84,7 @@ hello_setup() {
8484
hello_die "jq is not installed. Install it (brew install jq, apt install jq, or winget install jqlang.jq) and try again."
8585

8686
hello_load_dotenv
87-
# `cloud`: your team card on StreamNative Cloud. `local`: the stack on your laptop.
87+
# `cloud`: your instance on StreamNative Cloud. `local`: the stack on your laptop.
8888
HELLO_STACK=$(hello_trim "${TUTORIAL_STACK:-cloud}")
8989
case "$HELLO_STACK" in
9090
cloud | local) ;;

‎cli/tests/run.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ test_missing_team_card() {
133133
run "" l1_hello.sh
134134
check "exits 1 without a team card" [ "$STATUS" -eq 1 ]
135135
check "names every missing variable, and both ways to get an .env" \
136-
err_has "Missing ORCA_BASE_URL, ORCA_MODEL, SN_API_KEY. Copy .env.cloud.example to .env in the repo root and fill it in from your team card, or run local/write-env.sh for the Local course."
136+
err_has "Missing ORCA_BASE_URL, ORCA_MODEL, SN_API_KEY. Copy .env.cloud.example to .env in the repo root and fill it in from your StreamNative Cloud instance (Cloud course, Lab 0), or run local/write-env.sh for the Local course."
137137
check "runs no ork command" [ ! -s "$FAKE_ORK_DIR/calls.log" ]
138138
}
139139

‎docs/before-you-arrive.md‎

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Before you arrive
22

3-
Ten minutes at home saves thirty at the event. This page prepares your laptop
4-
for the [Cloud course](../labs/cloud/README.md), the one you take at the
5-
hackathon. Pick **one** path; your teammate can pick a different one.
3+
Twenty minutes at home saves an hour at the event. This page prepares your
4+
laptop and your StreamNative Cloud instance for the
5+
[Cloud course](../labs/cloud/README.md), the one you take at the hackathon. Pick
6+
**one** path.
67

78
| Path | Install |
89
|---|---|
910
| **Python** | Python 3.11 or newer |
1011
| **TypeScript** | Node.js 20 or newer |
11-
| **CLI** | Python 3.11+ *or* Node.js 20+, for two helper scripts (the doctor and the data injector) |
12+
| **CLI** | Python 3.11+ *or* Node.js 20+, for three helper scripts (the doctor, the seeder, and the data injector) |
1213

1314
Everyone also needs:
1415

@@ -25,6 +26,9 @@ Everyone also needs:
2526
server when a choice is needed. The browser flow stores tokens directly in the
2627
vault.
2728
- [`jq`](https://jqlang.org/download/), for the checks in every lab.
29+
- [`snctl`](https://docs.streamnative.io/tools/cli/snctl/snctl-overview) (the
30+
StreamNative Cloud CLI): `brew install streamnative/streamnative/snctl`. Lab 0
31+
uses it to read your instance's addresses and to create your topic.
2832

2933
## 1. Get the code
3034

@@ -49,7 +53,7 @@ npm install
4953
```
5054

5155
**CLI**: install `ork` and `jq`, then set up Python or TypeScript as above for
52-
the doctor and the injector.
56+
the doctor, the seeder, and the injector.
5357

5458
## 3. Check your laptop
5559

@@ -58,12 +62,39 @@ python doctor.py --offline # Python or CLI path
5862
npm run doctor -- --offline # TypeScript path
5963
```
6064

61-
Every line should say `PASS`. You'll get your **team card** (your credentials
62-
and endpoints) at the event; [Lab 0](../labs/cloud/00-set-up.md) starts there.
65+
Every line should say `PASS`.
66+
67+
## 4. Set up your instance
68+
69+
The organizers add you to the hackathon organization on StreamNative Cloud, give
70+
you an **instance** of your own, and make a **service account** in it. They give
71+
you its name and its **API key**: keep the key to yourself.
72+
73+
In the StreamNative Cloud console, create three things in your instance, in the
74+
region the organizers name:
75+
76+
- a **Kafka cluster** (Serverless),
77+
- an **agent workspace**,
78+
- a **SQL workspace** that imports your Kafka cluster.
79+
80+
Then log `snctl` in and check that all three are there:
81+
82+
```bash
83+
snctl config init
84+
snctl auth login # opens your browser
85+
snctl config set --organization <org> # the hackathon organization's id, o-...
86+
snctl get kafkaclusters -o custom-columns=NAME:.metadata.name,INSTANCE:.spec.instanceName
87+
snctl get workspaces -o custom-columns=NAME:.metadata.name,INSTANCE:.spec.instanceName
88+
snctl get sqlcatalogs -o custom-columns=NAME:.metadata.name,KAFKA_CLUSTER:.spec.sourceRef.name,SQL_WORKSPACE:.spec.workspaceRef.name
89+
```
90+
91+
The first two lists have a row for your instance, and the SQL catalog list has a
92+
row that names your Kafka cluster and your SQL workspace.
93+
[Lab 0](../labs/cloud/00-set-up.md) reads their addresses into `.env`.
6394

6495
## Want to try it tonight?
6596

6697
The [Local course](../labs/local/README.md) is the same five labs on your own
67-
laptop, with no team card: Ursa for Kafka, RisingWave, and the Orca Agent
68-
Engine in Docker. It needs Docker and an Anthropic API key, and downloads about
69-
5 GB of images, so start it on a good connection.
98+
laptop, with nothing on StreamNative Cloud: Ursa for Kafka, RisingWave, and the
99+
Orca Agent Engine in Docker. It needs Docker and an Anthropic API key, and
100+
downloads about 5 GB of images, so start it on a good connection.

‎docs/tutor.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ last row works in any agent that can read a file.
4949
Started with no request, the tutor asks three things:
5050

5151
```text
52-
1. Course: Cloud (a team card, StreamNative Cloud) or Local (everything on your laptop)?
52+
1. Course: Cloud (your own instance on StreamNative Cloud) or Local (everything on your laptop)?
5353
2. Path: CLI, Python, or TypeScript?
5454
3. What now: start at Lab 0, resume at a lab, quiz me on a lab, or check my setup?
5555
```

‎labs/README.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Two courses teach the same five labs on two stacks. Pick one.
44

55
| | [Cloud course](cloud/README.md) | [Local course](local/README.md) |
66
|---|---|---|
7-
| Runs on | StreamNative Cloud: your team's Kafka cluster, SQL Workspace, and a hosted Agent Engine | Your laptop: Ursa for Kafka, RisingWave, and the Orca Agent Engine |
8-
| You need | A team card, handed out at the hackathon | Docker and an Anthropic API key |
9-
| Time | About 30 minutes | About 45 minutes, plus the image downloads |
10-
| Take it when | You are at the event | You have no team card, or you want to see every part run |
7+
| Runs on | StreamNative Cloud: your own instance, with a Kafka cluster, a SQL workspace, and an agent workspace | Your laptop: Ursa for Kafka, RisingWave, and the Orca Agent Engine |
8+
| You need | A StreamNative Cloud login with your own instance, from the hackathon organizers | Docker and an Anthropic API key |
9+
| Time | About 40 minutes | About 45 minutes, plus the image downloads |
10+
| Take it when | You are at the event | You have no StreamNative Cloud instance, or you want to see every part run |
1111

1212
Both courses use the same three paths for the agent steps. Pick one path and stay
13-
on it; a teammate can pick another.
13+
on it.
1414

1515
- **CLI**: the [`ork`](https://github.com/orca-ae/orca-cli) command line
1616
- **Python**: the [`runorca`](https://pypi.org/project/runorca/) SDK

0 commit comments

Comments
 (0)