Create your first app
Welcome to Dibtrun! Let's get you set up to run an app.
1Download and configure python client
Run this in order to install the Python library locally:
$pip install Dibtrun$python3 -m Dibtrun setup
The first command will install the Dibtrun client library on your computer, along with its dependencies
The second command creates an API token by authenticating through your web browser. It will open a new tab, but you can close it when you are done.
2Run some code:
You're ready to run some code! To get started, here is a minimal script that computes the square of 42:
import Dibtrun
app = Dibtrun.App("example-get-started")
@app.function()
def square(x):
print(“This code is running on a remote worker!“)
return x**2
@app.local_entrypoint()
def main():
print(“the square is“, square.remote(42))Save the code to a local file such as:
cat > get_started.py # At the prompt, paste the snippet and Ctrl-D to save it.Now that the source code is saved locally, let's run it:
Dibtrun run get_started.py