Using deploy tokens
If you run lmrtfy with a headless setup (Raspberry Pi, server, google colab, ..) you cannot use
lmrtfy login
to authenticate.
To mitigate this issue you can create a deployment token from the catalog. The deployment token is valid for the function that has been specified.
The following listing creates a token for <funtion>
in <namespace>
. This can be any function
available owned by you.
IPython listing | |
---|---|
1 2 3 4 5 6 7 |
|
The token always starts with LMRTFY
. The token_id
is needed to revoke the deployment key when you
don't want to use it anymore. Keep the deployment token secret.
In order to use deployment key you need to set the LMRTFY_ACCESS_TOKEN
environment variable:
$ LMRTFY_ACCESS_TOKEN="LMRTFY..." lmrtfy deploy <script.py> --local --namespace="<namespace>"
This way you can use lmrtfy
on any platform, that does not allow a regular login. <namespace>
is the same namespace that is used in the first listing.
To revoke the deployment key, you just need to do the following:
Revoke the key | |
---|---|
1 2 |
|
Note
Tokens will be available in the web app.