-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed integration of VNC with Ubuntu 20.04
- Loading branch information
Showing
25 changed files
with
2,794 additions
and
2,062 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
||
# ==================================================> | ||
|
@@ -61,9 +61,6 @@ RUN pip3 install --use-feature=2020-resolver -r ${REPO_PATH}/dependencies-py3.tx | |
# copy the source code | ||
COPY ./packages "${REPO_PATH}/packages" | ||
|
||
# get the image_pipeline | ||
RUN git clone https://github.com/ros-perception/image_pipeline.git | ||
|
||
# build packages | ||
RUN . /opt/ros/${ROS_DISTRO}/setup.sh && \ | ||
catkin build \ | ||
|
@@ -90,18 +87,13 @@ LABEL org.duckietown.label.module.type="${REPO_NAME}" \ | |
# <== Do not change the code above this line | ||
# <================================================== | ||
|
||
## Python2 pip | ||
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py &&\ | ||
python get-pip.py &&\ | ||
rm get-pip.py | ||
|
||
## nvidia-container-runtime | ||
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/ | ||
|
@@ -119,16 +111,18 @@ COPY assets/vnc/image / | |
## 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 | ||
|
||
|
@@ -152,7 +146,8 @@ 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 | ||
|
@@ -162,5 +157,18 @@ RUN cd /src/web \ | |
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 | ||
|
||
# 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}/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/sh | ||
|
||
exec /usr/bin/Xvfb :99 -screen 0 1024x768x16 | ||
exec /usr/bin/Xvfb :1 -screen 0 1024x768x24 |
31 changes: 15 additions & 16 deletions
31
assets/vnc/image/usr/local/lib/web/backend/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
backports.ssl-match-hostname==3.5.0.1 | ||
certifi==2018.1.18 | ||
backports.ssl-match-hostname==3.7.0.1 | ||
certifi==2019.9.11 | ||
chardet==3.0.4 | ||
click==6.7 | ||
Flask==0.12.2 | ||
Click==7.0 | ||
Flask==1.1.1 | ||
Flask-Login==0.4.1 | ||
gevent==1.2.2 | ||
gevent==1.4.0 | ||
gevent-websocket==0.10.1 | ||
greenlet==0.4.13 | ||
idna==2.6 | ||
itsdangerous==0.24 | ||
Jinja2==2.10 | ||
MarkupSafe==1.0 | ||
meld3==1.0.2 | ||
requests==2.18.4 | ||
six==1.11.0 | ||
supervisor==3.2.0 | ||
urllib3==1.22 | ||
greenlet==0.4.15 | ||
idna==2.8 | ||
itsdangerous==1.1.0 | ||
Jinja2==2.10.3 | ||
MarkupSafe==1.1.1 | ||
meld3==2.0.0 | ||
requests==2.22.0 | ||
six==1.12.0 | ||
urllib3==1.25.6 | ||
websocket-client==0.47.0 | ||
Werkzeug==0.14.1 | ||
Werkzeug==0.16.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.