Setup
This section describes how to install necessary software and authenticate in TractoAI.
CLI and Python SDK
TractoAI is compatible with YTsaurus SDKs. You may use any of them to interact with YTsaurus.
We recommend starting by installing the YTsaurus CLI, which comes as a part of Python ytsaurus-client package. Also, ytsaurus-yson package will be useful.
pip3 install ytsaurus-client ytsaurus-yson
# On fresh systems you may need to add `--break-system-packages` flag, or setup a venv
Check that the installation is successful by running the following command:
yt --version
# Should print something like `Version: YT wrapper 0.13.23`
Also, you may import the Python SDK in your project:
from yt.wrapper import YtClient
Installing Tractorun
Tractorun is a tool to run AI-related workloads on TractoAI. Run the following command to install it:
pip3 install tractorun
# On fresh systems you may need to add `--break-system-packages` flag, or setup a venv
Check that the installation is successful by running the following command:
tractorun --version
# Should print something like `tractorun version 0.61.0`
Authentication in TractoAI
You authenticate in TractoAI in one of the two ways:
- Using a login and password – used for authenticating through UI.
- Using a token – used for programmatic access. A token is a static long-lived string starting with
ytct-.
If you know your login and password, you may issue a token for yourself by logging into the UI, pressing on your avatar in the bottom left corner and selecting "Manage tokens".
Applications using YTsaurus SDKs typically recognize the environment variable YT_TOKEN and use it for authentication if it is set. Also, you may put a token into the ~/.yt/token file:
echo "ytct-..." > ~/.yt/token
chmod 600 ~/.yt/token
Test that the token is set correctly by running the following command:
yt list /
# Should list the root directory.
See also
- Official documentation on YTsaurus Python SDK
- There are other SDKs for YTsaurus.
- C++ SDK is available, but is quite hard in building. Contact TractoAI support if you need it.