November 02, 2020
Édouard Bonlieu
@edouardb_
The guide below is based on older versions of Koyeb and Wasabi and will no longer work without modification. This page remains available for reference purposes only. Please let us know on the Koyeb community platform if you would like to see an updated version of this guide.
Koyeb is certified for use with Wasabi. The Koyeb serverless cloud platform allows developers and businesses to run production-grade data-processing apps in minutes.
With Koyeb, you can build your event-driven processing workflows combining Docker containers, custom functions, and ready-to-use processing integration. Trigger your functions when a file is modified in your Wasabi bucket thanks to the Koyeb S3 API gateway.
Koyeb is ideal to process any kind of data, from media files (photos, videos, audio, PDFs) to logs, CSV, and much more.
Combining your Wasabi buckets with the Koyeb serverless engine is the perfect way to benefit from your data by analyzing, optimizing, or transforming them without any complex configurations or infrastructure management.
With Koyeb, you deploy event-driven functions and define which S3 events trigger your functions. For instance, you can easily deploy a function performing image label detection when a new image is uploaded to your bucket, generate video transcripts, resize images, and more.
Spend less time operating complex infrastructures, and spend more time easily building powerful features on top of your data.
To connect your Wasabi bucket to Koyeb, you will need to do the two following steps:
To get started, you need to generate a Wasabi Access key pair to connect your Wasabi bucket to Koyeb. Connecting your Wasabi bucket to Koyeb is a necessary step to access the Koyeb processing engine.
To generate a new Wasabi access key pair, login to your Wasabi account.
Once in your account, click on the key icon in the left-side menu. Then click Create New Access Key.
A modal appears.
A new screen in the modal appears.
You can see your Access Key
. To see your Secret Key
, click Show if you would like to see your Secret Key
.
Click Copy Keys to Clipboard to copy these secret values. You will need these values, Access Key
and Secret Key
, during the next step, which is to connect your Wasabi buckets to Koyeb.
Now that you have generated your Wasabi Secret Keys, make sure to save them in a safe place. You can only see these values once, and they are critical to the security of your data.
Now that you have generated a Wasabi Access Key pair, you can connect your Wasabi bucket to Koyeb. By connecting your Wasabi bucket to Koyeb, Koyeb can receive the events that occur in your Wasabi bucket and trigger your functions when a new image is uploaded.
wasabiaccesskey
wasabiaccesskey
wasabisecretkey
wasabisecretkey
wasabi-koyeb-store
You've now connected your Wasabi bucket to Koyeb! You can upload data here to trigger data-processing functions.
Now that your Wasabi bucket is connected to Koyeb, you can deploy your first processing function!
As mentioned previously, Koyeb allows you to deploy processing functions written in Node.js or Python, Docker containers, or ready-to-use functions from the Koyeb catalog using Koyeb Stacks. Koyeb Stacks are processing environments composed of an event bus to receive events and functions triggered by user-defined events.
Below, we will explain how to deploy functions to process your Wasabi data.
In this example, we will deploy the image resize function. This function allows you to automatically resize images at upload.
To deploy this function, in the Koyeb control panel:
You Stack is now created. It's time to deploy the first revision. Revisions are used to keep a history of your changes and allow you to return to a previous version at any time.
In the dropdown, select Image Resize, the following snippet appears in the editor. To configure the function to resize uploaded images, replace the STORE value with your Koyeb Store name (remove the <>
). You can also edit other parameters as needed.
functions: - name: image-resize use: image-resize@1.0.0 with: STORE: #The store to watch to trigger the function and save the resized image. This parameter is required. <YOUR_VALUE> IMAGE_RESIZE_WIDTH: #The desired image width. Set to auto if not defined. This parameter is optional. 100 IMAGE_RESIZE_PATH: #The path to store the new generated image. This parameter is optional. resized-images/ IMAGE_RESIZE_FORMAT: #The format of the new generated image. This parameter is optional. jpeg
Once ready, click the Deploy revision button.
Your Stack is provisioning your functions and in a few seconds, all images uploaded to your Koyeb Store via the interface or using the Koyeb S3-gateway will be resized automatically.
To confirm everything is working fine, on the Koyeb control panel:
resized-images
appears containing all the images uploaded resized.All the data is stored on the Wasabi cloud!
To learn more about how to deploy Docker containers or custom code, how to use the Koyeb S3 gateway or learn more about Koyeb check out the Koyeb documentation.
Questions or suggestions to improve this guide? Join us on the community platform to chat!
Koyeb is a developer-friendly serverless platform to deploy any apps globally.
Start for freeDeploy 2 services for free and enjoy our predictable pricing as you grow
Get up and running in 5 minutes