CLI
What is Datature's CLI?
Datature constantly strives to make MLOps accessible for all users, from individual developers to large enterprises with established codebases. With that in mind, one of the tools we are making accessible is our Command Line Interface (CLI), which allows you to easily perform general interactions at all the essential steps of the MLOps pipeline just through simple shell commands.
The main function categories are as follows:
Function Category | Description |
---|---|
Project Management | This gives you the essential functions to authing and lists basic information about your projects. |
Asset Management | This deals with the upload and lists basic information of assets on the Nexus platform. |
Annotation Management | This deals with the upload and download of annotations stored on the Nexus platform. |
Artifact Management | This allows users to download the artifact models stored on the Nexus platform. |
Inference Batch Job Management | This allows users to manage resources related to batch job inference. |
How to Get Started
Install Python 3.8 or Above
As this is an SDK for Python, users will need to ensure that they have Python installed. As of now, we currently fully support all versions of Python from 3.8 or above. If you are having issues with the SDK, please ensure that your environment uses an Python version that is fully supported, or else we are not able to guarantee functionality or fixes.
Install Datature's CLI
To make installation as simple as possible, we have made the Python package available on PIP, Python's most popular package installation tool. After ensuring you have pip installed in your environment, which should come with a standard Python installation, you can simply enter the following command below.
pip install --upgrade datature
The CLI will be included in the installation of the pip package.
Authentication
The final step that is essential to all successful requests is to ensure that you log on to the platform, access the relevant project, and store the project secret key which can be found in Integrations. As mentioned in the following link, only the project owner or those with relevant permissions can have access to the project secret on the platform. For more details on the project key and secret key, check out this link for more information.
Once you have the project secret, you will now be able to make API requests using the CLI by entering the command datature projects auth
:
datature projects auth
[?] Enter the project secret: ************************************************
[?] Make [Your Project Name] the default project? (Y/n): y
Authentication succeeded.
You will now be able to run your desired CLI commands as outlined above. To see all possible functions as well as view the required inputs and expected outputs, check out the above documentation.
Common Questions
How do I resolve the command not found: datature error for the CLI?
The command not found: datature
error indicates that the Datature SDK/CLI tool is not installed properly in your system's PATH, or it has not been installed at all. To resolve this error, please follow these steps:
Ensure Datature CLI is Installed
Before anything else, verify that you've installed the Datature CLI. You can install it using pip with the following command:
pip install datature
If you're using a virtual environment (which is recommended), ensure that it's activated before running the installation command.
Check Your PATH
After installation, the datature
command should be automatically added to your system's PATH. If it's not found, you may need to manually add the directory containing the datature executable to your PATH:
which datature
# or
pip show datature
As expected, it will show the location of the package like this:
Location: /Users/.pyenv/versions/3.8.18/lib/python3.8/site-packages
Add the Path to Your Profile
Open your shell profile file with a text editor. This file could be one of ~/.bash_profile
, ~/.bashrc
, ~/.zshrc
, etc., depending on which shell you use and the specific configuration of your operating system.
For example, you can add the path using the following command:
echo 'export PATH="$PATH:/path/to/datature"' >> ~/.bash_profile
Replace /path/to/datature
with the actual path you found with which datature
or pip show datature
.
Restart Your Terminal
Sometimes, changes to the PATH environment variable do not take effect until you open a new terminal session. After installation or modification of the PATH, close your current terminal and open a new one, then try the command again.
What does the warning As the c extension couldn't be imported, google-crc32c is using a pure python implementation that is significantly slower. If possible, please configure a c build environment and compile the extension
mean, and do I need to take any action?
As the c extension couldn't be imported, google-crc32c is using a pure python implementation that is significantly slower. If possible, please configure a c build environment and compile the extension
mean, and do I need to take any action?This warning indicates that the google-crc32c
library is falling back to a pure Python implementation for calculating CRC32C checksums because it cannot find the C extension which is usually faster. The Python implementation is fully functional but performs slower than its C counterpart. While this won't harm the function of the library, you may experience performance issues if your application requires high-speed checksum computing.
To address this warning for improved performance, you can take the following steps to compile the C extension:
Install the Build Essentials
Make sure that you have the necessary build tools installed to compile the C extension.
On Ubuntu/Debian systems, you can install build-essential by running:
sudo apt-get install build-essential
On Red Hat/CentOS systems, you can use:
sudo yum install gcc gcc-c++ make
On macOS, ensure you have Xcode Command Line Tools installed:
xcode-select --install
Re-Install google-crc32c
with C Extension
google-crc32c
with C ExtensionWith the build environment configured, you can attempt to reinstall the google-crc32c library which should now include the C extension:
pip install --no-cache-dir --force-reinstall google-crc32c
By taking these steps, you should be able to eliminate the warning by having the faster C extension compiled and used by google-crc32c. If speed is not critical for your use case, you can choose to ignore this warning, and the library will still function correctly, albeit with potentially decreased performance.
Updated 4 months ago