Deploying Your First Application on SaladCloud
Welcome to Salad Container Engine (SCE), a fully managed container service for deploying AI and simulation workloads to our global network of idle GPUs. Unlike traditional cloud providers, SaladCloud operates a decentralized marketplace where individuals can sell idle compute time on their PCs, and businesses can run workloads at industry-low costs. This guide walks you through deploying a simple FastAPI application on SCE. Before continuing, make sure you have:- A SaladCloud account
- An organization created in the portal
- At least a few dollars in credits added to your account
Step 1: Prepare Your Application
We’ll deploy a simple FastAPI server with aGET /hello
endpoint and basic probe endpoints (/started
, /live
,
/ready
). The /hello
route returns a greeting and the machine ID via environment variable injection at runtime. While
the probe routes aren’t meaningful in this demo, SCE can use them to manage container lifecycle events.
app.py
Dockerfile
The Dockerfile uses the Python 3.13 base image, installs dependencies, and runs the server withuvicorn
. Ensure your
server listens on both IPv4 and IPv6 by using --host *
, as SaladCloud requires IPv6 compatibility.
Dockerfile
Step 2: Push Your Container Image
Build and push your container image to a registry. In this example, we use Docker Hub:Step 3: Create a Container Group
In the SaladCloud Portal:- Navigate to your organization and project (e.g., “salad-benchmarking / Default”).
- Click Create Container Group.
- Choose Custom (instead of a preconfigured Recipe).
-
Set the name to
hello-world
. -
Under Image Source, enter
saladtechnologies/misc:hello-world
. - Set Replicas to 3 for high availability across potentially unreliable nodes.
-
Skip env vars and command overrides for this example (optional: use
sleep infinity
for debugging). -
Configure Hardware:
- CPU: 1 vCPU
- RAM: 1 GB
- GPU: None (select one or more if needed; Salad matches your workload to one).
- Skip Storage for this example (note: storage is ephemeral).
Step 4: Configure Network Access
- Enable Container Gateway to expose your app via a load balancer.
- Set Port to
8000
. - Choose Round Robin load balancing for this demo (Least Connections is preferred for AI workloads).
- Authentication is optional—if enabled, include your Salad API key in the
Salad-Api-Key
header. - Optionally restrict concurrency to 1 request per instance. Not relevant for this demo, but useful for workloads with high vram usage.
Step 5: Set Health Probes
Configure HTTP probes to manage instance lifecycle:Startup Probe (/started
)
- Initial Delay:
0
- Period:
1s
- Timeout:
1s
- Success Threshold:
1
- Failure Threshold:
5
Liveness Probe (/live
)
- Starts after startup probe succeeds
- Detects deadlocks or unresponsive processes
- Failure Threshold:
3
Readiness Probe (/ready
)
- Controls load balancer routing
- Can be used to reject new traffic during internal queue saturation
Step 6: Deploy
- Enable Auto Start.
- Click Deploy.
- Watch your instances move through “Allocating” → “Starting” → “Running” → “Ready”.
- Each replica is assigned to its own machine.
- You will not be billed while instances are down or being reallocated.
Step 7: Test Your Deployment
- Access the app via the container gateway URL (e.g.,
https://tomato-navybean-pm82t0txwjyus8yy.salad.cloud/hello
). - The response should include the text
Hello, World!
and a machine ID. - Refreshing may show different machine IDs as traffic is distributed.
Step 8: Monitor and Debug
- Instance Details: Run shell commands or inspect logs.
- System Events: View instance reallocations, exit codes, and lifecycle events.
- Container Logs: View logs across all instances (use an external provider like Axiom for production).
Clean Up
- Click Stop to terminate the container group and stop billing.