Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c83ca40
cp(#2351): Move backend READMEs to docs folder and fix relative path …
rmccorm4 Aug 16, 2025
5bb296a
cp(#2346): Move hello_world example README to docs, swap symlinks, fi…
rmccorm4 Aug 16, 2025
ce14f57
docs: Copy over index.rst and hidden_toctree.rst from v0.4.0 to main
rmccorm4 Aug 17, 2025
5a8d52e
Revert "cp(#2351): Move backend READMEs to docs folder and fix relati…
rmccorm4 Aug 17, 2025
016d2c1
Revert "cp(#2346): Move hello_world example README to docs, swap syml…
rmccorm4 Aug 17, 2025
915847c
Rename multimodal_v1 to multimodal, and fix sglang link
rmccorm4 Aug 17, 2025
201c7f9
Bring back missing benchmark README
rmccorm4 Aug 17, 2025
241c614
Fix all broken links caught by lychee
rmccorm4 Aug 17, 2025
eac4cc5
Add github action for link validation (lychee)
rmccorm4 Aug 17, 2025
fc63b57
Update RELEASE_VERSION to 0.4.0 in dynamo_deploy quickstart
rmccorm4 Aug 17, 2025
ced1a73
Merge branch 'main' into rmccormick/cp_anish_docs_to_main
rmccorm4 Aug 17, 2025
8d6be0a
Remove benchmark README for easier review - will restore in a separat…
rmccorm4 Aug 17, 2025
f7f9350
Merge branch 'rmccormick/cp_anish_docs_to_main' of github.com:ai-dyna…
rmccorm4 Aug 17, 2025
a8e5396
Remove unused env var from link check action
rmccorm4 Aug 17, 2025
8d0e50b
Add WAR for lychee cert error
rmccorm4 Aug 17, 2025
c3ec608
Address CodeRabbit feedback
rmccorm4 Aug 17, 2025
4381aa8
Address CodeRabbit feedback - add TODO in workflow for lychee install
rmccorm4 Aug 17, 2025
ef0b231
Try installing ca-certs for cert errors
rmccorm4 Aug 17, 2025
fdfd807
Set GITHUB_TOKEN to avoid github rate limits on URL checks
rmccorm4 Aug 17, 2025
6b7c690
Add lychee result caching
rmccorm4 Aug 17, 2025
3e60e42
Add lychee result caching docs reference
rmccorm4 Aug 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "cp(#2346): Move hello_world example README to docs, swap syml…
…inks, fix relative paths to docs"

This reverts commit 5bb296a.
  • Loading branch information
rmccorm4 committed Aug 17, 2025
commit 016d2c15a24779da9a25c38c116dad5460154cfc
122 changes: 0 additions & 122 deletions docs/examples/runtime/hello_world/README.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/examples/runtime/hello_world/README.md
1 change: 0 additions & 1 deletion examples/runtime/hello_world/README.md

This file was deleted.

122 changes: 122 additions & 0 deletions examples/runtime/hello_world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<!--
SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Hello World Example

This is the simplest Dynamo example demonstrating a basic service using Dynamo's distributed runtime. It showcases the fundamental concepts of creating endpoints and workers in the Dynamo runtime system.

## Architecture

```text
Client (dynamo_worker)
┌─────────────┐
│ Backend │ Dynamo endpoint (/generate)
└─────────────┘
```

## Components

- **Backend**: A Dynamo service with an endpoint that receives text input and streams back greetings for each comma-separated word
- **Client**: A Dynamo worker that connects to and sends requests to the backend service, then prints out the response

## Implementation Details

The example demonstrates:

- **Endpoint Definition**: Using the `@dynamo_endpoint` decorator to create streaming endpoints
- **Worker Setup**: Using the `@dynamo_worker()` decorator to create distributed runtime workers
- **Service Creation**: Creating services and endpoints using the distributed runtime API
- **Streaming Responses**: Yielding data for real-time streaming
- **Client Integration**: Connecting to services and processing streams
- **Logging**: Basic logging configuration with `configure_dynamo_logging`

## Getting Started

## Prerequisites

Before running this example, ensure you have the following services running:

- **etcd**: A distributed key-value store used for service discovery and metadata storage
- **NATS**: A high-performance message broker for inter-component communication

You can start these services using Docker Compose:

```bash
# clone the dynamo repository if necessary
# git clone https://github.com/ai-dynamo/dynamo.git
cd dynamo
docker compose -f deploy/docker-compose.yml up -d
```

### Running the Example

First, start the backend service:
```bash
cd examples/runtime/hello_world
python hello_world.py
```

Second, in a separate terminal, run the client:
```bash
cd examples/runtime/hello_world
python client.py
```

The client will connect to the backend service and print the streaming results.

### Expected Output

When running the client, you should see streaming output like:
```text
Hello world!
Hello sun!
Hello moon!
Hello star!
```

## Code Structure

### Backend Service (`hello_world.py`)

- **`content_generator`**: A dynamo endpoint that processes text input and yields greetings
- **`worker`**: A dynamo worker that sets up the service, creates the endpoint, and serves it

### Client (`client.py`)

- **`worker`**: A dynamo worker that connects to the backend service and processes the streaming response

## Deployment to Kubernetes

Note that this a very simple degenerate example which does not demonstrate the standard Dynamo FrontEnd-Backend deployment. The hello-world client is not a web server, it is a one-off function which sends the predefined text "world,sun,moon,star" to the backend. The example is meant to show the HelloWorldWorker. As such you will only see the HelloWorldWorker pod in deployment. The client will run and exit and the pod will not be operational.


Follow the [Quickstart Guide](../../../docs/guides/dynamo_deploy/quickstart.md) to install Dynamo Cloud.
Then deploy to kubernetes using

```bash
export NAMESPACE=<your-namespace>
cd dynamo
kubectl apply -f examples/runtime/hello_world/deploy/hello_world.yaml -n ${NAMESPACE}
```

to delete your deployment:

```bash
kubectl delete dynamographdeployment hello-world -n ${NAMESPACE}
```