Skip to content

Commit

Permalink
version increment and others
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybdub committed Sep 24, 2020
1 parent 293398c commit 9647b4c
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 24 deletions.
48 changes: 43 additions & 5 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,59 @@ This directory contains scripts to build the JetBot docker containers.

## Quick Start

### Step 1 - Build All Containers
### Step 1 - Configure System

First, call the ``scripts/configure_jetson.sh`` script to configure the power mode and other parameters.

```bash
cd jetbot
./scripts/configure_jetson.sh
```

Next, source the ``docker/configure.sh`` script to configure various environment variables related to JetBot docker.

```bash
cd docker
./build.sh
source configure.sh
```

Finally, if you haven't already, set the default docker runtime to NVIDIA. This is needed to use
CUDA related components with the containers.

```bash
./set_nvidia_runtime.sh
```

If needed, you can also set memory limits on the Jupyter container.

```bash
export JETBOT_JUPYTER_MEMORY=500m
export JETBOT_JUPYTER_MEMORY_SWAP=3G
```

### Step 2 - Enable all containers

Call the following to enable the JetBot docker containers

```bash
sudo systemctl enable docker # enable docker daemon at boot
./enable.sh $HOME # we'll use home directory as working directory, set this as you please.
```

Now you can go to ``https://<jetbot_ip>:8888`` and start programming JetBot from your web browser.
The directory you specify to ``./run.sh`` will be mounted as a volume in the jupyter container
Now you can go to ``https://<jetbot_ip>:8888`` from a web browser and start programming JetBot!
You can do this from any machine on your local network. The password to log in is ``jetbot``.

![](https://user-images.githubusercontent.com/25759564/92091965-51ae4f00-ed86-11ea-93d5-09d291ccfa95.png)


> Note: The directory you specify to ``./enable.sh`` will be mounted as a volume in the jupyter container
at the location ``/workspace``. This means the work you in the ``/workspace`` folder inside container
is saved. Please note, if you work outside of that directory it will be lost when the container shuts down.
is saved. This is set to the root directory of Jupyter Lab. Please note, if you work outside of that directory it will be lost when the container shuts down.

## Building Containers

If you want to build the containers from scratch, simply call

```bash
./build.sh
```
2 changes: 1 addition & 1 deletion docker/base/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi

sudo docker build \
--build-arg BASE_IMAGE=$BASE_IMAGE \
-t jetbot/jetbot:base-$JETBOT_VERSION-$L4T_VERSION \
-t $JETBOT_DOCKER_REMOTE/jetbot:base-$JETBOT_VERSION-$L4T_VERSION \
-f Dockerfile \
../.. # jetbot repo root as context

4 changes: 2 additions & 2 deletions docker/camera/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sudo docker build \
--build-arg BASE_IMAGE=jetbot/jetbot:base-$JETBOT_VERSION-$L4T_VERSION \
-t jetbot/jetbot:camera-$JETBOT_VERSION-$L4T_VERSION \
--build-arg BASE_IMAGE=$JETBOT_DOCKER_REMOTE/jetbot:base-$JETBOT_VERSION-$L4T_VERSION \
-t $JETBOT_DOCKER_REMOTE/jetbot:camera-$JETBOT_VERSION-$L4T_VERSION \
-f Dockerfile .
2 changes: 1 addition & 1 deletion docker/camera/enable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ sudo docker run -it -d \
--volume /tmp/argus_socket:/tmp/argus_socket \
--privileged \
--name=jetbot_camera \
jetbot/jetbot:camera-$JETBOT_VERSION-$L4T_VERSION
$JETBOT_DOCKER_REMOTE/jetbot:camera-$JETBOT_VERSION-$L4T_VERSION
18 changes: 16 additions & 2 deletions docker/configure.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
#!/bin/bash

export L4T_VERSION=32.4.3
export JETBOT_VERSION=0.4.0
export JETBOT_VERSION=0.4.1

L4T_VERSION_STRING=$(head -n 1 /etc/nv_tegra_release)
L4T_RELEASE=$(echo $L4T_VERSION_STRING | cut -f 2 -d ' ' | grep -Po '(?<=R)[^;]+')
L4T_REVISION=$(echo $L4T_VERSION_STRING | cut -f 2 -d ',' | grep -Po '(?<=REVISION: )[^;]+')

export L4T_VERSION="$L4T_RELEASE.$L4T_REVISION"

if [[ "$L4T_VERSION" == "32.4.3" ]]
then
# docker hub
export JETBOT_DOCKER_REMOTE=jetbot
elif [[ "$L4T_VERSION" == "32.4.4" ]]
then
export JETBOT_DOCKER_REMOTE=nvcr.io/ea-linux4tegra
fi


4 changes: 2 additions & 2 deletions docker/display/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sudo docker build \
--build-arg BASE_IMAGE=jetbot/jetbot:base-$JETBOT_VERSION-$L4T_VERSION \
-t jetbot/jetbot:display-$JETBOT_VERSION-$L4T_VERSION \
--build-arg BASE_IMAGE=$JETBOT_DOCKER_REMOTE/jetbot:base-$JETBOT_VERSION-$L4T_VERSION \
-t $JETBOT_DOCKER_REMOTE/jetbot:display-$JETBOT_VERSION-$L4T_VERSION \
-f Dockerfile .

2 changes: 1 addition & 1 deletion docker/display/enable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sudo docker run -it -d \
--network host \
--privileged \
--name=jetbot_display \
jetbot/jetbot:display-$JETBOT_VERSION-$L4T_VERSION
$JETBOT_DOCKER_REMOTE/jetbot:display-$JETBOT_VERSION-$L4T_VERSION
4 changes: 2 additions & 2 deletions docker/jupyter/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sudo docker build \
--build-arg BASE_IMAGE=jetbot/jetbot:models-$JETBOT_VERSION-$L4T_VERSION \
-t jetbot/jetbot:jupyter-$JETBOT_VERSION-$L4T_VERSION \
--build-arg BASE_IMAGE=$JETBOT_DOCKER_REMOTE/jetbot:models-$JETBOT_VERSION-$L4T_VERSION \
-t $JETBOT_DOCKER_REMOTE/jetbot:jupyter-$JETBOT_VERSION-$L4T_VERSION \
-f Dockerfile .
4 changes: 2 additions & 2 deletions docker/jupyter/enable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ then
--name=jetbot_jupyter \
--memory-swap=$JETBOT_JUPYTER_MEMORY_SWAP \
--env JETBOT_DEFAULT_CAMERA=$JETBOT_CAMERA \
jetbot/jetbot:jupyter-$JETBOT_VERSION-$L4T_VERSION
$JETBOT_DOCKER_REMOTE/jetbot:jupyter-$JETBOT_VERSION-$L4T_VERSION

else

Expand All @@ -43,6 +43,6 @@ else
--memory=$JETBOT_JUPYTER_MEMORY \
--memory-swap=$JETBOT_JUPYTER_MEMORY_SWAP \
--env JETBOT_DEFAULT_CAMERA=$JETBOT_CAMERA \
jetbot/jetbot:jupyter-$JETBOT_VERSION-$L4T_VERSION
$JETBOT_DOCKER_REMOTE/jetbot:jupyter-$JETBOT_VERSION-$L4T_VERSION

fi
4 changes: 2 additions & 2 deletions docker/models/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sudo docker build \
--build-arg BASE_IMAGE=jetbot/jetbot:base-$JETBOT_VERSION-$L4T_VERSION \
-t jetbot/jetbot:models-$JETBOT_VERSION-$L4T_VERSION \
--build-arg BASE_IMAGE=$JETBOT_DOCKER_REMOTE/jetbot:base-$JETBOT_VERSION-$L4T_VERSION \
-t $JETBOT_DOCKER_REMOTE/jetbot:models-$JETBOT_VERSION-$L4T_VERSION \
-f Dockerfile .
6 changes: 3 additions & 3 deletions docker/push.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

sudo docker push jetbot/jetbot:camera-$JETBOT_VERSION-$L4T_VERSION
sudo docker push jetbot/jetbot:jupyter-$JETBOT_VERSION-$L4T_VERSION
sudo docker push jetbot/jetbot:display-$JETBOT_VERSION-$L4T_VERSION
sudo docker push $JETBOT_DOCKER_REMOTE/jetbot:camera-$JETBOT_VERSION-$L4T_VERSION
sudo docker push $JETBOT_DOCKER_REMOTE/jetbot:jupyter-$JETBOT_VERSION-$L4T_VERSION
sudo docker push $JETBOT_DOCKER_REMOTE/jetbot:display-$JETBOT_VERSION-$L4T_VERSION
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def build_libs():

setup(
name='jetbot',
version='0.4.0',
version='0.4.1',
description='An open-source robot based on NVIDIA Jetson Nano',
packages=find_packages(),
install_requires=[
Expand Down

0 comments on commit 9647b4c

Please sign in to comment.