diff --git a/charts/flux-image-gen/templates/ui/configmap.yaml b/charts/flux-image-gen/templates/ui/configmap.yaml index 4773ef9..c03bca7 100644 --- a/charts/flux-image-gen/templates/ui/configmap.yaml +++ b/charts/flux-image-gen/templates/ui/configmap.yaml @@ -13,4 +13,4 @@ data: address: {{ printf "http://%s.%s.svc:%v" ( printf "%s-%s-api" (include "flux-image-gen.fullname" $) . ) $.Release.Namespace $.Values.api.service.port }} {{- end }} example_prompt: | - {{- .Values.examplePrompt | nindent 6 -}} + {{- .Values.examplePrompt | trimSuffix "\n" | nindent 6 -}} diff --git a/charts/flux-image-gen/values.yaml b/charts/flux-image-gen/values.yaml index b5d97b4..06303d2 100644 --- a/charts/flux-image-gen/values.yaml +++ b/charts/flux-image-gen/values.yaml @@ -85,13 +85,13 @@ api: deploymentStrategy: type: Recreate - # Downloading 100GB+ of model weights can take a long time so - # it's difficult to give these probes sensible default values... + # Downloading model weights can take a long time so it's + # difficult to give these probes sensible default values + # Is 30 minutes long enough...? startupProbe: # httpGet: # path: / # port: http - # Is 30 minutes long enough...? # failureThreshold: 180 # periodSeconds: 10 livenessProbe: diff --git a/web-apps/chat/requirements.txt b/web-apps/chat/requirements.txt index 9e080e4..18dbfd7 100644 --- a/web-apps/chat/requirements.txt +++ b/web-apps/chat/requirements.txt @@ -1,4 +1,4 @@ -gradio<5 +gradio==4.21 # v4.41 breaks custom JS query param parsing gradio_client openai langchain diff --git a/web-apps/flux-image-gen/api_server.py b/web-apps/flux-image-gen/api_server.py index 777857a..1d89e3f 100644 --- a/web-apps/flux-image-gen/api_server.py +++ b/web-apps/flux-image-gen/api_server.py @@ -31,6 +31,9 @@ class ImageGenInput(BaseModel): prompt: str add_sampling_metadata: bool +@app.get("/") +def health_check(): + return "Server is running" @app.get("/model") async def get_model(): diff --git a/web-apps/flux-image-gen/gradio_ui.py b/web-apps/flux-image-gen/gradio_ui.py index 95f09e4..658b5e4 100644 --- a/web-apps/flux-image-gen/gradio_ui.py +++ b/web-apps/flux-image-gen/gradio_ui.py @@ -18,7 +18,9 @@ class Model(BaseModel): class AppSettings(BaseModel): models: List[Model] - example_prompt: str + example_prompt: str = "Yoda riding a skateboard." + title: str = "Flux Image Generation Demo" + settings_path = pathlib.Path("/etc/gradio-app/gradio_config.yaml") @@ -93,9 +95,8 @@ async def generate_image( return image, seed, filename, None - -with gr.Blocks() as demo: - gr.Markdown("# Flux Image Generation Demo") +with gr.Blocks(title=settings.title) as demo: + gr.Markdown(f"# {settings.title}") with gr.Row(): with gr.Column(): diff --git a/web-apps/image-analysis/requirements.txt b/web-apps/image-analysis/requirements.txt index a54cba5..dd2933d 100644 --- a/web-apps/image-analysis/requirements.txt +++ b/web-apps/image-analysis/requirements.txt @@ -1,6 +1,6 @@ pillow requests -gradio<5 +gradio==4.21 # v4.41 breaks custom JS query param parsing gradio_client pydantic structlog diff --git a/web-apps/kind-images.sh b/web-apps/kind-images.sh index 4a63498..388f382 100755 --- a/web-apps/kind-images.sh +++ b/web-apps/kind-images.sh @@ -7,14 +7,32 @@ if [[ -z $1 ]]; then exit 1 fi +# Work around storage limits in GH runners +if [[ $CI == "true" ]]; then + DIR=/mnt/gimme-more-space + sudo mkdir -p $DIR + sudo chown -R $USER:$USER $DIR + TAR_PATH=$DIR/image.tar +else + TAR_PATH="./image.tar" +fi + REMOTE_TAG=$1 CLUSTER_NAME=${2:-kind} echo Kind cluster name: $CLUSTER_NAME KIND_TAG=local for image in $(find_images .); do full_name=ghcr.io/stackhpc/azimuth-llm-$image-ui - echo $full_name + echo $full_name:{$REMOTE_TAG,$KIND_TAG} docker pull $full_name:$REMOTE_TAG docker image tag $full_name:$REMOTE_TAG $full_name:$KIND_TAG - kind load docker-image -n $CLUSTER_NAME $full_name:$KIND_TAG + # NOTE(scott): The 'load docker-image' command saves the + # intermediate tar archive to /tmp which has limited space + # inside a GH runner so do each step manually here instead. + # kind load docker-image -n $CLUSTER_NAME $full_name:$KIND_TAG + # Apparently there's a separate 75G disk at /mnt so try using it. + docker image save -o $TAR_PATH $full_name:$KIND_TAG + docker image rm $full_name:{$REMOTE_TAG,$KIND_TAG} + kind load image-archive -n $CLUSTER_NAME $TAR_PATH + rm $TAR_PATH done