Environment Setup

Configure your API Key and Gretel CLI!

This walkthrough will help get an environment setup so you can use Gretel Console and CLI to create and run Gretel models.

We recommend completing the steps below.

The screenshots below are from Gretel's Beta1. New model workflows are not available in Beta1, however you can still use this console to create an account, create an API key, and create an initial project for use with the Gretel CLI and our Beta2 console which will release in July 2021.

Console Signup and Project Creation

  • Signup with Google or GitHub in the Gretel Console.

  • After logging in, select the “API Key” option from the user menu

  • Generate your API key

  • You may now copy this API key when setting up the CLI.

  • Create a project. We recommend creating a single project that can be used for creating and running models. To do this, click the “Projects” option on the top left of the console.

  • On the top right, click "New Project"

  • Select a "Blank Project"

  • Access the “Connect” menu and take note of the Project name, in this case it is user123-d618a.

You will use this Project Name when configuring the CLI

CLI Installation

Next we will install the Gretel CLI and Python client. Both the CLI and the Python SDK are bundled in a single Python package.

The Gretel CLI requires Python 3.7 or greater and Docker.

If you are using a system such as Ubuntu 18.04, etc with a version of Python less than 3.7 installed you can upgrade to a newer version. We’ve provided a script that has been tested with Ubuntu 18.04 and will install Python 3.8 and PIP as the new defaults for the system.

Be sure to run a source ~/.bashrc from your terminal once the script completes.

Gretel Beta2 will require gretel-client version 0.8.0 or greater. For early adopters, you may install and use our release candidate versions.

Once an appropriate version of Python and PIP is installed, you can install Gretel’s python tools.

pip install --pre gretel-client

While Beta2 is under active development, the client will be released under a pre-release tag. Passing --pre when installing via pip will ensure that the latest Beta2 client is installed on your machine. You can find more details about each release on the project's GitHub release page.

CLI Configuration

Next, configure the CLI, this can be done by simply running:

gretel configure

Accept the defaults for the Endpoint and Default Runner steps.

When prompted for your Gretel API Key, paste the key you created in the above steps.

When prompted for your Default Project, paste the Project Name you retrieved in the above steps.

At this point your configuration should have been written to your home directory. To validate the connection to Gretel Cloud try running:

gretel projects search --limit 10

This should return JSON output that shows existing projects you have in your account.

GPU + Docker Configuration (Synthetic Workers Only)

If you will be running synthetic workers in your own environment, we highly encourage you to configure a system with a GPU. Additionally, Docker and the Docker NVIDIA toolkit will need to be installed.

We have created a script that will configure an Ubuntu 18.04 machine with NVIDIA GPUs to work properly with Gretel’s CLI. Provided you have created a VM or setup a machine with Ubuntu and a GPU you can run:

curl https://raw.githubusercontent.com/gretelai/gretel-blueprints/main/utils/gpu_docker_setup.sh | bash

When this script completes you should see output similar to the following:

| NVIDIA-SMI 465.19.01 Driver Version: 465.19.01 CUDA Version: 11.3 |
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
| 0 NVIDIA Tesla T4 On | 00000000:00:04.0 Off | 0 |
| N/A 59C P0 28W / 70W | 0MiB / 15109MiB | 6% Default |
| | | N/A |
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
| No running processes found |

Finally, you will need to configure Docker to allow your current user to run commands, this can be done by running:

sudo groupadd docker
sudo usermod -aG docker $USER

Now log out and back in.

At this point, your machine is now configured to launch Gretel Workers with GPU support.