Duckietown Shell (dts)
Contents
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
dtsinstalled and correctly set up.
Duckietown Shell (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
The Duckietown Shell is pre-installed in Workspaces. Run the checkpoint to verify it is working as intended.
Warning
If you are installing 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.
Duckietown Shell (dts) configuration#
To appropriately configure the Duckietown Shell:
Logging in the Duckietown Shell#
To log into dts with your user configurations:
Open a terminal and run
dtsSelect
enteusing UpArrow and DownArrow.Press Enter.
Obtain and copy your Duckietown token
Paste your
dt2token into the terminal.Press Enter.
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
Switching user in the Duckietown Shell#
You can switch users logged into dts by with:
dts tok set
To verify which user is logged in:
dts tok status
Duckietown Shell (dts) profiles#
To get a list of the available dts profiles, run:
dts profile list
to see the available profiles. E.g.,
| Profile | Distribution | Staging
-- | ------- | ------------ | -------
>> | ente | ente | No
To create a new dts profile:
Run
dts profile new.Select the name of the profile to create using UpArrow and DownArrow.
Press Enter.
Obtain and copy your Duckietown token
Paste your
dt2token into the terminal.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#
To automate most of the back-end operations involving Docker,
dts config docker credentials set --username DOCKERHUB_USERNAME --password DOCKERHUB_ACCESS_TOKEN
recall your
DOCKERHUB_USERNAMEfrom Create a DockerHub account andcreate a PAT following DockerHub instructions on access tokens
Attention
These credentials are only stored locally;
Never use your account password instead of an personal access tokens (PAT);
For developers
With an extra positional argument, one could specify a custom Docker registry server other than
docker.io. Check dts config docker set --help for more details.
Resetting the Duckietown Shell#
To reset dts to “factory conditions”, run:
rm -rf ~/.duckietown/shell
and proceed to reconfigure your dts: Logging in the Duckietown Shell.
Checkpoint 2 ✅#
Tip
Never skip a checkpoint!
If you have trouble with any of these commands, see the FAQs section below. If you cannot find answers, use the Duckietown support channels to get help.
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
Run:
rm ~/.duckietown/shell/profiles/ente/databases/secrets_docker.yaml