Pergolize: Mojo🔥

“The future of AI development starts here”
“The programming language for all AI developers”

This is what they say about Chris Lattner’s newest project. The father of the compiler LLVM and the programming language Swift, has a new Project in his oven. It is called Mojo, basically a superset of Python, and it promises to provide a wide range of possibilities to increase the performance of your AI or data science code. Can they keep their promise? The answer is: I don’t know. I’m not a data scientist, but probably you are, so I will show you how to deploy a Mojo development environment in a few minutes by using Pergola, and you can find it out by yourself.


To create a new project, we can just use the template repository provided by Pergola:

The mentioned repository already contains all necessary files,
however, you want to use your own API key for the Mojo sdk.
To do so, you can clone the repository and replace YOUR_UNIQUE_API_KEY in the pergola.yaml file with your own key.
You can get a key for free here.

Commit your changes & create the project
pergola create project mojo-notebook --git-url

Make sure to use your own git repository when creating the project.

Now you are done with the “hard” part.

Push the build

Just push the build via CLI or in the UI, that shouldn’t take too long,

pergola push build -p mojo-notebook
Create a stage

create a stage while Pergola does all the work in the background,

pergola create stage dev -p mojo-notebook --type dev 
Push the release

and when ready, push the build to your stage. That’s it.

pergola push release -p mojo-notebook -s dev -b main_b1
Check the status

You should now be able to see your deployed component:

pergola list component -p mojo-notebook -s dev

And if everything goes right and your ingress is ready, you’re good to go!

Now you have your own mojo notebook and can do whatever data scientists do!

Please keep in mind that using an ingress exposes the notebook to the network Pergola operates in, so anyone with access to that network can also access your notebook. This is not meant to be used in production or for the work with confidential data.
Also, since the Mojo sdk needs the API key already in the build process, you will need to commit it in your Pergola manifest within the git repository. Make sure to not make the repository publicly available with the plain API key in the VCS.  

Leave a Reply

Your email address will not be published. Required fields are marked *

Cookie Consent with Real Cookie Banner