Duckietown Shell (dts)#

This section describes how to install and set up dts (Duckietown Shell), a CLI (Command-Line Interface) program that is used for Duckietown-related operations.

What you will need

What you will get

  • A computer with dts installed and correctly set up.

dts Installation#

Attention

If you have already installed dts using pip3, run the following command and follow the on-screen instructions:

pip3 uninstall duckietown-shell

To install dts, run:

pipx install duckietown-shell

Warning

If you are installing the dts on an arm machine you will also need to install the gcc and python3-dev dependencies:

sudo apt install -y gcc python3-dev

This includes Apple Silicon macs with Ubuntu arm64 virtual machines.

Checkpoint 1 ✅#

To verify that dts has been installed correctly:

Test

Run:

which dts

Expected Result

The path to dts.

dts Setup#

To appropriately configure the Duckietown Shell:

  1. Login dts as a Duckietown User

  2. Provide DockerHub credentials

Configure the Duckietown token in the Duckietown Shell#

To perform the initial setup of dts:

  1. Run dts.

  2. Select ente using UpArrow and DownArrow.

  3. Press Enter.

  4. Copy your Duckietown Token.

  5. Paste your Duckietown Token into the terminal.

  6. Press Enter.

  7. Run dts update.

Note

The resulting output after step 6 should look like the following, where UID is your Duckietown UID (User ID):

dts :  Correctly identified as uid = UID

To set a token, run:

dts tok set

To verify a token, run:

dts tok status

Switch to a different dts profile#

To get a list of the available dts profiles, run:

dts profile list

To create a new dts profile:

  1. Run dts profile new.

  2. Select the name of the profile to create using UpArrow and DownArrow.

  3. Press Enter.

  4. Copy your Duckietown Token.

  5. Paste your Duckietown Token into the terminal.

  6. Press Enter.

To switch to a different dts profile, run the following command, where PROFILE is the name of the profile:

dts profile switch PROFILE

Configure Docker in the Duckietown Shell#

We are now going to provide the same username and access token to the shell to automate most of the back-end operations involving Docker.

Attention

  • These credentials are only stored locally;

  • Never use your account password instead of an personal access tokens (PAT);

Recall your DOCKERHUB_USERNAME from Create a DockerHub account and create a PAT following DockerHub instructions on access tokens.

You can pass your DockerHub credentials to the Duckietown Shell by running the following command,

dts config docker credentials set --username DOCKERHUB_USERNAME --password DOCKERHUB_ACCESS_TOKEN

Resetting the Duckietown Shell#

To reset dts, run the following command and follow these instructions again:

rm -rf ~/.duckietown/shell

Checkpoint ✅#

Before we move on, let us make sure you have set our credentials correctly.

Tip

Never skip a checkpoint!
If you have trouble with any of these commands, see the FAQs section below.

Test

If your Docker login was successful, you should be able to run

dts config docker credentials info

Expected Result

You should see an output similar to the following,

Docker credentials:
. registry:   docker.io
. username:   DOCKERHUB_USERNAME
. secret:   DOCKERHUB_ACCESS_TOKEN

Troubleshooting#

Troubleshooting

SYMPTOM

I mistakenly set a wrong/unwanted username or password. How can I update the credentials?

RESOLUTION

Just run the command again with the correct credentials. Only the latest inputs are stored for the same Docker registry.

Troubleshooting

SYMPTOM

I would like to remove my stored Docker credentials. How could I achieve that?

RESOLUTION

Simply use a text editor to remove the section docker-credentials in ~/.dt-shell/config.yaml file.