-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Deploy Gradio UI App as a k8s deployment and service for stable…
… diffusion inference (#461)
- Loading branch information
Showing
18 changed files
with
102 additions
and
101 deletions.
There are no files selected for viewing
54 changes: 0 additions & 54 deletions
54
ai-ml/trainium-inferentia/examples/gradio-ui/README-StableDiffusion.md
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-441 KB
ai-ml/trainium-inferentia/examples/gradio-ui/gradio-app-stable-diffusion-xl.png
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
...ainium-inferentia/examples/inference/ray-serve/stable-diffusion-inf2/gradio-ui/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Use Python base image | ||
FROM --platform=linux/amd64 python:3.9-slim | ||
|
||
# Set working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy the Python script into the container | ||
COPY gradio-app-stablediffusion.py /app/gradio-app-stablediffusion.py | ||
|
||
RUN pip install --no-cache-dir gradio requests Pillow | ||
|
||
# Command to run the Python script | ||
ENTRYPOINT ["python", "gradio-app-stablediffusion.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...nferentia/examples/inference/ray-serve/stable-diffusion-inf2/gradio-ui/gradio-deploy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: gradio | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: gradio-deployment | ||
namespace: gradio | ||
labels: | ||
app: gradio | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: gradio | ||
template: | ||
metadata: | ||
labels: | ||
app: gradio | ||
spec: | ||
containers: | ||
- name: gradio | ||
image: public.ecr.aws/data-on-eks/gradio-app:sd-v1.0 | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- containerPort: 7860 | ||
resources: | ||
requests: | ||
cpu: "512m" | ||
memory: "2048Mi" | ||
limits: | ||
cpu: "1" | ||
memory: "4096Mi" | ||
env: | ||
- name: MODEL_ENDPOINT | ||
value: "/imagine" | ||
#Please note that the service name is currently hardcoded to match the Stable Diffusion service for this blueprint. If there are any updates or changes to the actual RayServe deployment, you'll need to update the service name in this code accordingly. | ||
- name: SERVICE_NAME | ||
value: "http://stablediffusion-service.stablediffusion.svc.cluster.local:8000" | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: gradio-service | ||
namespace: gradio | ||
spec: | ||
selector: | ||
app: gradio | ||
ports: | ||
- name: http | ||
protocol: TCP | ||
port: 7860 | ||
targetPort: 7860 | ||
type: ClusterIP |
File renamed without changes.
File renamed without changes.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,3 @@ provider "helm" { | |
token = data.aws_eks_cluster_auth.this.token | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters