Skip to content

Commit 75623f5

Browse files
committed
Added docker container
1 parent e9b6d14 commit 75623f5

File tree

10 files changed

+306
-23
lines changed

10 files changed

+306
-23
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ celerybeat-schedule
7979
# SageMath parsed files
8080
*.sage.py
8181

82-
# dotenv
83-
.env
84-
8582
# virtualenv
8683
.venv
8784
venv/

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

docker/.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
TOBIIGLASSESCTRL_VER=2.3.0
2+
NET_INTERFACE="enxd481d7396767"

docker/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM python:3.8
2+
LABEL maintainer="Davide De Tommaso <[email protected]>"
3+
4+
ARG TOBIIGLASSESCTRL_VER
5+
6+
RUN adduser --disabled-password docky
7+
8+
USER docky
9+
10+
WORKDIR /home/docky
11+
12+
13+
ENV PATH=${PATH}:/home/docky/.local/bin
14+
15+
USER docky
16+
17+
RUN cd $HOME &&\
18+
git clone --recursive https://github.com/ddetommaso/TobiiGlassesPyController &&\
19+
cd TobiiGlassesPyController &&\
20+
git checkout ${TOBIIGLASSESCTRL_VER} &&\
21+
pip3 install --user .

docker/dhcpconf/dhcpd.conf

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# dhcpd.conf
2+
#
3+
# Sample configuration file for ISC dhcpd
4+
#
5+
6+
# option definitions common to all supported networks...
7+
option domain-name "tobiiglasses2.local";
8+
option domain-name-servers 192.168.100.1;
9+
10+
default-lease-time 600;
11+
max-lease-time 7200;
12+
13+
# The ddns-updates-style parameter controls whether or not the server will
14+
# attempt to do a DNS update when a lease is confirmed. We default to the
15+
# behavior of the version 2 packages ('none', since DHCP v2 didn't
16+
# have support for DDNS.)
17+
ddns-update-style none;
18+
19+
# If this DHCP server is the official DHCP server for the local
20+
# network, the authoritative directive should be uncommented.
21+
authoritative;
22+
23+
# Use this to send dhcp log messages to a different log file (you also
24+
# have to hack syslog.conf to complete the redirection).
25+
#log-facility local7;
26+
27+
# No service will be given on this subnet, but declaring it helps the
28+
# DHCP server to understand the network topology.
29+
30+
#subnet 10.152.187.0 netmask 255.255.255.0 {
31+
#}
32+
33+
# This is a very basic subnet declaration.
34+
35+
subnet 192.168.100.0 netmask 255.255.255.0 {
36+
range 192.168.100.10 192.168.100.20;
37+
option routers 192.168.100.1;
38+
}
39+
40+
# This declaration allows BOOTP clients to get dynamic addresses,
41+
# which we don't really recommend.
42+
43+
#subnet 10.254.239.32 netmask 255.255.255.224 {
44+
# range dynamic-bootp 10.254.239.40 10.254.239.60;
45+
# option broadcast-address 10.254.239.31;
46+
# option routers rtr-239-32-1.example.org;
47+
#}
48+
49+
# A slightly different configuration for an internal subnet.
50+
#subnet 10.5.5.0 netmask 255.255.255.224 {
51+
# range 10.5.5.26 10.5.5.30;
52+
# option domain-name-servers ns1.internal.example.org;
53+
# option domain-name "internal.example.org";
54+
# option routers 10.5.5.1;
55+
# option broadcast-address 10.5.5.31;
56+
# default-lease-time 600;
57+
# max-lease-time 7200;
58+
#}
59+
60+
# Hosts which require special configuration options can be listed in
61+
# host statements. If no address is specified, the address will be
62+
# allocated dynamically (if possible), but the host-specific information
63+
# will still come from the host declaration.
64+
65+
#host passacaglia {
66+
# hardware ethernet 0:0:c0:5d:bd:95;
67+
# filename "vmunix.passacaglia";
68+
# server-name "toccata.example.com";
69+
#}
70+
71+
# Fixed IP addresses can also be specified for hosts. These addresses
72+
# should not also be listed as being available for dynamic assignment.
73+
# Hosts for which fixed IP addresses have been specified can boot using
74+
# BOOTP or DHCP. Hosts for which no fixed address is specified can only
75+
# be booted with DHCP, unless there is an address range on the subnet
76+
# to which a BOOTP client is connected which has the dynamic-bootp flag
77+
# set.
78+
#host fantasia {
79+
# hardware ethernet 08:00:07:26:c0:a5;
80+
# fixed-address fantasia.example.com;
81+
#}
82+
83+
# You can declare a class of clients and then do address allocation
84+
# based on that. The example below shows a case where all clients
85+
# in a certain class get addresses on the 10.17.224/24 subnet, and all
86+
# other clients get addresses on the 10.0.29/24 subnet.
87+
88+
#class "foo" {
89+
# match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
90+
#}
91+
92+
#shared-network 224-29 {
93+
# subnet 10.17.224.0 netmask 255.255.255.0 {
94+
# option routers rtr-224.example.org;
95+
# }
96+
# subnet 10.0.29.0 netmask 255.255.255.0 {
97+
# option routers rtr-29.example.org;
98+
# }
99+
# pool {
100+
# allow members of "foo";
101+
# range 10.17.224.10 10.17.224.250;
102+
# }
103+
# pool {
104+
# deny members of "foo";
105+
# range 10.0.29.10 10.0.29.230;
106+
# }
107+
#}

docker/dhcpconf/dhcpd.leases

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# The format of this file is documented in the dhcpd.leases(5) manual page.
2+
# This lease file was written by isc-dhcp-4.3.5
3+
4+
# authoring-byte-order entry is generated, DO NOT DELETE
5+
authoring-byte-order little-endian;
6+
7+
server-duid "\000\001\000\001(C\300\376\324\201\3279gg";
8+
9+
lease 192.168.100.10 {
10+
starts 5 2021/05/28 14:56:10;
11+
ends 5 2021/05/28 15:06:10;
12+
cltt 5 2021/05/28 14:56:10;
13+
binding state active;
14+
next binding state free;
15+
rewind binding state free;
16+
hardware ethernet 74:fe:48:19:fb:e3;
17+
client-hostname "g2d";
18+
}
19+
lease 192.168.100.10 {
20+
starts 5 2021/05/28 15:00:21;
21+
ends 5 2021/05/28 15:10:21;
22+
cltt 5 2021/05/28 15:00:21;
23+
binding state active;
24+
next binding state free;
25+
rewind binding state free;
26+
hardware ethernet 74:fe:48:19:fb:e3;
27+
client-hostname "g2d";
28+
}
29+
lease 192.168.100.10 {
30+
starts 5 2021/05/28 15:04:53;
31+
ends 5 2021/05/28 15:14:53;
32+
cltt 5 2021/05/28 15:04:53;
33+
binding state active;
34+
next binding state free;
35+
rewind binding state free;
36+
hardware ethernet 74:fe:48:19:fb:e3;
37+
client-hostname "g2d";
38+
}
39+
lease 192.168.100.10 {
40+
starts 5 2021/05/28 15:09:32;
41+
ends 5 2021/05/28 15:19:32;
42+
cltt 5 2021/05/28 15:09:32;
43+
binding state active;
44+
next binding state free;
45+
rewind binding state free;
46+
hardware ethernet 74:fe:48:19:fb:e3;
47+
client-hostname "g2d";
48+
}
49+
lease 192.168.100.10 {
50+
starts 5 2021/05/28 15:14:15;
51+
ends 5 2021/05/28 15:24:15;
52+
cltt 5 2021/05/28 15:14:15;
53+
binding state active;
54+
next binding state free;
55+
rewind binding state free;
56+
hardware ethernet 74:fe:48:19:fb:e3;
57+
client-hostname "g2d";
58+
}
59+
lease 192.168.100.10 {
60+
starts 5 2021/05/28 15:18:39;
61+
ends 5 2021/05/28 15:28:39;
62+
cltt 5 2021/05/28 15:18:39;
63+
binding state active;
64+
next binding state free;
65+
rewind binding state free;
66+
hardware ethernet 74:fe:48:19:fb:e3;
67+
client-hostname "g2d";
68+
}
69+
lease 192.168.100.10 {
70+
starts 5 2021/05/28 15:23:09;
71+
ends 5 2021/05/28 15:33:09;
72+
cltt 5 2021/05/28 15:23:09;
73+
binding state active;
74+
next binding state free;
75+
rewind binding state free;
76+
hardware ethernet 74:fe:48:19:fb:e3;
77+
client-hostname "g2d";
78+
}
79+
lease 192.168.100.10 {
80+
starts 5 2021/05/28 15:28:08;
81+
ends 5 2021/05/28 15:38:08;
82+
cltt 5 2021/05/28 15:28:08;
83+
binding state active;
84+
next binding state free;
85+
rewind binding state free;
86+
hardware ethernet 74:fe:48:19:fb:e3;
87+
client-hostname "g2d";
88+
}
89+
lease 192.168.100.10 {
90+
starts 5 2021/05/28 15:33:04;
91+
ends 5 2021/05/28 15:43:04;
92+
cltt 5 2021/05/28 15:33:04;
93+
binding state active;
94+
next binding state free;
95+
rewind binding state free;
96+
hardware ethernet 74:fe:48:19:fb:e3;
97+
client-hostname "g2d";
98+
}
99+
lease 192.168.100.10 {
100+
starts 5 2021/05/28 15:37:33;
101+
ends 5 2021/05/28 15:47:33;
102+
cltt 5 2021/05/28 15:37:33;
103+
binding state active;
104+
next binding state free;
105+
rewind binding state free;
106+
hardware ethernet 74:fe:48:19:fb:e3;
107+
client-hostname "g2d";
108+
}
109+
lease 192.168.100.10 {
110+
starts 5 2021/05/28 15:42:02;
111+
ends 5 2021/05/28 15:52:02;
112+
cltt 5 2021/05/28 15:42:02;
113+
binding state active;
114+
next binding state free;
115+
rewind binding state free;
116+
hardware ethernet 74:fe:48:19:fb:e3;
117+
client-hostname "g2d";
118+
}
119+
lease 192.168.100.10 {
120+
starts 5 2021/05/28 15:46:06;
121+
ends 5 2021/05/28 15:56:06;
122+
cltt 5 2021/05/28 15:46:06;
123+
binding state active;
124+
next binding state free;
125+
rewind binding state free;
126+
hardware ethernet 74:fe:48:19:fb:e3;
127+
client-hostname "g2d";
128+
}
129+
lease 192.168.100.10 {
130+
starts 5 2021/05/28 15:50:23;
131+
ends 5 2021/05/28 16:00:23;
132+
cltt 5 2021/05/28 15:50:23;
133+
binding state active;
134+
next binding state free;
135+
rewind binding state free;
136+
hardware ethernet 74:fe:48:19:fb:e3;
137+
client-hostname "g2d";
138+
}
139+
lease 192.168.100.10 {
140+
starts 5 2021/05/28 15:50:23;
141+
ends 5 2021/05/28 15:51:38;
142+
tstp 5 2021/05/28 15:51:38;
143+
cltt 5 2021/05/28 15:50:23;
144+
binding state free;
145+
hardware ethernet 74:fe:48:19:fb:e3;
146+
}

docker/dhcpconf/dhcpd.leases~

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# The format of this file is documented in the dhcpd.leases(5) manual page.
2+
# This lease file was written by isc-dhcp-4.3.5
3+
4+
# authoring-byte-order entry is generated, DO NOT DELETE
5+
authoring-byte-order little-endian;
6+

docker/docker-compose.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,31 @@ version: "3.6"
22

33
services:
44

5+
dhcpserver:
6+
image: "networkboot/dhcpd"
7+
network_mode: "host"
8+
9+
volumes:
10+
- type: bind
11+
source: ./dhcpconf
12+
target: /data
13+
14+
command: ${NET_INTERFACE}
15+
516
tobiiglasses2:
6-
image: "python:3.8-buster"
17+
build:
18+
context: .
19+
dockerfile: Dockerfile
20+
args:
21+
TOBIIGLASSESCTRL_VER: ${TOBIIGLASSESCTRL_VER}
722

823
container_name: tobiiglasses2
924

1025
network_mode: "host"
26+
1127
environment:
1228
- "DISPLAY=${DISPLAY}"
1329
- "QT_X11_NO_MITSHM=1"
14-
- "PULSE_SERVER=unix:${XDG_RUNTIME_DIR}/pulse/native"
1530

1631
privileged: true
1732
stdin_open: true
@@ -20,14 +35,9 @@ services:
2035
volumes:
2136
- type: bind
2237
source: ../
23-
target: /home/TobiiGlassesPyController
38+
target: /home/docky/TobiiGlassesPyController
2439

25-
- type: bind
26-
source: ./init.sh
27-
target: /home/init.sh
28-
29-
- type: bind
30-
source: ${XDG_RUNTIME_DIR}/pulse
31-
target: ${XDG_RUNTIME_DIR}/pulse
40+
entrypoint: ["bash"]
3241

33-
entrypoint: ["bash", "/home/init.sh"]
42+
depends_on:
43+
- dhcpserver

docker/init.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313

1414
setup(
1515
name='tobiiglassesctrl',
16-
version='2.3.0',
16+
version='2.4.0',
1717
description='A Python controller for Tobii Pro Glasses 2',
1818
url='https://github.com/ddetommaso/TobiiGlassesPyController/',
19-
download_url='https://github.com/ddetommaso/TobiiGlassesPyController/archive/2.3.0.tar.gz',
20-
install_requires=['netifaces', 'opencv-python==4.1.2.30'],
19+
download_url='https://github.com/ddetommaso/TobiiGlassesPyController/archive/2.4.0.tar.gz',
20+
install_requires=['netifaces', 'opencv-python==4.1.2.30', 'av==8.0.3'],
2121
author='Davide De Tommaso',
2222
author_email='[email protected]',
2323
keywords=['eye-tracker','tobii','glasses', 'tobii pro glasses 2', 'tobii glasses', 'eye tracking'],

0 commit comments

Comments
 (0)