Skip to content

Commit

Permalink
Merge pull request #1 from duckietown/daffy
Browse files Browse the repository at this point in the history
update from master
  • Loading branch information
frank-qcd-qk authored Oct 12, 2020
2 parents d049949 + 79c3ba2 commit 1a8887a
Show file tree
Hide file tree
Showing 144 changed files with 12,119 additions and 2,090 deletions.
3 changes: 2 additions & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[bumpversion]
current_version = 0.0.0
current_version = 4.0.0
files = .dtproject
commit = True
tag = True

1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
!assets
!packages
!dependencies-apt.txt
!dependencies-py.txt
!dependencies-py3.txt
!launchers

Expand Down
4 changes: 2 additions & 2 deletions .dtproject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION=0.0.0
TYPE=template-ros
VERSION=4.0.0
TYPE=template-core
TYPE_VERSION=2
48 changes: 30 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# parameters
ARG REPO_NAME="dt-gui-tools"
ARG DESCRIPTION="Provides access to GUI-based ROS tools (e.g., rviz, rqt_image_view)"
ARG DESCRIPTION="Provides access to GUI-based tools (e.g., rviz, rqt_image_view)"
ARG MAINTAINER="Andrea F. Daniele ([email protected])"
# pick an icon from: https://fontawesome.com/v4.7.0/icons/
ARG ICON="desktop"

# novnc and websockify versions to use
ARG NOVNC_VERSION="35dd3c2"
ARG NOVNC_VERSION="9fe2fd0"
ARG WEBSOCKIFY_VERSION="3646575"

# ==================================================>
Expand All @@ -18,7 +18,7 @@ ARG BASE_IMAGE=dt-core
ARG LAUNCHER=default

# define base image
FROM duckietown/${BASE_IMAGE}:${BASE_TAG} as base
FROM duckietown/${BASE_IMAGE}:${BASE_TAG} as BASE

# recall all arguments
ARG ARCH
Expand Down Expand Up @@ -54,13 +54,9 @@ ENV DT_LAUNCHER "${LAUNCHER}"
COPY ./dependencies-apt.txt "${REPO_PATH}/"
RUN dt-apt-install ${REPO_PATH}/dependencies-apt.txt

# install python dependencies
COPY ./dependencies-py.txt "${REPO_PATH}/"
RUN pip install -r ${REPO_PATH}/dependencies-py.txt

# install python3 dependencies
COPY ./dependencies-py3.txt "${REPO_PATH}/"
RUN pip3 install -r ${REPO_PATH}/dependencies-py3.txt
RUN pip3 install --use-feature=2020-resolver -r ${REPO_PATH}/dependencies-py3.txt

# copy the source code
COPY ./packages "${REPO_PATH}/packages"
Expand Down Expand Up @@ -95,9 +91,9 @@ LABEL org.duckietown.label.module.type="${REPO_NAME}" \
ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics

# install ffmpeg
COPY assets/vnc/install-ffmpeg /tmp/
RUN /tmp/install-ffmpeg ${ARCH}
# configure ffmpeg
RUN mkdir /usr/local/ffmpeg \
&& ln -s /usr/bin/ffmpeg /usr/local/ffmpeg/ffmpeg

# install backend dependencies
COPY assets/vnc/install-backend-deps /tmp/
Expand All @@ -111,20 +107,22 @@ COPY assets/vnc/image /
#### => Substep: Frontend builder
##
## NOTE: This substep always runs in an amd64 image regardless of the architecture of
## final image. As a result, this Dockerfile can be run only on amd64 machines
## the final image. As a result, this Dockerfile can be run only on amd64 machines
## with QEMU enabled.
##
##
FROM ubuntu:xenial as builder
FROM ubuntu:focal as builder

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
git \
ca-certificates \
git
gnupg \
patch

# nodejs
RUN curl -sL https://deb.nodesource.com/setup_9.x | bash - \
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \
&& apt-get install -y \
nodejs

Expand All @@ -148,15 +146,29 @@ RUN git clone https://github.com/novnc/websockify /src/web/static/websockify \
COPY assets/vnc/web /src/web
RUN cd /src/web \
&& yarn \
&& npm run build
&& yarn build
RUN sed -i 's#app/locale/#novnc/app/locale/#' /src/web/dist/static/novnc/app/ui.js
##
##
#### <= Substep: Frontend builder


# jump back to the base image and copy frontend from builder stage
FROM base
FROM BASE
COPY --from=builder /src/web/dist/ /usr/local/lib/web/frontend/

# make websockify executable
RUN ln -sf /usr/local/lib/web/frontend/static/websockify \
/usr/local/lib/web/frontend/static/novnc/utils/websockify \
&& chmod +x /usr/local/lib/web/frontend/static/websockify/run

# configure novnc
ENV HTTP_PORT 8087
ENV HTTP_PORT 8087

# get the image_pipeline (this is needed to avoid issues with python2 shebang)
RUN git clone https://github.com/ros-perception/image_pipeline.git

# build packages
RUN . /opt/ros/${ROS_DISTRO}/setup.sh && \
catkin build \
--workspace ${CATKIN_WS_DIR}/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ a template for your new repository.
### 3. Define dependencies

List the dependencies in the files `dependencies-apt.txt` and
`dependencies-py.txt` (apt packages and pip packages respectively).
`dependencies-py3.txt` (apt packages and pip packages respectively).


### 4. Place your code
Expand Down
4 changes: 4 additions & 0 deletions assets/vnc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# noVNC

The original project this directory is taken from
is https://github.com/fcwu/docker-ubuntu-vnc-desktop.
76 changes: 43 additions & 33 deletions assets/vnc/image/etc/nginx/sites-enabled/default
Original file line number Diff line number Diff line change
@@ -1,42 +1,52 @@
server {
listen 80 default_server;
# listen [::]:80 default_server ipv6only=on;
# listen [::]:80 default_server ipv6only=on;

#_SSL_PORT_#listen 443 ssl default_server;
#_SSL_PORT_#listen [::]:443 ssl default_server ipv6only=on;
#_SSL_PORT_#ssl_certificate /etc/nginx/ssl/nginx.crt;
#_SSL_PORT_#ssl_certificate_key /etc/nginx/ssl/nginx.key;
#_SSL_PORT_#listen 443 ssl default_server;
#_SSL_PORT_#listen [::]:443 ssl default_server ipv6only=on;
#_SSL_PORT_#ssl_certificate /etc/nginx/ssl/nginx.crt;
#_SSL_PORT_#ssl_certificate_key /etc/nginx/ssl/nginx.key;

#_HTTP_PASSWORD_#auth_basic "Private Property";
#_HTTP_PASSWORD_#auth_basic_user_file /etc/nginx/.htpasswd;
#_HTTP_PASSWORD_#auth_basic "Private Property";
#_HTTP_PASSWORD_#auth_basic_user_file /etc/nginx/.htpasswd;

root /usr/local/lib/web/frontend/;
index index.html index.htm;

location ~ ^/api {
try_files $uri @api;
}

location = /websockify {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:6081;
}

location @api {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:6079;
max_ranges 0;
}

location @proxy {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:6081;
max_ranges 0;
}
#_RELATIVE_URL_ROOT_location /_RELATIVE_URL_ROOT_/ {
#_RELATIVE_URL_ROOT_ rewrite /_RELATIVE_URL_ROOT_/(.*) /$1 break;
#_RELATIVE_URL_ROOT_ root /usr/local/lib/web/frontend/;
#_RELATIVE_URL_ROOT_}

location ~ .*/(api/.*|websockify) {
try_files $uri @api$http_upgrade;
}

location / {
rewrite /approot/(.*) /$1 break;
root /usr/local/lib/web/frontend/;
}

location @apiwebsocket {
#_RELATIVE_URL_ROOT_rewrite /_RELATIVE_URL_ROOT_/(.*) $1 break;
proxy_connect_timeout 7d;
proxy_send_timeout 7d;
proxy_read_timeout 7d;
proxy_buffering off;

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:6081;
}

location @api {
#_RELATIVE_URL_ROOT_rewrite /_RELATIVE_URL_ROOT_/(.*) $1 break;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
max_ranges 0;
proxy_pass http://127.0.0.1:6079;
}
}

19 changes: 10 additions & 9 deletions assets/vnc/image/etc/supervisor/conf.d/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,34 @@ stderr_logfile_maxbytes=0
[group:x]
programs=xvfb,wm,lxpanel,pcmanfm,x11vnc,novnc

[program:xvfb]
priority=10
command=/usr/local/bin/xvfb.sh
stopsignal=KILL

[program:wm]
priority=15
command=/usr/bin/openbox
environment=DISPLAY=":1",HOME="/root",USER="root"
environment=DISPLAY=":99",HOME="/root",USER="root"

[program:lxpanel]
priority=15
directory=%HOME%
command=/usr/bin/lxpanel --profile LXDE
user=%USER%
environment=DISPLAY=":1",HOME="%HOME%",USER="%USER%"
environment=DISPLAY=":99",HOME="%HOME%",USER="%USER%"

[program:pcmanfm]
priority=15
directory=%HOME%
command=/usr/bin/pcmanfm --desktop --profile LXDE
user=%USER%
environment=DISPLAY=":1",HOME="%HOME%",USER="%USER%"
stopwaitsecs=3
environment=DISPLAY=":99",HOME="%HOME%",USER="%USER%"

[program:xvfb]
priority=10
command=/usr/local/bin/xvfb.sh
stopsignal=KILL

[program:x11vnc]
priority=20
command=x11vnc -display :1 -xkb -forever -shared -repeat
command=x11vnc -display :99 -xkb -forever -shared -repeat -capslock

[program:novnc]
priority=25
Expand Down
46 changes: 46 additions & 0 deletions assets/vnc/image/root/.config/libfm/libfm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Configuration file for the libfm version 1.3.1.
# Autogenerated file, don't edit, your changes will be overwritten.

[config]
single_click=0
use_trash=1
confirm_del=1
confirm_trash=1
advanced_mode=0
si_unit=0
force_startup_notify=1
backup_as_hidden=1
no_usb_trash=1
no_child_non_expandable=0
show_full_names=0
only_user_templates=0
template_run_app=0
template_type_once=0
auto_selection_delay=600
drop_default_action=auto
defer_content_test=0
quick_exec=1
show_internal_volumes=0
terminal=x-terminal-emulator %s
archiver=xarchiver
thumbnail_local=1
thumbnail_max=2048
smart_desktop_autodrop=1

[ui]
big_icon_size=48
small_icon_size=24
pane_icon_size=24
thumbnail_size=128
show_thumbnail=1
shadow_hidden=0

[places]
places_home=1
places_desktop=1
places_root=0
places_computer=0
places_trash=1
places_applications=1
places_network=0
places_unmounted=1
10 changes: 10 additions & 0 deletions assets/vnc/image/root/Desktop/intrinsic_calibration.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Version=1.0
Type=Application
Exec=dt-launcher-intrinsic-calibration
Icon=gnome-network-properties
Terminal=false
StartupNotify=true
Name=Calibration - Intrinsic
Comment=Calibration for Intrinsic Camera parameters
GenericName=Calibration for Intrinsic Camera parameters
Empty file modified assets/vnc/image/root/Desktop/rqt_image_view.desktop
100755 → 100644
Empty file.
Loading

0 comments on commit 1a8887a

Please sign in to comment.