Skip to content

Instantly share code, notes, and snippets.

@rochacbruno
Created July 1, 2025 16:22
Show Gist options
  • Save rochacbruno/bd0698651a9d3607bfd0566e95b0faa6 to your computer and use it in GitHub Desktop.
Save rochacbruno/bd0698651a9d3607bfd0566e95b0faa6 to your computer and use it in GitHub Desktop.
Simple Deployer with Gradio
uv run --with gradio gui.py
import time
import gradio as gr
steps = ["generate", "build", "scan", "provision", "config"]
def deploy(image: str, progress=gr.Progress(track_tqdm=True)):
"""Simulate a long running task to deploy an image"""
yield f"starting deploy for {image}"
for step in progress.tqdm(steps):
time.sleep(1)
yield f"processing {step}"
progress(100, desc="finished")
yield f"deploy for {image} finished"
with gr.Blocks(title="test") as gui:
with gr.Row():
with gr.Column():
image = gr.Textbox(label="image")
with gr.Column():
current = gr.Label(label="current step")
progress = gr.Label(label="progress")
with gr.Row():
run = gr.Button("Deploy")
run.click(
fn=deploy,
inputs=[image],
outputs=current,
show_progress=True,
show_progress_on=progress,
)
gui.launch(share=False, quiet=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment