Skip to main content

Turbine Next

· 2 min read
@jmar910

Our Meroxa CLI version v2.20.0 includes the newest versions of the Turbine SDKs for Go, Javascript, and Python.

Already deployed apps and newly initialized apps will not require any changes, but if you would like to re-deploy or re-run any existing Turbine apps with this CLI version, you will have to make some updates to your application.

Due to the updated versions of the Turbine SDKs, you should notice speed ups with app initialization times as well as deploying times ⚡️ thanks to the following changes:

  • Refactored logic that centralizes common functionality from the SDK using gRPC
  • Reduced the amount of 'moving parts' and intermediate communication between the SDKs and CLI
  • Significantly reduced dependencies for turbine-js

These speed ups will vary depending on your language, for example javascript apps now initialize and deploy ~10 seconds faster.

Updating Turbine App for re-deploy/re-run

Go

Ensure you have the latest version of turbine-go by running the following commands in your project root

go get github.com/meroxa/turbine-go@latest

In the app.go file of your app, change these imports

"github.com/meroxa/turbine-go"
"github.com/meroxa/turbine-go/runner"

to

"github.com/meroxa/turbine-go/pkg/turbine"
"github.com/meroxa/turbine-go/pkg/turbine/cmd"

Also in app.go, in the main function change this line

runner.Start(App{})

to

cmd.Start(App{})

Lastly, in app.go, calling the Process function should be updated to also return an error, for example

res, err := v.Process(rr, Anonymize{})
if err != nil {
return err
}

🎉

Javascript

In the package.json of your app, change this line

"turbine-js-framework": "^1.1.1"

to

"turbine-js": "^2.0.0"

and then run npm install from the project root

🎉

Python

In the main.py of your app, change these lines

from turbine.runtime import RecordList
from turbine.runtime import Runtime

to

from turbine.src.turbine_app import RecordList, TurbineApp

and ensure that your run function has the following signature

async def run(turbine: TurbineApp)

Also, make sure your requirements.txt includes the following dependencies

turbine-py>=1.8.4
aiohttp>=3.8.1
grpcio>=1.44.0
grpcio-tools>=1.44.0
protobuf>=3.20.0
grpcio-reflection>=1.44.0
grpcio-health-checking>=1.44.0

and run pip3 install -r requirements.txt from the project root

🎉

For any questions or comments: