At a very high level, this demo uses generative AI with OpenAI to take in prompts, generates images with Dall-E and places them into a database. It consists of three parts, which are explained later.
Table of Contents
Have the following CLIs:
TODO: add kubens to not need -n gen
Other:
- An OpenAI API key and API access
TODO: add docs link
We will need a:
- Kubernetes cluster
- Container registry
- PostgreSQL database
If you use the Hivenetes k8s boostrapper you can have it create all of these resources for you:
- Clone https://github.com/hivenetes/k8s-bootstrapper
- Follow the Terraform instructions
Note: Enable the database in
bootstrapper.tfvars
before runningterraform plan
. You can also enable the container registry if you want to use it instead of Docker Hub.
This application takes in prompts for OpenAI and launches jobs for each prompt.
This app uses bash to talk to the OpenAI API to create a Dall-E image. It then stores these prompts and image URLs into a database.
This is a Java application that uses Spring Data and Spring Web to create a database table and REST endpoint to make GET and POST requests. It's specifically for a PostgreSQL database.
- Create gen namespace
kubectl apply -f k8s/namespace.yaml
- Create and run database app
- Create and run image generator and store app
- Create and run launcher app
- Observability
- Display prompts and URLs as images on webpage
- Convert all bash to Java+Spring
- Use secrets for OpenAI key
- Use DigitalOcean spaces to store secrets
- Use secrets for database application.properties
- Create service account vs using default one
- Have a webpage to put prompts into vs running a pod
- Add image creation dates so the database can drop anything that has a timestamp before a current subset -- e.g. OpenAI Dall-E only stores images for an hour, so after this, the URLs don't work.
- Add tests