How Codeway uses Cloud Storage FUSE for their generative AI avatar portrait maker
Marco Abela
Product Manager, Storage, Google Cloud
Uğur Arpaci
Lead DevOps Engineer, Codeway
In this blog, we hear from Codeway, an app development company that builds innovative apps and games using AI, and how it uses the recently launched Cloud Storage FUSE solution as part of its generative AI workflow on Google Kubernetes Engine (GKE) and Cloud Storage. Cloud Storage FUSE allows objects in Cloud Storage buckets to be accessed as files mounted as a local file system, providing file-system semantics for data stored in Cloud Storage buckets, simplifying deployments and reducing idle time for scarce TPU and GPU resources. In addition, the new first-party Cloud Storage FUSE CSI driver for GKE allows Kubernetes applications to mount Cloud Storage using the familiar Kubernetes API, and is offered as a turn-key deployment managed by Google Cloud. For more on the latest version of Cloud Storage FUSE, read today’s blog.
At Codeway, we build highly scalable mobile apps and games, and our products reach over 115 million users in six continents. We curate bold ideas and transform them into fast moving products — from concept, through development, up to market expansion — and to do so, we’ve incorporated AI into several of our products, including Voi, an AI-based avatar portrait maker that turns uploaded portraits into customizable AI-generated avatars.
The process of generating a custom avatar happens on GKE and Cloud Storage, our source of truth for everything from the user’s uploaded images, their dedicated model, to the images we generate for them. We also use Cloud Storage FUSE integration, which has greatly reduced the complexity of our setup.
When the user joins the platform, we build them their own model data using pictures that they uploaded of themselves and save the model to a Cloud Storage bucket. Then, when the user requests a custom avatar, we rely on Cloud Storage FUSE to perform the read operation.
Previously, we downloaded the files locally first using GSUTIL. Now, with the Cloud Storage FUSE integration, the processes inside our pods access the model files from Cloud Storage on-demand, whenever needed, like regular files on a local file system. This allowed us to eliminate custom logic of copying data locally, substantially decreasing complexity and speeding up inference time.
Further, integration with GKE through the sidecar container injection makes the entire onboarding process easy to manage. It is very easy to authenticate, and the service account access makes it possible to only allow required pods to access required Cloud Storage objects/folders. We are able to manage the access control easily via Google IAM.
Here’s an overview of the workflow:
1. After a user downloads the Voi app, they upload 15 pictures of themselves, which are stored in a Cloud Storage bucket.
2. As soon as the upload is complete, the model training process begins using Pytorch on GKE with GPUs.
3. For each individual user, the application generates a custom AI model as a file in a file system hierarchy that is stored in a Cloud Storage bucket as a binary file.
4. When the user asks the app to generate an image in a given style (e.g., “paint me as a 3D rendered character with big eyes”), the inference pod within GKE accesses the user’s model from the Cloud Storage bucket via the Cloud Storage FUSE integration, treating it like a local file. It then generates the artistic visual, and saves it to a different Cloud Storage bucket.
Typically, users request multiple digital art generation in a given user session, so the user’s model is used a couple of times. In order not to duplicate the user model data across different GKE pods, we implemented internal logic to keep track of which pods have which models in runtime with a specified time-to-live (TTL). After the TTL expires, the user model data file is deleted.
5. Finally, using Google Cloud CDN, the image is then served back to the user.
With Cloud Storage FUSE as a Google Cloud supported product, we’re making it easier for companies to leverage the scale and breadth of Cloud Storage with models that require file system access, eliminating the need to refactor AI applications. Ready to start using Cloud Storage FUSE for your own generative AI data pipelines? Learn more about Cloud Storage FUSE here, and how to get started on GKE.