Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion health-and-lifecycle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ This example container demonstrates several lifecycle-management aspects:
* health-check endpoint that is aware of requests being served
* `SIGTERM` handling for graceful shutdown.

Please see [this documentation article](https://docs.datacrunch.io/containers/scaling) for additional discussion.
Please see [this documentation article](https://docs.verda.com/containers/scaling) for additional discussion.
1 change: 0 additions & 1 deletion health-and-lifecycle/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ logging==0.4.9.6
pydantic==2.11.3
pydantic_core==2.33.1
sniffio==1.3.1
starlette==0.46.2
typing-inspection==0.4.0
typing_extensions==4.13.2
uvicorn==0.34.2
4 changes: 2 additions & 2 deletions hello-world/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Hello World! Container

Here is an example of a simple container compatible with DataCrunch serverless containers.
Here is an example of a simple container compatible with Verda serverless containers.

Build:

Expand All @@ -23,7 +23,7 @@ Depending on whether you have a GPU available this will give you the following
{"message":"Hello world, I can run on cpu|gpu!"}
```

To make the container available to DataCrunch Containers, it needs to be pushed to a Docker registry:
To make the container available to Verda Containers, it needs to be pushed to a Docker registry:
```bash
docker push $YOUR_REGISTRY/hello-world:v1
```
Expand Down
8 changes: 4 additions & 4 deletions whisper-async/health-check.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
if [ -z "$DATACRUNCH_DEPLOYMENT" ] || [ -z "$DATACRUNCH_BEARER_TOKEN" ]; then
echo "Error: DATACRUNCH_DEPLOYMENT and DATACRUNCH_BEARER_TOKEN environment variables must be set"
if [ -z "$VERDA_DEPLOYMENT" ] || [ -z "$VERDA_BEARER_TOKEN" ]; then
echo "Error: VERDA_DEPLOYMENT and VERDA_BEARER_TOKEN environment variables must be set"
exit 1
fi

ENDPOINT=https://containers.datacrunch.io/$DATACRUNCH_DEPLOYMENT/health
ENDPOINT=https://containers.datacrunch.io/$VERDA_DEPLOYMENT/health
echo "Connecting to health-check endpoint at $ENDPOINT..."

curl -X GET $ENDPOINT \
--header "Authorization: Bearer $DATACRUNCH_BEARER_TOKEN" \
--header "Authorization: Bearer $VERDA_BEARER_TOKEN" \
--header "Content-Type: application/json"
8 changes: 4 additions & 4 deletions whisper-async/inference-webhook.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/bin/bash
if [ -z "$DATACRUNCH_DEPLOYMENT" ] || [ -z "$DATACRUNCH_BEARER_TOKEN" ]; then
echo "Error: DATACRUNCH_DEPLOYMENT and DATACRUNCH_BEARER_TOKEN environment variables must be set"
if [ -z "$VERDA_DEPLOYMENT" ] || [ -z "$VERDA_BEARER_TOKEN" ]; then
echo "Error: VERDA_DEPLOYMENT and VERDA_BEARER_TOKEN environment variables must be set"
exit 1
fi

PAYLOAD='{
"url": "https://tile.loc.gov/storage-services/media/ls/sagan/1958124-3-1.mp3"
}'

ENDPOINT=https://containers.datacrunch.io/$DATACRUNCH_DEPLOYMENT/generate_webhook
ENDPOINT=https://containers.datacrunch.io/$VERDA_DEPLOYMENT/generate_webhook
echo "Connecting to the generate_webhook endpoint at $ENDPOINT..."

curl -v -X POST $ENDPOINT \
--header "Authorization: Bearer $DATACRUNCH_BEARER_TOKEN" \
--header "Authorization: Bearer $VERDA_BEARER_TOKEN" \
--header "Content-Type: application/json" \
--header "Prefer: respond-async-container" \
--data "$PAYLOAD"
4 changes: 2 additions & 2 deletions whisper-async/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import signal

def do_test_request() -> None:
token = os.environ['DATACRUNCH_BEARER_TOKEN']
deployment_name = os.environ['DATACRUNCH_DEPLOYMENT']
token = os.environ['VERDA_BEARER_TOKEN']
deployment_name = os.environ['VERDA_DEPLOYMENT']
baseurl = "https://containers.datacrunch.io"
inference_url = f"{baseurl}/{deployment_name}/generate"

Expand Down
8 changes: 4 additions & 4 deletions whisper-async/inference.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/bin/bash
if [ -z "$DATACRUNCH_DEPLOYMENT" ] || [ -z "$DATACRUNCH_BEARER_TOKEN" ]; then
echo "Error: DATACRUNCH_DEPLOYMENT and DATACRUNCH_BEARER_TOKEN environment variables must be set"
if [ -z "$VERDA_DEPLOYMENT" ] || [ -z "$VERDA_BEARER_TOKEN" ]; then
echo "Error: VERDA_DEPLOYMENT and VERDA_BEARER_TOKEN environment variables must be set"
exit 1
fi

PAYLOAD='{
"url": "https://tile.loc.gov/storage-services/media/ls/sagan/1958124-3-1.mp3"
}'

ENDPOINT="https://containers.datacrunch.io/$DATACRUNCH_DEPLOYMENT/generate"
ENDPOINT="https://containers.datacrunch.io/$VERDA_DEPLOYMENT/generate"
echo "Performing async inference at $ENDPOINT"

curl -X POST $ENDPOINT \
--header "Authorization: Bearer $DATACRUNCH_BEARER_TOKEN" \
--header "Authorization: Bearer $VERDA_BEARER_TOKEN" \
--header "Content-Type: application/json" \
--header "Prefer: respond-async" \
--data "$PAYLOAD"
6 changes: 3 additions & 3 deletions whisper-async/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import signal

def get_result() -> None:
token = os.environ['DATACRUNCH_BEARER_TOKEN']
deployment_name = os.environ['DATACRUNCH_DEPLOYMENT']
async_task_id = os.environ['DATACRUNCH_TASK_ID']
token = os.environ['VERDA_BEARER_TOKEN']
deployment_name = os.environ['VERDA_DEPLOYMENT']
async_task_id = os.environ['VERDA_TASK_ID']
baseurl = "https://containers.datacrunch.io"
status_url = f"{baseurl}/result/{deployment_name}"

Expand Down
6 changes: 3 additions & 3 deletions whisper-async/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import signal

def get_status() -> None:
token = os.environ['DATACRUNCH_BEARER_TOKEN']
deployment_name = os.environ['DATACRUNCH_DEPLOYMENT']
async_task_id = os.environ['DATACRUNCH_TASK_ID']
token = os.environ['VERDA_BEARER_TOKEN']
deployment_name = os.environ['VERDA_DEPLOYMENT']
async_task_id = os.environ['VERDA_TASK_ID']
baseurl = "https://containers.datacrunch.io"
result_url = f"{baseurl}/status/{deployment_name}"

Expand Down
2 changes: 1 addition & 1 deletion whisper/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12
FROM python:3.14

WORKDIR /app
COPY requirements.txt .
Expand Down
12 changes: 6 additions & 6 deletions whisper/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Whisper Container

Here is an example of fully operational [Whisper-large-v3-turbo](https://huggingface.co/openai/whisper-large-v3-turbo) endpoint containerized for use with DataCrunch containers.
Here is an example of fully operational [Whisper-large-v3-turbo](https://huggingface.co/openai/whisper-large-v3-turbo) endpoint containerized for use with Verda containers.

This container implements two endpoints:

* `/generate` - a standard Whisper speech-to-text endpoint
* `/health` - health-check on the container used by DataCrunch Containers to make sure the container us running and healthy.
* `/health` - health-check on the container used by Verda Containers to make sure the container us running and healthy.

Build:

Expand All @@ -18,13 +18,13 @@ Push to a Docker registry:
docker push $YOUR_REGISTRY/whisper:v1
```

When the container starts, it will fetch the model weights from Hugging Face. Therefore, to run the container you will need to supply your [Hugging Face User access token](https://huggingface.co/docs/hub/en/security-tokens) as an environment variable `HF_TOKEN`. This can be easily done via DataCrunch Containers UI.
When the container starts, it will fetch the model weights from Hugging Face. Therefore, to run the container you will need to supply your [Hugging Face User access token](https://huggingface.co/docs/hub/en/security-tokens) as an environment variable `HF_TOKEN`. This can be easily done via Verda Containers UI.

Once the container has been deployed on DataCrunch, and the endpoint is runnning, you can testing by running the following, which will send the `audio.wav` file to the endpoint for transcription:
Once the container has been deployed on Verda, and the endpoint is runnning, you can test it by running the following, which will send the `audio.wav` file to the endpoint for transcription:

```bash
export DATACRUNCH_CONTAINER_URL=https://containers.datacrunch.io/<NAME_OF_YOUR_DEPLOYMENT>/generate
export DATACRUNCH_BEARER_TOKEN=dc_<YOUR_BEARER_TOKEN>
export VERDA_CONTAINER_URL=https://containers.datacrunch.io/<NAME_OF_YOUR_DEPLOYMENT>/generate
export VERDA_BEARER_TOKEN=dc_<YOUR_BEARER_TOKEN>

./inference.sh
```
Expand Down
8 changes: 4 additions & 4 deletions whisper/health-check.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
if [ -z "$DATACRUNCH_CONTAINER_URL" ] || [ -z "$DATACRUNCH_BEARER_TOKEN" ]; then
echo "Error: DATACRUNCH_CONTAINER_URL and DATACRUNCH_BEARER_TOKEN environment variables must be set"
if [ -z "$VERDA_CONTAINER_URL" ] || [ -z "$VERDA_BEARER_TOKEN" ]; then
echo "Error: VERDA_CONTAINER_URL and VERDA_BEARER_TOKEN environment variables must be set"
exit 1
fi

curl -X GET "$DATACRUNCH_CONTAINER_URL/health" \
--header "Authorization: Bearer $DATACRUNCH_BEARER_TOKEN" \
curl -X GET "$VERDA_CONTAINER_URL/health" \
--header "Authorization: Bearer $VERDA_BEARER_TOKEN" \
--header "Content-Type: application/json"
10 changes: 5 additions & 5 deletions whisper/inference.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
if [ -z "$DATACRUNCH_CONTAINER_URL" ] || [ -z "$DATACRUNCH_BEARER_TOKEN" ]; then
echo "Error: DATACRUNCH_CONTAINER_URL and DATACRUNCH_BEARER_TOKEN environment variables must be set"
if [ -z "$VERDA_CONTAINER_URL" ] || [ -z "$VERDA_BEARER_TOKEN" ]; then
echo "Error: VERDA_CONTAINER_URL and VERDA_BEARER_TOKEN environment variables must be set"
exit 1
fi

echo "Calling API at $DATACRUNCH_CONTAINER_URL/generate"
echo "Calling API at $VERDA_CONTAINER_URL/generate"

curl -X POST \
-F "file=@audio.wav" \
"$DATACRUNCH_CONTAINER_URL/generate" \
--header "Authorization: Bearer $DATACRUNCH_BEARER_TOKEN"
"$VERDA_CONTAINER_URL/generate" \
--header "Authorization: Bearer $VERDA_BEARER_TOKEN"
6 changes: 3 additions & 3 deletions whisper/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
fastapi==0.115.12
uvicorn==0.34.2
torch==2.6.0
torchaudio==2.6.0
transformers==4.51.3
torch==2.9.0
torchaudio==2.9.0
transformers==4.53.0
soundfile==0.13.1
safetensors==0.5.3
accelerate==1.6.0
Expand Down