Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerized Mycodo #637

Open
4 of 7 tasks
kizniche opened this issue Mar 5, 2019 · 68 comments
Open
4 of 7 tasks

Dockerized Mycodo #637

kizniche opened this issue Mar 5, 2019 · 68 comments

Comments

@kizniche
Copy link
Owner

kizniche commented Mar 5, 2019

This is my experiment with using docker and docker-compose to run Mycodo. Thus far I successfully have Mycodo running fully in docker containers. This includes the Flask/Gunicorn frontend, Nginx, Influxdb, and the Mycodo daemon (additionally with Grafana and Telegraf for further data acquisition/presentation). This issue can serve as a discussion thread and a way I can keep users updated on the progress and where this is going. For current information about setup/building, see the docker/README.md.

Current state (check means working):

  • All containers start up and communicate (daemon, flask, nginx, influxdb)
  • Internal sensors (CPU load, disk space, etc.)
  • Device sensors (i.e. /dev/ttyUSB0)
  • Telegraf and Grafana
  • Outputs
  • Upgrade
  • Backup/restore

More will be added as they are found

@kizniche
Copy link
Owner Author

kizniche commented Mar 6, 2019

Below are commands to get it up and running on your system (any linux system, not just a Raspberry Pi).

If you have Mycodo already running from a standard install, first stop the services with these commands:

sudo service mycodo stop
sudo service mycodoflask stop
sudo service nginx stop
sudo service influxdb stop

Checkout the mycodo_docker branch and install prerequisites (docker, docker-compose):

git clone https://github.com/kizniche/Mycodo
cd Mycodo
git checkout mycodo_docker
sudo /bin/bash ./mycodo.sh install-dependencies

Add your user to the docker group so you can run without root privileges (replacing USER with your user):

sudo usermod -aG docker ${USER}

Log out and back in for the changes to take affect, then build:

make build

Once it's built and running, you can navigate to https://127.0.0.1/ to access the web UI.

@Theoi-Meteoroi
Copy link
Contributor

Theoi-Meteoroi commented Mar 7, 2019

I did this. On the stretch distro for a long run node. This is my CO2 and particle detector station.

pi@CO2mon:~ $ sudo mv ./Mycodo ./645_Mycodo.saved
pi@CO2mon:~ $ sudo apt-get update
...
pi@CO2mon:~ $ sudo rpi-update
 ...

Got this (good to know because I use that on Pi.)

apt-listchanges: News
---------------------

wpasupplicant (2:2.6-19) unstable; urgency=medium

  With this release, wpasupplicant no longer respects the system
  default minimum TLS version, defaulting to TLSv1.0, not TLSv1.2. If
  you're sure you will never connect to EAP networks requiring anything less
  than 1.2, add this to your wpasupplicant configuration:

    tls_disable_tlsv1_0=1
    tls_disable_tlsv1_1=1

  wpasupplicant also defaults to a security level 1, instead of the system
  default 2. Should you need to change that, change this setting in your
  wpasupplicant configuration:

    openssl_ciphers=DEFAULT@SECLEVEL=2

  Unlike wpasupplicant, hostapd still respects system defaults.

 -- Andrej Shadura <andrewsh@debian.org>  Sat, 15 Dec 2018 14:22:18 +0100

15.8 mb on my system.
And reboot once more. Be patient. New baby.

I'm a couple of beers into this so I'll cut and paste what Kyle wrote above. Hold my beer, please.

pi@CO2mon:~ $ git clone https://github.com/kizniche/Mycodo
Cloning into 'Mycodo'...
remote: Enumerating objects: 287, done.
remote: Counting objects: 100% (287/287), done.
remote: Compressing objects: 100% (220/220), done.
remote: Total 38725 (delta 145), reused 137 (delta 67), pack-reused 38438
Receiving objects: 100% (38725/38725), 72.92 MiB | 4.80 MiB/s, done.
Resolving deltas: 100% (31011/31011), done.
pi@CO2mon:~ $ cd Mycodo
pi@CO2mon:~/Mycodo $ git checkout mycodo_docker
Branch mycodo_docker set up to track remote branch mycodo_docker from origin.
Switched to a new branch 'mycodo_docker'
pi@CO2mon:~/Mycodo $ sudo /bin/bash ./mycodo.sh install-dependencies
#### Installing docker
...
#### Installing docker-compose
...
#### Dependencies installed

pi@CO2mon:~/Mycodo $ make build
docker-compose up --build -d
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
Makefile:2: recipe for target 'build' failed
make: *** [build] Error 1
pi@CO2mon:~/Mycodo $ sudo docker engine activate
you must be logged in to access licenses.  Please use 'docker login' then try again
pi@CO2mon:~/Mycodo $ make build
docker-compose up --build -d
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
Makefile:2: recipe for target 'build' failed
make: *** [build] Error 1

I had added the user Pi to the docker group.
This went on for awhile. Something is wrong with my docker account.
Or this needs docker enterprise. Mkay. I'm game. I sign up on the pi. Big mistake it seems.
Gonna need another beer and new music. That has not resolved the issue.

I have some problem with my Docker account. Going away to fix that.
I'll be back. Probably a good idea to check your docker account, first.
I log in fine in a browser but still getting kicked to the curb in a cli.

-reboot- (because there are times that you gotta)

Beauty.
cd ~/Mycodo
make build

Getting another beer.

pi@CO2mon:~/Mycodo $ make build
docker-compose up --build -d
Creating network "mycodo_default" with the default driver
Creating volume "mycodo_mycodo_var" with default driver
Building influxdb
...
  Running setup.py install for cffi: started
    Running setup.py install for cffi: finished with status 'error'
    Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-_fa39_s9/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-9unz3ez9/install-record.txt --single-version-externally-managed --compile:
    unable to execute 'gcc': No such file or directory
    unable to execute 'gcc': No such file or directory
    
        No working compiler found, or bogus compiler options passed to
        the compiler from Python's standard "distutils" module.  See
        the error messages above.  Likely, the problem is not related
        to CFFI but generic to the setup.py of any Python package that
        tries to compile C code.  (Hints: on OS/X 10.8, for errors about
        -mno-fused-madd see http://stackoverflow.com/questions/22313407/
        Otherwise, see https://wiki.python.org/moin/CompLangPython or
        the IRC channel #python on irc.freenode.net.)
    
        Trying to continue anyway.  If you are trying to install CFFI from
        a build done in a different context, you can ignore this warning.
    
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-armv7l-3.6
    creating build/lib.linux-armv7l-3.6/cffi
    copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-3.6/cffi
    copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-3.6/cffi
    copying cffi/error.py -> build/lib.linux-armv7l-3.6/cffi
    copying cffi/__init__.py -> build/lib.linux-armv7l-3.6/cffi
    copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-3.6/cffi
    copying cffi/vengine_gen.py -> build/lib.linux-armv7l-3.6/cffi
    copying cffi/ffiplatform.py -> build/lib.linux-armv7l-3.6/cffi
    copying cffi/model.py -> build/lib.linux-armv7l-3.6/cffi
    copying cffi/recompiler.py -> build/lib.linux-armv7l-3.6/cffi
    copying cffi/verifier.py -> build/lib.linux-armv7l-3.6/cffi
    copying cffi/cparser.py -> build/lib.linux-armv7l-3.6/cffi
    copying cffi/pkgconfig.py -> build/lib.linux-armv7l-3.6/cffi
    copying cffi/commontypes.py -> build/lib.linux-armv7l-3.6/cffi
    copying cffi/api.py -> build/lib.linux-armv7l-3.6/cffi
    copying cffi/lock.py -> build/lib.linux-armv7l-3.6/cffi
    copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-3.6/cffi
    copying cffi/_cffi_include.h -> build/lib.linux-armv7l-3.6/cffi
    copying cffi/parse_c_type.h -> build/lib.linux-armv7l-3.6/cffi
    copying cffi/_embedding.h -> build/lib.linux-armv7l-3.6/cffi
    copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-3.6/cffi
    running build_ext
    building '_cffi_backend' extension
    creating build/temp.linux-armv7l-3.6
    creating build/temp.linux-armv7l-3.6/c
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/ffi -I/usr/include/libffi -I/usr/local/include/python3.6m -c c/_cffi_backend.c -o build/temp.linux-armv7l-3.6/c/_cffi_backend.o
    unable to execute 'gcc': No such file or directory
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-_fa39_s9/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-9unz3ez9/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-_fa39_s9/cffi/
ERROR: Service 'flask' failed to build: The command '/bin/sh -c pip install --no-cache-dir -r /home/mycodo/requirements.txt' returned a non-zero code: 1
Makefile:2: recipe for target 'build' failed
make: *** [build] Error 1
pi@CO2mon:~/Mycodo $ 

Your move, Kyle. I'll leave this as it is and await better ideas to continue further. Almost is pretty good in my book. I hear that some other embedded applications are going to containers because they are also being built on linux and obscure isn't good enough for security anymore. People around you are already driving those applications. A Tesla isn't just a big battery, with wheels.

@kizniche
Copy link
Owner Author

kizniche commented Mar 7, 2019

Looks like gcc is needed. I just recently took it out of the install process, but hadn't built on the Pi to verify it was still working. I'll push a fix shortly.

kizniche added a commit that referenced this issue Mar 7, 2019
@kizniche
Copy link
Owner Author

kizniche commented Mar 7, 2019

Sorry your first build experience was a flop. I pushed a fix for the issue building on Pis. I also updated my second comment with more detailed commands to shutdown any previously-installed Mycodo to free up ports and adding the user to the docker group. These should be all the commands possibly needed to get it up and running. I'm currently building on a Pi right now, so if I encounter any issues, I'll push another fix shortly.

@Theoi-Meteoroi
Copy link
Contributor

No worries Kyle, I still had a good time while trying. I'll follow your suggestions and try some more. Its worthwhile to do, I think. Thank you for giving containers a go with Mycodo!

@Theoi-Meteoroi
Copy link
Contributor

Full Moon coming. Guess it is time.

pi@everlast:~ $ sudo apt-get update
Get:1 http://archive.raspberrypi.org/debian stretch InRelease [25.4 kB]
Get:2 http://raspbian.raspberrypi.org/raspbian stretch InRelease [15.0 kB]
Get:3 http://archive.raspberrypi.org/debian stretch/main armhf Packages [214 kB]
Get:4 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages [11.7 MB]                                     
Get:5 http://archive.raspberrypi.org/debian stretch/ui armhf Packages [44.5 kB]  
Fetched 12.0 MB in 1min 32s (129 kB/s)                                                                                   
Reading package lists... Done
pi@everlast:~ $ sudo rpi-update
 *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
 *** Performing self-update
 *** Relaunching after update
 *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
#############################################################
WARNING: This update bumps to rpi-4.19.y linux tree
Be aware there could be compatibility issues with some drivers
Discussion here:
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=224931
##############################################################
Would you like to proceed? (y/N)

 *** Downloading specific firmware revision (this will take a few minutes)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   168    0   168    0     0    423      0 --:--:-- --:--:-- --:--:--   424
100 58.4M  100 58.4M    0     0  3960k      0  0:00:15  0:00:15 --:--:-- 3268k
 *** Updating firmware
 *** Updating kernel modules
 *** depmod 4.19.29-v7+
 *** depmod 4.19.29+
 *** Updating VideoCore libraries
 *** Using HardFP libraries
 *** Updating SDK
 *** Running ldconfig
 *** Storing current firmware revision
 *** Deleting downloaded files
 *** Syncing changes to disk
 *** If no errors appeared, your firmware was successfully updated to 3f0ecd1fca450c2cacd429c96b78cc4be96acd51
 *** A reboot is needed to activate the new firmware
pi@everlast:~ $ 
< rebooted >

pi@everlast:~ $ sudo service mycodo stop
Failed to stop mycodo.service: Unit mycodo.service not loaded.
pi@everlast:~ $ sudo service mycodoflask stop
Failed to stop mycodoflask.service: Unit mycodoflask.service not loaded.
pi@everlast:~ $ sudo service nginx stop
pi@everlast:~ $ sudo service influxdb stop
pi@everlast:~ $ git clone https://github.com/kizniche/Mycodo
Cloning into 'Mycodo'...
remote: Enumerating objects: 22, done.
remote: Counting objects: 100% (22/22), done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 38960 (delta 10), reused 13 (delta 6), pack-reused 38938
Receiving objects: 100% (38960/38960), 71.42 MiB | 6.54 MiB/s, done.
Resolving deltas: 100% (31298/31298), done.
pi@everlast:~ $ cd Mycodo
pi@everlast:~/Mycodo $ git checkout mycodo_docker
Branch mycodo_docker set up to track remote branch mycodo_docker from origin.
Switched to a new branch 'mycodo_docker'
pi@everlast:~/Mycodo $ sudo /bin/bash ./mycodo.sh install-dependencies
#### Installing docker
# Executing docker install script, commit: cfba462
+ sh -c apt-get update -qq >/dev/null
+ sh -c apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
W: APT had planned for dpkg to do more than it reported back (18 vs 22).
   Affected packages: nginx-full:armhf
+ sh -c curl -fsSL "https://download.docker.com/linux/raspbian/gpg" | apt-key add -qq - >/dev/null
Warning: apt-key output should not be parsed (stdout is not a terminal)
+ sh -c echo "deb [arch=armhf] https://download.docker.com/linux/raspbian stretch stable" > /etc/apt/sources.list.d/docker.list
+ sh -c apt-get update -qq >/dev/null
+ sh -c apt-get install -y -qq --no-install-recommends docker-ce >/dev/null
+ sh -c docker version
Client:
 Version:           18.09.0
 API version:       1.39
 Go version:        go1.10.4
 Git commit:        4d60db4
 Built:             Wed Nov  7 00:57:21 2018
 OS/Arch:           linux/arm
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.0
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.4
  Git commit:       4d60db4
  Built:            Wed Nov  7 00:17:57 2018
  OS/Arch:          linux/arm
  Experimental:     false
If you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:

  sudo usermod -aG docker your-user

Remember that you will have to log out and back in for this to take effect!

WARNING: Adding a user to the "docker" group will grant the ability to run
         containers which can be used to obtain root privileges on the
         docker host.
         Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface
         for more information.

** DOCKER ENGINE - ENTERPRISE **

Test drive additional security features by activating Docker Engine - Enterprise.

  * Leverage FIPS 140-2 validated encryption
  * Run only trusted images with digital signature enforcement

** Learn more at https://dockr.ly/engine1 **

ACTIVATE your own engine to Docker Engine - Enterprise using:

  sudo docker engine activate

#### Installing docker-compose
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting docker-compose
  Downloading https://files.pythonhosted.org/packages/1e/6c/bf9879305530c4b765ef4eb3be76202788ca1037aec74d2c0ec73191d467/docker_compose-1.23.2-py2.py3-none-any.whl (131kB)
    100% |████████████████████████████████| 133kB 1.7MB/s 
Collecting PyYAML<4,>=3.10 (from docker-compose)
  Downloading https://files.pythonhosted.org/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz (270kB)
    100% |████████████████████████████████| 276kB 2.9MB/s 
Collecting backports.ssl-match-hostname>=3.5; python_version < "3.5" (from docker-compose)
  Downloading https://www.piwheels.org/simple/backports-ssl-match-hostname/backports.ssl_match_hostname-3.7.0.1-py2.py3-none-any.whl
Collecting websocket-client<1.0,>=0.32.0 (from docker-compose)
  Downloading https://files.pythonhosted.org/packages/29/19/44753eab1fdb50770ac69605527e8859468f3c0fd7dc5a76dd9c4dbd7906/websocket_client-0.56.0-py2.py3-none-any.whl (200kB)
    100% |████████████████████████████████| 204kB 2.7MB/s 
Collecting docker<4.0,>=3.6.0 (from docker-compose)
  Downloading https://files.pythonhosted.org/packages/fb/d8/8242b8fb3bd3000274fbf5ac1a06cdba8a5ccbcf4e2a8c05f0ab37999fd8/docker-3.7.1-py2.py3-none-any.whl (134kB)
    100% |████████████████████████████████| 143kB 3.4MB/s 
Requirement already satisfied: ipaddress>=1.0.16; python_version < "3.3" in /usr/lib/python2.7/dist-packages (from docker-compose) (1.0.17)
Collecting dockerpty<0.5,>=0.4.1 (from docker-compose)
  Downloading https://files.pythonhosted.org/packages/8d/ee/e9ecce4c32204a6738e0a5d5883d3413794d7498fe8b06f44becc028d3ba/dockerpty-0.4.1.tar.gz
Collecting texttable<0.10,>=0.9.0 (from docker-compose)
  Downloading https://files.pythonhosted.org/packages/02/e1/2565e6b842de7945af0555167d33acfc8a615584ef7abd30d1eae00a4d80/texttable-0.9.1.tar.gz
Requirement already satisfied: enum34<2,>=1.0.4; python_version < "3.4" in /usr/lib/python2.7/dist-packages (from docker-compose) (1.1.6)
Requirement already satisfied: requests!=2.11.0,!=2.12.2,!=2.18.0,<2.21,>=2.6.1 in /usr/lib/python2.7/dist-packages (from docker-compose) (2.12.4)
Requirement already satisfied: six<2,>=1.3.0 in /usr/lib/python2.7/dist-packages (from docker-compose) (1.10.0)
Collecting jsonschema<3,>=2.5.1 (from docker-compose)
  Downloading https://files.pythonhosted.org/packages/77/de/47e35a97b2b05c2fadbec67d44cfcdcd09b8086951b331d82de90d2912da/jsonschema-2.6.0-py2.py3-none-any.whl
Collecting docopt<0.7,>=0.6.1 (from docker-compose)
  Downloading https://www.piwheels.org/simple/docopt/docopt-0.6.2-py2.py3-none-any.whl
Collecting cached-property<2,>=1.2.0 (from docker-compose)
  Downloading https://files.pythonhosted.org/packages/3b/86/85c1be2e8db9e13ef9a350aecd6dea292bd612fa288c2f40d035bb750ded/cached_property-1.5.1-py2.py3-none-any.whl
Collecting docker-pycreds>=0.4.0 (from docker<4.0,>=3.6.0->docker-compose)
  Downloading https://files.pythonhosted.org/packages/f5/e8/f6bd1eee09314e7e6dee49cbe2c5e22314ccdb38db16c9fc72d2fa80d054/docker_pycreds-0.4.0-py2.py3-none-any.whl
Collecting functools32; python_version == "2.7" (from jsonschema<3,>=2.5.1->docker-compose)
  Downloading https://files.pythonhosted.org/packages/c5/60/6ac26ad05857c601308d8fb9e87fa36d0ebf889423f47c3502ef034365db/functools32-3.2.3-2.tar.gz
docker 3.7.1 has requirement requests!=2.18.0,>=2.14.2, but you'll have requests 2.12.4 which is incompatible.
Installing collected packages: PyYAML, backports.ssl-match-hostname, websocket-client, docker-pycreds, docker, dockerpty, texttable, functools32, jsonschema, docopt, cached-property, docker-compose
  Running setup.py install for PyYAML ... done
  Running setup.py install for dockerpty ... done
  Running setup.py install for texttable ... done
  Running setup.py install for functools32 ... done
Successfully installed PyYAML-3.13 backports.ssl-match-hostname-3.7.0.1 cached-property-1.5.1 docker-3.7.1 docker-compose-1.23.2 docker-pycreds-0.4.0 dockerpty-0.4.1 docopt-0.6.2 functools32-3.2.3.post2 jsonschema-2.6.0 texttable-0.9.1 websocket-client-0.56.0
#### Dependencies installed
pi@everlast:~/Mycodo $ sudo usermod -aG docker pi
pi@everlast:~/Mycodo $ make build
docker-compose up --build -d
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
Makefile:2: recipe for target 'build' failed
make: *** [build] Error 1
pi@everlast:~/Mycodo $ ps -ef  | grep docker
root     18781     1  0 00:14 ?        00:00:01 /usr/bin/dockerd -H unix://
pi       19055   859  0 00:18 pts/0    00:00:00 grep --color=auto docker
pi@everlast:~/Mycodo $ sudo make build
docker-compose up --build -d
Creating network "mycodo_default" with the default driver
Creating volume "mycodo_mycodo_var" with default driver
Building influxdb
Step 1/9 : FROM influxdb:latest
latest: Pulling from library/influxdb
ec43a77fdcf3: Pull complete
8a0128678cc4: Pull complete
d5b2e6712f41: Pull complete
93b7da03244c: Pull complete
934e98004036: Pull complete
aaf10ef85fb0: Pull complete
9bc7c4250200: Pull complete
57dad2272f99: Pull complete
Digest: sha256:9d727ada4098eb2729d3891bef1a5e8a67e55da5476d2c2877c5e1f6576ae19f
Status: Downloaded newer image for influxdb:latest
 ---> b4b8eb2bbbe3
Step 2/9 : RUN mkdir -pv /var/influxdb/data
 ---> Running in 03054bdc2705
mkdir: created directory '/var/influxdb'
mkdir: created directory '/var/influxdb/data'
Removing intermediate container 03054bdc2705
 ---> a7cad8c50f77
Step 3/9 : ADD run.sh /run.sh
 ---> 855dd2035d7b
Step 4/9 : RUN chmod +x /*.sh
 ---> Running in 92ae630accbd
Removing intermediate container 92ae630accbd
 ---> bf82f5dee886
Step 5/9 : ENV PRE_CREATE_DB mycodo_db
 ---> Running in c59f83754fc6
Removing intermediate container c59f83754fc6
 ---> c3e41f23f127
Step 6/9 : ENV ADMIN_USER mycodo
 ---> Running in b7e39137d389
Removing intermediate container b7e39137d389
 ---> 117d99e0192e
Step 7/9 : ENV PASS mmdu77sj3nIoiajjs
 ---> Running in 55990e202d84
Removing intermediate container 55990e202d84
 ---> ef81d8d2d3cf
Step 8/9 : EXPOSE 8086
 ---> Running in 97a3d61931b0
Removing intermediate container 97a3d61931b0
 ---> c6321a1c6070
Step 9/9 : CMD /run.sh
 ---> Running in 555ebe537a63
Removing intermediate container 555ebe537a63
 ---> ddda8ff53613

Successfully built ddda8ff53613
Successfully tagged mycodo_influxdb:latest
Building flask
Step 1/10 : FROM python:3.6-slim-stretch
3.6-slim-stretch: Pulling from library/python
ecad9bd7ef0c: Pull complete
91c7faf04446: Pull complete
c4887ffeef28: Pull complete
08f4b324a752: Pull complete
db3c40d03bc5: Pull complete
Digest: sha256:3603dd0f95c7e04974c2eaaf0427470c342ea7284ae45401674fd490c8ce83f4
Status: Downloaded newer image for python:3.6-slim-stretch
 ---> 2da3a01acc0a
Step 2/10 : RUN mkdir -pv /home/mycodo
 ---> Running in ca2fa2bbe95a
mkdir: created directory '/home/mycodo'
Removing intermediate container ca2fa2bbe95a
 ---> ed467cc09495
Step 3/10 : COPY . /home/mycodo
 ---> d541290b5553
Step 4/10 : WORKDIR /home/mycodo/mycodo
 ---> Running in 41e155de3053
Removing intermediate container 41e155de3053
 ---> c52526637701
Step 5/10 : RUN /home/mycodo/mycodo/scripts/upgrade_commands.sh create-files-directories
 ---> Running in 986437aaad3a

#### Creating files and directories
mkdir: created directory '/var/mycodo'
mkdir: created directory '/var/mycodo/log'
mkdir: created directory '/var/mycodo/database'
mkdir: created directory '/var/mycodo/lock'
mkdir: created directory '/var/mycodo/ssl_certs'
mkdir: created directory '/var/mycodo/custom_inputs'
mkdir: created directory '/var/mycodo/Mycodo-backups'
mkdir: created directory '/var/mycodo/note_attachments'
Removing intermediate container 986437aaad3a
 ---> dc7007cea875
Step 6/10 : RUN /home/mycodo/mycodo/scripts/upgrade_commands.sh update-apt-packages
 ---> Running in 1fb174ac669e

#### Installing prerequisite apt packages and update pip
Ign:1 http://deb.debian.org/debian stretch InRelease
Get:2 http://security.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Get:3 http://deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:4 http://deb.debian.org/debian stretch Release [118 kB]
Get:5 http://deb.debian.org/debian stretch Release.gpg [2434 B]
Get:6 http://security.debian.org/debian-security stretch/updates/main armhf Packages [464 kB]
Get:7 http://deb.debian.org/debian stretch-updates/main armhf Packages [10.8 kB]
Get:8 http://deb.debian.org/debian stretch/main armhf Packages [6913 kB]
Fetched 7694 kB in 5s (1324 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  binutils cpp cpp-6 gcc-6 git-man krb5-locales less libasan3 libatomic1
  libbsd0 libc-dev-bin libc6-dev libcc1-0 libcurl3-gnutls libedit2
  liberror-perl libgcc-6-dev libgmp10 libgnutls30 libgomp1 libgpm2
  libgssapi-krb5-2 libhogweed4 libidn11 libidn2-0 libio-pty-perl
  libipc-run-perl libisl15 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0
  libldap-2.4-2 libldap-common libmpc3 libmpfr4 libncurses5 libnettle6
  libnghttp2-14 libp11-kit0 libperl5.24 libpopt0 libpsl5 librtmp1 libsasl2-2
  libsasl2-modules libsasl2-modules-db libssh2-1 libssl1.0.2 libtasn1-6
  libubsan0 libunistring0 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6
  libxext6 libxmuu1 linux-libc-dev manpages manpages-dev openssh-client patch
  perl perl-modules-5.24 publicsuffix rename rsync xauth
Suggested packages:
  binutils-doc cpp-doc gcc-6-locales gcc-multilib make autoconf automake
  libtool flex bison gdb gcc-doc gcc-6-doc libgcc1-dbg libgomp1-dbg
  libitm1-dbg libatomic1-dbg libasan3-dbg liblsan0-dbg libtsan0-dbg
  libubsan0-dbg libcilkrts5-dbg libmpx2-dbg libquadmath0-dbg gettext-base
  git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk
  gitweb git-arch git-cvs git-mediawiki git-svn glibc-doc gnutls-bin gpm
  krb5-doc krb5-user libsasl2-modules-gssapi-mit
  | libsasl2-modules-gssapi-heimdal libsasl2-modules-ldap libsasl2-modules-otp
  libsasl2-modules-sql man-browser libtime-duration-perl libtimedate-perl
  keychain libpam-ssh monkeysphere ssh-askpass ed diffutils-doc perl-doc
  libterm-readline-gnu-perl | libterm-readline-perl-perl openssh-server
The following NEW packages will be installed:
  binutils cpp cpp-6 gcc gcc-6 git git-man krb5-locales less libasan3
  libatomic1 libbsd0 libc-dev-bin libc6-dev libcc1-0 libcurl3-gnutls libedit2
  liberror-perl libffi-dev libgcc-6-dev libgmp10 libgnutls30 libgomp1 libgpm2
  libgssapi-krb5-2 libhogweed4 libidn11 libidn2-0 libio-pty-perl
  libipc-run-perl libisl15 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0
  libldap-2.4-2 libldap-common libmpc3 libmpfr4 libncurses5 libnettle6
  libnghttp2-14 libp11-kit0 libperl5.24 libpopt0 libpsl5 librtmp1 libsasl2-2
  libsasl2-modules libsasl2-modules-db libssh2-1 libssl1.0.2 libtasn1-6
  libubsan0 libunistring0 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6
  libxext6 libxmuu1 linux-libc-dev manpages manpages-dev moreutils
  openssh-client patch perl perl-modules-5.24 publicsuffix rename rsync wget
  xauth
0 upgraded, 75 newly installed, 0 to remove and 0 not upgraded.
Need to get 43.4 MB of archives.
After this operation, 155 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian stretch/main armhf perl-modules-5.24 all 5.24.1-3+deb9u5 [2722 kB]
Get:2 http://deb.debian.org/debian stretch/main armhf libperl5.24 armhf 5.24.1-3+deb9u5 [2850 kB]
Get:3 http://deb.debian.org/debian stretch/main armhf perl armhf 5.24.1-3+deb9u5 [219 kB]
Get:4 http://deb.debian.org/debian stretch/main armhf libgmp10 armhf 2:6.1.2+dfsg-1 [195 kB]
Get:5 http://deb.debian.org/debian stretch/main armhf libnettle6 armhf 3.3-1+b2 [211 kB]
Get:6 http://deb.debian.org/debian stretch/main armhf libhogweed4 armhf 3.3-1+b2 [126 kB]
Get:7 http://deb.debian.org/debian stretch/main armhf libidn11 armhf 1.33-1 [112 kB]
Get:8 http://deb.debian.org/debian stretch/main armhf libp11-kit0 armhf 0.23.3-2 [96.7 kB]
Get:9 http://deb.debian.org/debian stretch/main armhf libtasn1-6 armhf 4.10-1.1+deb9u1 [45.7 kB]
Get:10 http://deb.debian.org/debian stretch/main armhf libgnutls30 armhf 3.5.8-5+deb9u4 [841 kB]
Get:11 http://deb.debian.org/debian stretch/main armhf libkeyutils1 armhf 1.5.9-9 [11.8 kB]
Get:12 http://deb.debian.org/debian stretch/main armhf libkrb5support0 armhf 1.15-1+deb9u1 [58.0 kB]
Get:13 http://deb.debian.org/debian stretch/main armhf libk5crypto3 armhf 1.15-1+deb9u1 [117 kB]
Get:14 http://deb.debian.org/debian stretch/main armhf libkrb5-3 armhf 1.15-1+deb9u1 [267 kB]
Get:15 http://deb.debian.org/debian stretch/main armhf libgssapi-krb5-2 armhf 1.15-1+deb9u1 [133 kB]
Get:16 http://deb.debian.org/debian stretch/main armhf libunistring0 armhf 0.9.6+really0.9.3-0.1 [255 kB]
Get:17 http://deb.debian.org/debian stretch/main armhf libidn2-0 armhf 0.16-1+deb9u1 [58.8 kB]
Get:18 http://deb.debian.org/debian stretch/main armhf libsasl2-modules-db armhf 2.1.27~101-g0780600+dfsg-3 [66.7 kB]
Get:19 http://deb.debian.org/debian stretch/main armhf libsasl2-2 armhf 2.1.27~101-g0780600+dfsg-3 [98.2 kB]
Get:20 http://deb.debian.org/debian stretch/main armhf libldap-common all 2.4.44+dfsg-5+deb9u2 [85.5 kB]
Get:21 http://deb.debian.org/debian stretch/main armhf libldap-2.4-2 armhf 2.4.44+dfsg-5+deb9u2 [197 kB]
Get:22 http://deb.debian.org/debian stretch/main armhf libnghttp2-14 armhf 1.18.1-1 [69.1 kB]
Get:23 http://deb.debian.org/debian stretch/main armhf libpsl5 armhf 0.17.0-3 [40.7 kB]
Get:24 http://deb.debian.org/debian stretch/main armhf librtmp1 armhf 2.4+20151223.gitfa8646d.1-1+b1 [55.1 kB]
Get:25 http://deb.debian.org/debian stretch/main armhf libssh2-1 armhf 1.7.0-1 [128 kB]
Get:26 http://deb.debian.org/debian stretch/main armhf libcurl3-gnutls armhf 7.52.1-5+deb9u9 [262 kB]
Get:27 http://deb.debian.org/debian stretch/main armhf liberror-perl all 0.17024-1 [26.9 kB]
Get:28 http://deb.debian.org/debian stretch/main armhf git-man all 1:2.11.0-3+deb9u4 [1433 kB]
Get:29 http://deb.debian.org/debian stretch/main armhf git armhf 1:2.11.0-3+deb9u4 [3661 kB]
Get:30 http://security.debian.org/debian-security stretch/updates/main armhf libssl1.0.2 armhf 1.0.2r-1~deb9u1 [925 kB]
Get:31 http://security.debian.org/debian-security stretch/updates/main armhf openssh-client armhf 1:7.4p1-10+deb9u6 [742 kB]
Get:32 http://deb.debian.org/debian stretch/main armhf libxau6 armhf 1:1.0.8-1 [19.5 kB]
Get:33 http://deb.debian.org/debian stretch/main armhf libpopt0 armhf 1.16-10+b2 [46.1 kB]
Get:34 http://deb.debian.org/debian stretch/main armhf wget armhf 1.18-5+deb9u2 [781 kB]
Get:35 http://deb.debian.org/debian stretch/main armhf krb5-locales all 1.15-1+deb9u1 [93.8 kB]
Get:36 http://deb.debian.org/debian stretch/main armhf less armhf 481-2.1 [121 kB]
Get:37 http://deb.debian.org/debian stretch/main armhf libbsd0 armhf 0.8.3-1 [89.6 kB]
Get:38 http://deb.debian.org/debian stretch/main armhf libncurses5 armhf 6.0+20161126-1+deb9u2 [74.7 kB]
Get:39 http://deb.debian.org/debian stretch/main armhf libedit2 armhf 3.1-20160903-3 [69.9 kB]
Get:40 http://deb.debian.org/debian stretch/main armhf libgpm2 armhf 1.20.4-6.2+b1 [33.3 kB]
Get:41 http://deb.debian.org/debian stretch/main armhf manpages all 4.10-2 [1222 kB]
Get:42 http://deb.debian.org/debian stretch/main armhf binutils armhf 2.28-5 [3900 kB]
Get:43 http://deb.debian.org/debian stretch/main armhf libisl15 armhf 0.18-1 [441 kB]
Get:44 http://deb.debian.org/debian stretch/main armhf libmpfr4 armhf 3.1.5-1 [536 kB]
Get:45 http://deb.debian.org/debian stretch/main armhf libmpc3 armhf 1.0.3-1+b2 [32.6 kB]
Get:46 http://deb.debian.org/debian stretch/main armhf cpp-6 armhf 6.3.0-18+deb9u1 [5239 kB]
Get:47 http://deb.debian.org/debian stretch/main armhf cpp armhf 4:6.3.0-4 [18.7 kB]
Get:48 http://deb.debian.org/debian stretch/main armhf libcc1-0 armhf 6.3.0-18+deb9u1 [25.2 kB]
Get:49 http://deb.debian.org/debian stretch/main armhf libgomp1 armhf 6.3.0-18+deb9u1 [64.6 kB]
Get:50 http://deb.debian.org/debian stretch/main armhf libatomic1 armhf 6.3.0-18+deb9u1 [6010 B]
Get:51 http://deb.debian.org/debian stretch/main armhf libasan3 armhf 6.3.0-18+deb9u1 [284 kB]
Get:52 http://deb.debian.org/debian stretch/main armhf libubsan0 armhf 6.3.0-18+deb9u1 [92.9 kB]
Get:53 http://deb.debian.org/debian stretch/main armhf libgcc-6-dev armhf 6.3.0-18+deb9u1 [531 kB]
Get:54 http://deb.debian.org/debian stretch/main armhf gcc-6 armhf 6.3.0-18+deb9u1 [5511 kB]
Get:55 http://deb.debian.org/debian stretch/main armhf gcc armhf 4:6.3.0-4 [5212 B]
Get:56 http://deb.debian.org/debian stretch/main armhf libc-dev-bin armhf 2.24-11+deb9u4 [253 kB]
Get:57 http://deb.debian.org/debian stretch-updates/main armhf linux-libc-dev armhf 4.9.144-3.1 [1370 kB]
Get:58 http://deb.debian.org/debian stretch/main armhf libc6-dev armhf 2.24-11+deb9u4 [1995 kB]
Get:59 http://deb.debian.org/debian stretch/main armhf libffi-dev armhf 3.2.1-6 [160 kB]
Get:60 http://deb.debian.org/debian stretch/main armhf libio-pty-perl armhf 1:1.08-1.1+b2 [32.9 kB]
Get:61 http://deb.debian.org/debian stretch/main armhf libipc-run-perl all 0.94-1+deb9u1 [99.1 kB]
Get:62 http://deb.debian.org/debian stretch/main armhf libsasl2-modules armhf 2.1.27~101-g0780600+dfsg-3 [96.0 kB]
Get:63 http://deb.debian.org/debian stretch/main armhf libxdmcp6 armhf 1:1.1.2-3 [24.9 kB]
Get:64 http://deb.debian.org/debian stretch/main armhf libxcb1 armhf 1.12-1 [129 kB]
Get:65 http://deb.debian.org/debian stretch/main armhf libx11-data all 2:1.6.4-3+deb9u1 [287 kB]
Get:66 http://deb.debian.org/debian stretch/main armhf libx11-6 armhf 2:1.6.4-3+deb9u1 [692 kB]
Get:67 http://deb.debian.org/debian stretch/main armhf libxext6 armhf 2:1.3.3-1+b2 [48.1 kB]
Get:68 http://deb.debian.org/debian stretch/main armhf libxmuu1 armhf 2:1.1.2-2 [22.9 kB]
Get:69 http://deb.debian.org/debian stretch/main armhf manpages-dev all 4.10-2 [2145 kB]
Get:70 http://deb.debian.org/debian stretch/main armhf moreutils armhf 0.60-1 [67.9 kB]
Get:71 http://deb.debian.org/debian stretch/main armhf patch armhf 2.7.5-1+deb9u1 [106 kB]
Get:72 http://deb.debian.org/debian stretch/main armhf rename all 0.20-4 [12.5 kB]
Get:73 http://deb.debian.org/debian stretch/main armhf rsync armhf 3.1.2-1+deb9u1 [380 kB]
Get:74 http://deb.debian.org/debian stretch/main armhf xauth armhf 1:1.0.9-1+b2 [36.7 kB]
Get:75 http://deb.debian.org/debian stretch/main armhf publicsuffix all 20181003.1334-0+deb9u1 [104 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 43.4 MB in 13s (3308 kB/s)
Selecting previously unselected package perl-modules-5.24.
(Reading database ... 6703 files and directories currently installed.)
Preparing to unpack .../00-perl-modules-5.24_5.24.1-3+deb9u5_all.deb ...
Unpacking perl-modules-5.24 (5.24.1-3+deb9u5) ...
Selecting previously unselected package libperl5.24:armhf.
Preparing to unpack .../01-libperl5.24_5.24.1-3+deb9u5_armhf.deb ...
Unpacking libperl5.24:armhf (5.24.1-3+deb9u5) ...
Selecting previously unselected package perl.
Preparing to unpack .../02-perl_5.24.1-3+deb9u5_armhf.deb ...
Unpacking perl (5.24.1-3+deb9u5) ...
Selecting previously unselected package libgmp10:armhf.
Preparing to unpack .../03-libgmp10_2%3a6.1.2+dfsg-1_armhf.deb ...
Unpacking libgmp10:armhf (2:6.1.2+dfsg-1) ...
Selecting previously unselected package libnettle6:armhf.
Preparing to unpack .../04-libnettle6_3.3-1+b2_armhf.deb ...
Unpacking libnettle6:armhf (3.3-1+b2) ...
Selecting previously unselected package libhogweed4:armhf.
Preparing to unpack .../05-libhogweed4_3.3-1+b2_armhf.deb ...
Unpacking libhogweed4:armhf (3.3-1+b2) ...
Selecting previously unselected package libidn11:armhf.
Preparing to unpack .../06-libidn11_1.33-1_armhf.deb ...
Unpacking libidn11:armhf (1.33-1) ...
Selecting previously unselected package libp11-kit0:armhf.
Preparing to unpack .../07-libp11-kit0_0.23.3-2_armhf.deb ...
Unpacking libp11-kit0:armhf (0.23.3-2) ...
Selecting previously unselected package libtasn1-6:armhf.
Preparing to unpack .../08-libtasn1-6_4.10-1.1+deb9u1_armhf.deb ...
Unpacking libtasn1-6:armhf (4.10-1.1+deb9u1) ...
Selecting previously unselected package libgnutls30:armhf.
Preparing to unpack .../09-libgnutls30_3.5.8-5+deb9u4_armhf.deb ...
Unpacking libgnutls30:armhf (3.5.8-5+deb9u4) ...
Selecting previously unselected package libkeyutils1:armhf.
Preparing to unpack .../10-libkeyutils1_1.5.9-9_armhf.deb ...
Unpacking libkeyutils1:armhf (1.5.9-9) ...
Selecting previously unselected package libkrb5support0:armhf.
Preparing to unpack .../11-libkrb5support0_1.15-1+deb9u1_armhf.deb ...
Unpacking libkrb5support0:armhf (1.15-1+deb9u1) ...
Selecting previously unselected package libk5crypto3:armhf.
Preparing to unpack .../12-libk5crypto3_1.15-1+deb9u1_armhf.deb ...
Unpacking libk5crypto3:armhf (1.15-1+deb9u1) ...
Selecting previously unselected package libkrb5-3:armhf.
Preparing to unpack .../13-libkrb5-3_1.15-1+deb9u1_armhf.deb ...
Unpacking libkrb5-3:armhf (1.15-1+deb9u1) ...
Selecting previously unselected package libgssapi-krb5-2:armhf.
Preparing to unpack .../14-libgssapi-krb5-2_1.15-1+deb9u1_armhf.deb ...
Unpacking libgssapi-krb5-2:armhf (1.15-1+deb9u1) ...
Selecting previously unselected package libunistring0:armhf.
Preparing to unpack .../15-libunistring0_0.9.6+really0.9.3-0.1_armhf.deb ...
Unpacking libunistring0:armhf (0.9.6+really0.9.3-0.1) ...
Selecting previously unselected package libidn2-0:armhf.
Preparing to unpack .../16-libidn2-0_0.16-1+deb9u1_armhf.deb ...
Unpacking libidn2-0:armhf (0.16-1+deb9u1) ...
Selecting previously unselected package libsasl2-modules-db:armhf.
Preparing to unpack .../17-libsasl2-modules-db_2.1.27~101-g0780600+dfsg-3_armhf.deb ...
Unpacking libsasl2-modules-db:armhf (2.1.27~101-g0780600+dfsg-3) ...
Selecting previously unselected package libsasl2-2:armhf.
Preparing to unpack .../18-libsasl2-2_2.1.27~101-g0780600+dfsg-3_armhf.deb ...
Unpacking libsasl2-2:armhf (2.1.27~101-g0780600+dfsg-3) ...
Selecting previously unselected package libldap-common.
Preparing to unpack .../19-libldap-common_2.4.44+dfsg-5+deb9u2_all.deb ...
Unpacking libldap-common (2.4.44+dfsg-5+deb9u2) ...
Selecting previously unselected package libldap-2.4-2:armhf.
Preparing to unpack .../20-libldap-2.4-2_2.4.44+dfsg-5+deb9u2_armhf.deb ...
Unpacking libldap-2.4-2:armhf (2.4.44+dfsg-5+deb9u2) ...
Selecting previously unselected package libnghttp2-14:armhf.
Preparing to unpack .../21-libnghttp2-14_1.18.1-1_armhf.deb ...
Unpacking libnghttp2-14:armhf (1.18.1-1) ...
Selecting previously unselected package libpsl5:armhf.
Preparing to unpack .../22-libpsl5_0.17.0-3_armhf.deb ...
Unpacking libpsl5:armhf (0.17.0-3) ...
Selecting previously unselected package librtmp1:armhf.
Preparing to unpack .../23-librtmp1_2.4+20151223.gitfa8646d.1-1+b1_armhf.deb ...
Unpacking librtmp1:armhf (2.4+20151223.gitfa8646d.1-1+b1) ...
Selecting previously unselected package libssh2-1:armhf.
Preparing to unpack .../24-libssh2-1_1.7.0-1_armhf.deb ...
Unpacking libssh2-1:armhf (1.7.0-1) ...
Selecting previously unselected package libcurl3-gnutls:armhf.
Preparing to unpack .../25-libcurl3-gnutls_7.52.1-5+deb9u9_armhf.deb ...
Unpacking libcurl3-gnutls:armhf (7.52.1-5+deb9u9) ...
Selecting previously unselected package liberror-perl.
Preparing to unpack .../26-liberror-perl_0.17024-1_all.deb ...
Unpacking liberror-perl (0.17024-1) ...
Selecting previously unselected package git-man.
Preparing to unpack .../27-git-man_1%3a2.11.0-3+deb9u4_all.deb ...
Unpacking git-man (1:2.11.0-3+deb9u4) ...
Selecting previously unselected package git.
Preparing to unpack .../28-git_1%3a2.11.0-3+deb9u4_armhf.deb ...
Unpacking git (1:2.11.0-3+deb9u4) ...
Selecting previously unselected package libxau6:armhf.
Preparing to unpack .../29-libxau6_1%3a1.0.8-1_armhf.deb ...
Unpacking libxau6:armhf (1:1.0.8-1) ...
Selecting previously unselected package libpopt0:armhf.
Preparing to unpack .../30-libpopt0_1.16-10+b2_armhf.deb ...
Unpacking libpopt0:armhf (1.16-10+b2) ...
Selecting previously unselected package libssl1.0.2:armhf.
Preparing to unpack .../31-libssl1.0.2_1.0.2r-1~deb9u1_armhf.deb ...
Unpacking libssl1.0.2:armhf (1.0.2r-1~deb9u1) ...
Selecting previously unselected package wget.
Preparing to unpack .../32-wget_1.18-5+deb9u2_armhf.deb ...
Unpacking wget (1.18-5+deb9u2) ...
Selecting previously unselected package krb5-locales.
Preparing to unpack .../33-krb5-locales_1.15-1+deb9u1_all.deb ...
Unpacking krb5-locales (1.15-1+deb9u1) ...
Selecting previously unselected package less.
Preparing to unpack .../34-less_481-2.1_armhf.deb ...
Unpacking less (481-2.1) ...
Selecting previously unselected package libbsd0:armhf.
Preparing to unpack .../35-libbsd0_0.8.3-1_armhf.deb ...
Unpacking libbsd0:armhf (0.8.3-1) ...
Selecting previously unselected package libncurses5:armhf.
Preparing to unpack .../36-libncurses5_6.0+20161126-1+deb9u2_armhf.deb ...
Unpacking libncurses5:armhf (6.0+20161126-1+deb9u2) ...
Selecting previously unselected package libedit2:armhf.
Preparing to unpack .../37-libedit2_3.1-20160903-3_armhf.deb ...
Unpacking libedit2:armhf (3.1-20160903-3) ...
Selecting previously unselected package libgpm2:armhf.
Preparing to unpack .../38-libgpm2_1.20.4-6.2+b1_armhf.deb ...
Unpacking libgpm2:armhf (1.20.4-6.2+b1) ...
Selecting previously unselected package manpages.
Preparing to unpack .../39-manpages_4.10-2_all.deb ...
Unpacking manpages (4.10-2) ...
Selecting previously unselected package openssh-client.
Preparing to unpack .../40-openssh-client_1%3a7.4p1-10+deb9u6_armhf.deb ...
Unpacking openssh-client (1:7.4p1-10+deb9u6) ...
Selecting previously unselected package binutils.
Preparing to unpack .../41-binutils_2.28-5_armhf.deb ...
Unpacking binutils (2.28-5) ...
Selecting previously unselected package libisl15:armhf.
Preparing to unpack .../42-libisl15_0.18-1_armhf.deb ...
Unpacking libisl15:armhf (0.18-1) ...
Selecting previously unselected package libmpfr4:armhf.
Preparing to unpack .../43-libmpfr4_3.1.5-1_armhf.deb ...
Unpacking libmpfr4:armhf (3.1.5-1) ...
Selecting previously unselected package libmpc3:armhf.
Preparing to unpack .../44-libmpc3_1.0.3-1+b2_armhf.deb ...
Unpacking libmpc3:armhf (1.0.3-1+b2) ...
Selecting previously unselected package cpp-6.
Preparing to unpack .../45-cpp-6_6.3.0-18+deb9u1_armhf.deb ...
Unpacking cpp-6 (6.3.0-18+deb9u1) ...
Selecting previously unselected package cpp.
Preparing to unpack .../46-cpp_4%3a6.3.0-4_armhf.deb ...
Unpacking cpp (4:6.3.0-4) ...
Selecting previously unselected package libcc1-0:armhf.
Preparing to unpack .../47-libcc1-0_6.3.0-18+deb9u1_armhf.deb ...
Unpacking libcc1-0:armhf (6.3.0-18+deb9u1) ...
Selecting previously unselected package libgomp1:armhf.
Preparing to unpack .../48-libgomp1_6.3.0-18+deb9u1_armhf.deb ...
Unpacking libgomp1:armhf (6.3.0-18+deb9u1) ...
Selecting previously unselected package libatomic1:armhf.
Preparing to unpack .../49-libatomic1_6.3.0-18+deb9u1_armhf.deb ...
Unpacking libatomic1:armhf (6.3.0-18+deb9u1) ...
Selecting previously unselected package libasan3:armhf.
Preparing to unpack .../50-libasan3_6.3.0-18+deb9u1_armhf.deb ...
Unpacking libasan3:armhf (6.3.0-18+deb9u1) ...
Selecting previously unselected package libubsan0:armhf.
Preparing to unpack .../51-libubsan0_6.3.0-18+deb9u1_armhf.deb ...
Unpacking libubsan0:armhf (6.3.0-18+deb9u1) ...
Selecting previously unselected package libgcc-6-dev:armhf.
Preparing to unpack .../52-libgcc-6-dev_6.3.0-18+deb9u1_armhf.deb ...
Unpacking libgcc-6-dev:armhf (6.3.0-18+deb9u1) ...
Selecting previously unselected package gcc-6.
Preparing to unpack .../53-gcc-6_6.3.0-18+deb9u1_armhf.deb ...
Unpacking gcc-6 (6.3.0-18+deb9u1) ...
Selecting previously unselected package gcc.
Preparing to unpack .../54-gcc_4%3a6.3.0-4_armhf.deb ...
Unpacking gcc (4:6.3.0-4) ...
Selecting previously unselected package libc-dev-bin.
Preparing to unpack .../55-libc-dev-bin_2.24-11+deb9u4_armhf.deb ...
Unpacking libc-dev-bin (2.24-11+deb9u4) ...
Selecting previously unselected package linux-libc-dev:armhf.
Preparing to unpack .../56-linux-libc-dev_4.9.144-3.1_armhf.deb ...
Unpacking linux-libc-dev:armhf (4.9.144-3.1) ...
Selecting previously unselected package libc6-dev:armhf.
Preparing to unpack .../57-libc6-dev_2.24-11+deb9u4_armhf.deb ...
Unpacking libc6-dev:armhf (2.24-11+deb9u4) ...
Selecting previously unselected package libffi-dev:armhf.
Preparing to unpack .../58-libffi-dev_3.2.1-6_armhf.deb ...
Unpacking libffi-dev:armhf (3.2.1-6) ...
Selecting previously unselected package libio-pty-perl.
Preparing to unpack .../59-libio-pty-perl_1%3a1.08-1.1+b2_armhf.deb ...
Unpacking libio-pty-perl (1:1.08-1.1+b2) ...
Selecting previously unselected package libipc-run-perl.
Preparing to unpack .../60-libipc-run-perl_0.94-1+deb9u1_all.deb ...
Unpacking libipc-run-perl (0.94-1+deb9u1) ...
Selecting previously unselected package libsasl2-modules:armhf.
Preparing to unpack .../61-libsasl2-modules_2.1.27~101-g0780600+dfsg-3_armhf.deb ...
Unpacking libsasl2-modules:armhf (2.1.27~101-g0780600+dfsg-3) ...
Selecting previously unselected package libxdmcp6:armhf.
Preparing to unpack .../62-libxdmcp6_1%3a1.1.2-3_armhf.deb ...
Unpacking libxdmcp6:armhf (1:1.1.2-3) ...
Selecting previously unselected package libxcb1:armhf.
Preparing to unpack .../63-libxcb1_1.12-1_armhf.deb ...
Unpacking libxcb1:armhf (1.12-1) ...
Selecting previously unselected package libx11-data.
Preparing to unpack .../64-libx11-data_2%3a1.6.4-3+deb9u1_all.deb ...
Unpacking libx11-data (2:1.6.4-3+deb9u1) ...
Selecting previously unselected package libx11-6:armhf.
Preparing to unpack .../65-libx11-6_2%3a1.6.4-3+deb9u1_armhf.deb ...
Unpacking libx11-6:armhf (2:1.6.4-3+deb9u1) ...
Selecting previously unselected package libxext6:armhf.
Preparing to unpack .../66-libxext6_2%3a1.3.3-1+b2_armhf.deb ...
Unpacking libxext6:armhf (2:1.3.3-1+b2) ...
Selecting previously unselected package libxmuu1:armhf.
Preparing to unpack .../67-libxmuu1_2%3a1.1.2-2_armhf.deb ...
Unpacking libxmuu1:armhf (2:1.1.2-2) ...
Selecting previously unselected package manpages-dev.
Preparing to unpack .../68-manpages-dev_4.10-2_all.deb ...
Unpacking manpages-dev (4.10-2) ...
Selecting previously unselected package moreutils.
Preparing to unpack .../69-moreutils_0.60-1_armhf.deb ...
Unpacking moreutils (0.60-1) ...
Selecting previously unselected package patch.
Preparing to unpack .../70-patch_2.7.5-1+deb9u1_armhf.deb ...
Unpacking patch (2.7.5-1+deb9u1) ...
Selecting previously unselected package rename.
Preparing to unpack .../71-rename_0.20-4_all.deb ...
Unpacking rename (0.20-4) ...
Selecting previously unselected package rsync.
Preparing to unpack .../72-rsync_3.1.2-1+deb9u1_armhf.deb ...
Unpacking rsync (3.1.2-1+deb9u1) ...
Selecting previously unselected package xauth.
Preparing to unpack .../73-xauth_1%3a1.0.9-1+b2_armhf.deb ...
Unpacking xauth (1:1.0.9-1+b2) ...
Selecting previously unselected package publicsuffix.
Preparing to unpack .../74-publicsuffix_20181003.1334-0+deb9u1_all.deb ...
Unpacking publicsuffix (20181003.1334-0+deb9u1) ...
Setting up libncurses5:armhf (6.0+20161126-1+deb9u2) ...
Setting up libgomp1:armhf (6.3.0-18+deb9u1) ...
Setting up libatomic1:armhf (6.3.0-18+deb9u1) ...
Setting up perl-modules-5.24 (5.24.1-3+deb9u5) ...
Setting up manpages (4.10-2) ...
Setting up libperl5.24:armhf (5.24.1-3+deb9u5) ...
Setting up libnettle6:armhf (3.3-1+b2) ...
Setting up git-man (1:2.11.0-3+deb9u4) ...
Setting up libpopt0:armhf (1.16-10+b2) ...
Setting up libcc1-0:armhf (6.3.0-18+deb9u1) ...
Setting up less (481-2.1) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
Setting up libasan3:armhf (6.3.0-18+deb9u1) ...
Setting up libnghttp2-14:armhf (1.18.1-1) ...
Setting up libgpm2:armhf (1.20.4-6.2+b1) ...
Setting up libldap-common (2.4.44+dfsg-5+deb9u2) ...
Setting up libubsan0:armhf (6.3.0-18+deb9u1) ...
Setting up libsasl2-modules-db:armhf (2.1.27~101-g0780600+dfsg-3) ...
Setting up linux-libc-dev:armhf (4.9.144-3.1) ...
Setting up libsasl2-2:armhf (2.1.27~101-g0780600+dfsg-3) ...
Setting up libffi-dev:armhf (3.2.1-6) ...
Setting up libbsd0:armhf (0.8.3-1) ...
Setting up libtasn1-6:armhf (4.10-1.1+deb9u1) ...
Setting up rsync (3.1.2-1+deb9u1) ...
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of restart.
Setting up perl (5.24.1-3+deb9u5) ...
update-alternatives: using /usr/bin/prename to provide /usr/bin/rename (rename) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/rename.1.gz because associated file /usr/share/man/man1/prename.1.gz (of link group rename) doesn't exist
Setting up libssl1.0.2:armhf (1.0.2r-1~deb9u1) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
Setting up libgmp10:armhf (2:6.1.2+dfsg-1) ...
Setting up libssh2-1:armhf (1.7.0-1) ...
Setting up patch (2.7.5-1+deb9u1) ...
Setting up krb5-locales (1.15-1+deb9u1) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Setting up publicsuffix (20181003.1334-0+deb9u1) ...
Setting up libunistring0:armhf (0.9.6+really0.9.3-0.1) ...
Setting up libp11-kit0:armhf (0.23.3-2) ...
Setting up libmpfr4:armhf (3.1.5-1) ...
Setting up libmpc3:armhf (1.0.3-1+b2) ...
Setting up binutils (2.28-5) ...
Setting up libc-dev-bin (2.24-11+deb9u4) ...
Setting up libxdmcp6:armhf (1:1.1.2-3) ...
Setting up libkeyutils1:armhf (1.5.9-9) ...
Setting up libsasl2-modules:armhf (2.1.27~101-g0780600+dfsg-3) ...
Setting up manpages-dev (4.10-2) ...
Setting up libc6-dev:armhf (2.24-11+deb9u4) ...
Setting up libx11-data (2:1.6.4-3+deb9u1) ...
Setting up libxau6:armhf (1:1.0.8-1) ...
Setting up libidn11:armhf (1.33-1) ...
Setting up libedit2:armhf (3.1-20160903-3) ...
Setting up libidn2-0:armhf (0.16-1+deb9u1) ...
Setting up libgcc-6-dev:armhf (6.3.0-18+deb9u1) ...
Setting up libio-pty-perl (1:1.08-1.1+b2) ...
Setting up liberror-perl (0.17024-1) ...
Setting up rename (0.20-4) ...
update-alternatives: using /usr/bin/file-rename to provide /usr/bin/rename (rename) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/rename.1.gz because associated file /usr/share/man/man1/file-rename.1p.gz (of link group rename) doesn't exist
Setting up libpsl5:armhf (0.17.0-3) ...
Setting up libkrb5support0:armhf (1.15-1+deb9u1) ...
Setting up libhogweed4:armhf (3.3-1+b2) ...
Setting up libisl15:armhf (0.18-1) ...
Setting up libipc-run-perl (0.94-1+deb9u1) ...
Setting up cpp-6 (6.3.0-18+deb9u1) ...
Setting up libxcb1:armhf (1.12-1) ...
Setting up cpp (4:6.3.0-4) ...
Setting up libk5crypto3:armhf (1.15-1+deb9u1) ...
Setting up libgnutls30:armhf (3.5.8-5+deb9u4) ...
Setting up libx11-6:armhf (2:1.6.4-3+deb9u1) ...
Setting up moreutils (0.60-1) ...
Setting up librtmp1:armhf (2.4+20151223.gitfa8646d.1-1+b1) ...
Setting up libxmuu1:armhf (2:1.1.2-2) ...
Setting up gcc-6 (6.3.0-18+deb9u1) ...
Setting up libldap-2.4-2:armhf (2.4.44+dfsg-5+deb9u2) ...
Setting up wget (1.18-5+deb9u2) ...
Setting up libkrb5-3:armhf (1.15-1+deb9u1) ...
Setting up libxext6:armhf (2:1.3.3-1+b2) ...
Setting up gcc (4:6.3.0-4) ...
Setting up libgssapi-krb5-2:armhf (1.15-1+deb9u1) ...
Setting up xauth (1:1.0.9-1+b2) ...
Setting up openssh-client (1:7.4p1-10+deb9u6) ...
Setting up libcurl3-gnutls:armhf (7.52.1-5+deb9u9) ...
Setting up git (1:2.11.0-3+deb9u4) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Removing intermediate container 1fb174ac669e
 ---> a51422239b47
Step 7/10 : RUN /home/mycodo/mycodo/scripts/upgrade_commands.sh update-pip
 ---> Running in c0f44274161a

#### Updating pip
Requirement already up-to-date: pip in /usr/local/lib/python3.6/site-packages (19.0.3)
Removing intermediate container c0f44274161a
 ---> bdbe21508eb5
Step 8/10 : RUN /home/mycodo/mycodo/scripts/upgrade_commands.sh update-pip-packages
 ---> Running in ed10f052da02

#### Installing pip requirements from requirements.txt
Requirement already up-to-date: pip in /usr/local/lib/python3.6/site-packages (19.0.3)
Requirement already up-to-date: setuptools in /usr/local/lib/python3.6/site-packages (40.8.0)
Collecting alembic==1.0.8 (from -r /home/mycodo/requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/d6/bb/ec1e21f2e303689ad2170eb47fc67df9ad4199ade6759a99474c4d3535c8/alembic-1.0.8.tar.gz (1.0MB)
Collecting argparse==1.4.0 (from -r /home/mycodo/requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/f2/94/3af39d34be01a24a6e65433d19e107099374224905f1e0cc6bbe1fd22a2f/argparse-1.4.0-py2.py3-none-any.whl
Collecting bcrypt==3.1.4 (from -r /home/mycodo/requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/f3/ec/bb6b384b5134fd881b91b6aa3a88ccddaad0103857760711a5ab8c799358/bcrypt-3.1.4.tar.gz (42kB)
Collecting Flask==1.0.2 (from -r /home/mycodo/requirements.txt (line 4))
  Downloading https://files.pythonhosted.org/packages/7f/e7/08578774ed4536d3242b14dacb4696386634607af824ea997202cd0edb4b/Flask-1.0.2-py2.py3-none-any.whl (91kB)
Collecting Flask_Babel==0.12.2 (from -r /home/mycodo/requirements.txt (line 5))
  Downloading https://files.pythonhosted.org/packages/82/b0/986b29938d4e8be7deb552ebfd1ef16c311276a59bcae10dec567a5b3d20/Flask-Babel-0.12.2.tar.gz (44kB)
Collecting Flask_Compress==1.4.0 (from -r /home/mycodo/requirements.txt (line 6))
  Downloading https://files.pythonhosted.org/packages/0e/2a/378bd072928f6d92fd8c417d66b00c757dc361c0405a46a0134de6fd323d/Flask-Compress-1.4.0.tar.gz
Collecting Flask_CSV==1.2.0 (from -r /home/mycodo/requirements.txt (line 7))
  Downloading https://files.pythonhosted.org/packages/27/c8/e822673a0e5add39315eba04a28c84301aa5dedd99e834c3319fe212c09c/Flask-CSV-1.2.0.tar.gz
Collecting Flask_InfluxDB==0.2 (from -r /home/mycodo/requirements.txt (line 8))
  Downloading https://files.pythonhosted.org/packages/fa/c9/bb1ce39ed08fb859dd880461429292783588353d92702d0bef7d179a1616/Flask_InfluxDB-0.2-py3-none-any.whl
Collecting Flask_Limiter==1.0.1 (from -r /home/mycodo/requirements.txt (line 9))
  Downloading https://files.pythonhosted.org/packages/56/22/70ff505dc4982ce23838da00c2ab580e95cfbe9814713fb0318898fd9191/Flask-Limiter-1.0.1.tar.gz (89kB)
Collecting Flask_Login==0.4.1 (from -r /home/mycodo/requirements.txt (line 10))
  Downloading https://files.pythonhosted.org/packages/c1/ff/bd9a4d2d81bf0c07d9e53e8cd3d675c56553719bbefd372df69bf1b3c1e4/Flask-Login-0.4.1.tar.gz
Collecting Flask_SQLAlchemy==2.3.2 (from -r /home/mycodo/requirements.txt (line 11))
  Downloading https://files.pythonhosted.org/packages/a1/44/294fb7f6bf49cc7224417cd0637018db9fee0729b4fe166e43e2bbb1f1c8/Flask_SQLAlchemy-2.3.2-py2.py3-none-any.whl
Collecting Flask_SSLify==0.1.5 (from -r /home/mycodo/requirements.txt (line 12))
  Downloading https://files.pythonhosted.org/packages/6e/98/54f2ffaf886d25eb1591cfb534c04cbf983236d657d58d180fd9ccbb5e7f/Flask-SSLify-0.1.5.tar.gz
Collecting Flask_WTF==0.14.2 (from -r /home/mycodo/requirements.txt (line 13))
  Downloading https://files.pythonhosted.org/packages/60/3a/58c629472d10539ae5167dc7c1fecfa95dd7d0b7864623931e3776438a24/Flask_WTF-0.14.2-py2.py3-none-any.whl
Collecting geocoder==1.38.1 (from -r /home/mycodo/requirements.txt (line 14))
  Downloading https://files.pythonhosted.org/packages/4f/6b/13166c909ad2f2d76b929a4227c952630ebaf0d729f6317eb09cbceccbab/geocoder-1.38.1-py2.py3-none-any.whl (98kB)
Collecting gunicorn==19.9.0 (from -r /home/mycodo/requirements.txt (line 15))
  Downloading https://files.pythonhosted.org/packages/8c/da/b8dd8deb741bff556db53902d4706774c8e1e67265f69528c14c003644e6/gunicorn-19.9.0-py2.py3-none-any.whl (112kB)
Collecting influxdb==5.0.0 (from -r /home/mycodo/requirements.txt (line 16))
  Downloading https://files.pythonhosted.org/packages/8d/79/7972c12e393080eda6920583c9c2ed2206771da7f6341c8971a2c02ff3d3/influxdb-5.0.0-py2.py3-none-any.whl (70kB)
Collecting locket==0.2.0 (from -r /home/mycodo/requirements.txt (line 17))
  Downloading https://files.pythonhosted.org/packages/d0/22/3c0f97614e0be8386542facb3a7dcfc2584f7b83608c02333bced641281c/locket-0.2.0.tar.gz
Collecting pylint (from -r /home/mycodo/requirements.txt (line 18))
  Downloading https://files.pythonhosted.org/packages/60/c2/b3f73f4ac008bef6e75bca4992f3963b3f85942e0277237721ef1c151f0d/pylint-2.3.1-py3-none-any.whl (765kB)
Collecting pyserial (from -r /home/mycodo/requirements.txt (line 19))
  Downloading https://files.pythonhosted.org/packages/0d/e4/2a744dd9e3be04a0c0907414e2a01a7c88bb3915cbe3c8cc06e209f59c30/pyserial-3.4-py2.py3-none-any.whl (193kB)
Collecting python-dateutil==2.8.0 (from -r /home/mycodo/requirements.txt (line 20))
  Downloading https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl (226kB)
Collecting requests (from -r /home/mycodo/requirements.txt (line 21))
  Downloading https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl (57kB)
Collecting rpyc==4.0.2 (from -r /home/mycodo/requirements.txt (line 22))
  Downloading https://files.pythonhosted.org/packages/ba/88/1cea477a4ad7c0f546a4c82aa367185be7b8fce512db8283e82de8454772/rpyc-4.0.2.tar.gz (53kB)
Collecting SQLAlchemy==1.3.1 (from -r /home/mycodo/requirements.txt (line 23))
  Downloading https://files.pythonhosted.org/packages/85/29/d7a5687d0d21ea8133f2d4ef02dfb4d191afe7ebc8bd9f962d99bdf595e1/SQLAlchemy-1.3.1.tar.gz (5.9MB)
Collecting WTForms==2.2.1 (from -r /home/mycodo/requirements.txt (line 24))
  Downloading https://files.pythonhosted.org/packages/9f/c8/dac5dce9908df1d9d48ec0e26e2a250839fa36ea2c602cc4f85ccfeb5c65/WTForms-2.2.1-py2.py3-none-any.whl (166kB)
Collecting Mako (from alembic==1.0.8->-r /home/mycodo/requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/eb/69/6137c60cae2ab8c911bff510bb6d1d23a0189f75d114bb277606c6486b5f/Mako-1.0.8.tar.gz (468kB)
Collecting python-editor>=0.3 (from alembic==1.0.8->-r /home/mycodo/requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/c6/d3/201fc3abe391bbae6606e6f1d598c15d367033332bd54352b12f35513717/python_editor-1.0.4-py3-none-any.whl
Collecting cffi>=1.1 (from bcrypt==3.1.4->-r /home/mycodo/requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/64/7c/27367b38e6cc3e1f49f193deb761fe75cda9f95da37b67b422e62281fcac/cffi-1.12.2.tar.gz (453kB)
Collecting six>=1.4.1 (from bcrypt==3.1.4->-r /home/mycodo/requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting click>=5.1 (from Flask==1.0.2->-r /home/mycodo/requirements.txt (line 4))
  Downloading https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl (81kB)
Collecting Werkzeug>=0.14 (from Flask==1.0.2->-r /home/mycodo/requirements.txt (line 4))
  Downloading https://files.pythonhosted.org/packages/29/5e/d54398f8ee78166d2cf07e46d19096e55aba506e44de998a1ad85b83ec8d/Werkzeug-0.15.0-py2.py3-none-any.whl (328kB)
Collecting itsdangerous>=0.24 (from Flask==1.0.2->-r /home/mycodo/requirements.txt (line 4))
  Downloading https://files.pythonhosted.org/packages/76/ae/44b03b253d6fade317f32c24d100b3b35c2239807046a4c953c7b89fa49e/itsdangerous-1.1.0-py2.py3-none-any.whl
Collecting Jinja2>=2.10 (from Flask==1.0.2->-r /home/mycodo/requirements.txt (line 4))
  Downloading https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl (126kB)
Collecting Babel>=2.3 (from Flask_Babel==0.12.2->-r /home/mycodo/requirements.txt (line 5))
  Downloading https://files.pythonhosted.org/packages/b8/ad/c6f60602d3ee3d92fbed87675b6fb6a6f9a38c223343ababdb44ba201f10/Babel-2.6.0-py2.py3-none-any.whl (8.1MB)
Collecting csvalidate (from Flask_CSV==1.2.0->-r /home/mycodo/requirements.txt (line 7))
  Downloading https://files.pythonhosted.org/packages/be/4e/039798c21e8297fd59629c96ba5ad62806245c6ea6d5a36647f71d0a6963/csvalidate-1.1.1.tar.gz
Collecting marshmallow (from Flask_CSV==1.2.0->-r /home/mycodo/requirements.txt (line 7))
  Downloading https://files.pythonhosted.org/packages/77/a3/4a9bf148dbe336ad068cc413f3683f9c275ea31f94ec05d19ea75f580b7b/marshmallow-2.19.1-py2.py3-none-any.whl (49kB)
Collecting limits (from Flask_Limiter==1.0.1->-r /home/mycodo/requirements.txt (line 9))
  Downloading https://files.pythonhosted.org/packages/62/97/27fbc02dcae873d2e12995d882a02ceab1cb8f7726f64e7f290351e1a13b/limits-1.3.tar.gz
Collecting ratelim (from geocoder==1.38.1->-r /home/mycodo/requirements.txt (line 14))
  Downloading https://files.pythonhosted.org/packages/f2/98/7e6d147fd16a10a5f821db6e25f192265d6ecca3d82957a4fdd592cad49c/ratelim-0.1.6-py2.py3-none-any.whl
Collecting future (from geocoder==1.38.1->-r /home/mycodo/requirements.txt (line 14))
  Downloading https://files.pythonhosted.org/packages/90/52/e20466b85000a181e1e144fd8305caf2cf475e2f9674e797b222f8105f5f/future-0.17.1.tar.gz (829kB)
Collecting pytz (from influxdb==5.0.0->-r /home/mycodo/requirements.txt (line 16))
  Downloading https://files.pythonhosted.org/packages/61/28/1d3920e4d1d50b19bc5d24398a7cd85cc7b9a75a490570d5a30c57622d34/pytz-2018.9-py2.py3-none-any.whl (510kB)
Collecting astroid<3,>=2.2.0 (from pylint->-r /home/mycodo/requirements.txt (line 18))
  Downloading https://files.pythonhosted.org/packages/d5/ad/7221a62a2dbce5c3b8c57fd18e1052c7331adc19b3f27f1561aa6e620db2/astroid-2.2.5-py3-none-any.whl (193kB)
Collecting mccabe<0.7,>=0.6 (from pylint->-r /home/mycodo/requirements.txt (line 18))
  Downloading https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl
Collecting isort<5,>=4.2.5 (from pylint->-r /home/mycodo/requirements.txt (line 18))
  Downloading https://files.pythonhosted.org/packages/b6/89/3137d13dd30a0d063435661950f6dfd50957532989e49aef652f490ef616/isort-4.3.15-py2.py3-none-any.whl (42kB)
Collecting certifi>=2017.4.17 (from requests->-r /home/mycodo/requirements.txt (line 21))
  Downloading https://files.pythonhosted.org/packages/60/75/f692a584e85b7eaba0e03827b3d51f45f571c2e793dd731e598828d380aa/certifi-2019.3.9-py2.py3-none-any.whl (158kB)
Collecting urllib3<1.25,>=1.21.1 (from requests->-r /home/mycodo/requirements.txt (line 21))
  Downloading https://files.pythonhosted.org/packages/62/00/ee1d7de624db8ba7090d1226aebefab96a2c71cd5cfa7629d6ad3f61b79e/urllib3-1.24.1-py2.py3-none-any.whl (118kB)
Collecting idna<2.9,>=2.5 (from requests->-r /home/mycodo/requirements.txt (line 21))
  Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
Collecting chardet<3.1.0,>=3.0.2 (from requests->-r /home/mycodo/requirements.txt (line 21))
  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
Collecting plumbum (from rpyc==4.0.2->-r /home/mycodo/requirements.txt (line 22))
  Downloading https://files.pythonhosted.org/packages/48/48/0c592a65c8ecc6a4c0da41d75097704a283595b6731be1531eee3f4f7778/plumbum-1.6.7-py2.py3-none-any.whl (110kB)
Collecting MarkupSafe>=0.9.2 (from Mako->alembic==1.0.8->-r /home/mycodo/requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/b9/2e/64db92e53b86efccfaea71321f597fa2e1b2bd3853d8ce658568f7a13094/MarkupSafe-1.1.1.tar.gz
Collecting pycparser (from cffi>=1.1->bcrypt==3.1.4->-r /home/mycodo/requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz (158kB)
Collecting decorator (from ratelim->geocoder==1.38.1->-r /home/mycodo/requirements.txt (line 14))
  Downloading https://files.pythonhosted.org/packages/5f/88/0075e461560a1e750a0dcbf77f1d9de775028c37a19a346a6c565a257399/decorator-4.4.0-py2.py3-none-any.whl
Collecting lazy-object-proxy (from astroid<3,>=2.2.0->pylint->-r /home/mycodo/requirements.txt (line 18))
  Downloading https://files.pythonhosted.org/packages/55/08/23c0753599bdec1aec273e322f277c4e875150325f565017f6280549f554/lazy-object-proxy-1.3.1.tar.gz
Collecting typed-ast>=1.3.0; implementation_name == "cpython" (from astroid<3,>=2.2.0->pylint->-r /home/mycodo/requirements.txt (line 18))
  Downloading https://files.pythonhosted.org/packages/fc/c6/61d6410fc70fda073bd1810f9b7f7022f00146b108f278a0c00041bfe5b0/typed-ast-1.3.1.tar.gz (204kB)
Collecting wrapt (from astroid<3,>=2.2.0->pylint->-r /home/mycodo/requirements.txt (line 18))
  Downloading https://files.pythonhosted.org/packages/67/b2/0f71ca90b0ade7fad27e3d20327c996c6252a2ffe88f50a95bba7434eda9/wrapt-1.11.1.tar.gz
Installing collected packages: SQLAlchemy, MarkupSafe, Mako, python-editor, six, python-dateutil, alembic, argparse, pycparser, cffi, bcrypt, click, Werkzeug, itsdangerous, Jinja2, Flask, pytz, Babel, Flask-Babel, Flask-Compress, csvalidate, marshmallow, Flask-CSV, certifi, urllib3, idna, chardet, requests, influxdb, Flask-InfluxDB, limits, Flask-Limiter, Flask-Login, Flask-SQLAlchemy, Flask-SSLify, WTForms, Flask-WTF, decorator, ratelim, future, geocoder, gunicorn, locket, lazy-object-proxy, typed-ast, wrapt, astroid, mccabe, isort, pylint, pyserial, plumbum, rpyc
  Running setup.py install for SQLAlchemy: started
    Running setup.py install for SQLAlchemy: finished with status 'done'
  Running setup.py install for MarkupSafe: started
    Running setup.py install for MarkupSafe: finished with status 'done'
  Running setup.py install for Mako: started
    Running setup.py install for Mako: finished with status 'done'
  Running setup.py install for alembic: started
    Running setup.py install for alembic: finished with status 'done'
  Running setup.py install for pycparser: started
    Running setup.py install for pycparser: finished with status 'done'
  Running setup.py install for cffi: started
    Running setup.py install for cffi: finished with status 'done'
  Running setup.py install for bcrypt: started
    Running setup.py install for bcrypt: finished with status 'done'
  Running setup.py install for Flask-Babel: started
    Running setup.py install for Flask-Babel: finished with status 'done'
  Running setup.py install for Flask-Compress: started
    Running setup.py install for Flask-Compress: finished with status 'done'
  Running setup.py install for csvalidate: started
    Running setup.py install for csvalidate: finished with status 'done'
  Running setup.py install for Flask-CSV: started
    Running setup.py install for Flask-CSV: finished with status 'done'
  Running setup.py install for limits: started
    Running setup.py install for limits: finished with status 'done'
  Running setup.py install for Flask-Limiter: started
    Running setup.py install for Flask-Limiter: finished with status 'done'
  Running setup.py install for Flask-Login: started
    Running setup.py install for Flask-Login: finished with status 'done'
  Running setup.py install for Flask-SSLify: started
    Running setup.py install for Flask-SSLify: finished with status 'done'
  Running setup.py install for future: started
    Running setup.py install for future: finished with status 'done'
  Running setup.py install for locket: started
    Running setup.py install for locket: finished with status 'done'
  Running setup.py install for lazy-object-proxy: started
    Running setup.py install for lazy-object-proxy: finished with status 'done'
  Running setup.py install for typed-ast: started
    Running setup.py install for typed-ast: still running...
    Running setup.py install for typed-ast: finished with status 'done'
  Running setup.py install for wrapt: started
    Running setup.py install for wrapt: finished with status 'done'
  Running setup.py install for rpyc: started
    Running setup.py install for rpyc: finished with status 'done'
Successfully installed Babel-2.6.0 Flask-1.0.2 Flask-Babel-0.12.2 Flask-CSV-1.2.0 Flask-Compress-1.4.0 Flask-InfluxDB-0.2 Flask-Limiter-1.0.1 Flask-Login-0.4.1 Flask-SQLAlchemy-2.3.2 Flask-SSLify-0.1.5 Flask-WTF-0.14.2 Jinja2-2.10 Mako-1.0.8 MarkupSafe-1.1.1 SQLAlchemy-1.3.1 WTForms-2.2.1 Werkzeug-0.15.0 alembic-1.0.8 argparse-1.4.0 astroid-2.2.5 bcrypt-3.1.4 certifi-2019.3.9 cffi-1.12.2 chardet-3.0.4 click-7.0 csvalidate-1.1.1 decorator-4.4.0 future-0.17.1 geocoder-1.38.1 gunicorn-19.9.0 idna-2.8 influxdb-5.0.0 isort-4.3.15 itsdangerous-1.1.0 lazy-object-proxy-1.3.1 limits-1.3 locket-0.2.0 marshmallow-2.19.1 mccabe-0.6.1 plumbum-1.6.7 pycparser-2.19 pylint-2.3.1 pyserial-3.4 python-dateutil-2.8.0 python-editor-1.0.4 pytz-2018.9 ratelim-0.1.6 requests-2.21.0 rpyc-4.0.2 six-1.12.0 typed-ast-1.3.1 urllib3-1.24.1 wrapt-1.11.1
Removing intermediate container ed10f052da02
 ---> 797479dad6bc
Step 9/10 : RUN /home/mycodo/mycodo/scripts/upgrade_commands.sh ssl-certs-generate
 ---> Running in 3b5bbc350c1a

#### Checking for SSL certificates in /var/mycodo/ssl_certs/

#### Generating SSL certificates in /var/mycodo/ssl_certs/
Generating RSA private key, 4096 bit long modulus
....................................................................................................................................................................................................................................................++++
...........................++++
e is 65537 (0x010001)
writing RSA key
Signature ok
subject=O = mycodo, OU = mycodo, CN = mycodo
Getting Private key
Removing intermediate container 3b5bbc350c1a
 ---> 3feb734f50d0
Step 10/10 : RUN /home/mycodo/mycodo/scripts/upgrade_commands.sh compile-translations
 ---> Running in 56cb67a91acd

#### Compiling Translations
compiling catalog mycodo_flask/translations/es/LC_MESSAGES/messages.po to mycodo_flask/translations/es/LC_MESSAGES/messages.mo
compiling catalog mycodo_flask/translations/pt/LC_MESSAGES/messages.po to mycodo_flask/translations/pt/LC_MESSAGES/messages.mo
compiling catalog mycodo_flask/translations/it/LC_MESSAGES/messages.po to mycodo_flask/translations/it/LC_MESSAGES/messages.mo
compiling catalog mycodo_flask/translations/de/LC_MESSAGES/messages.po to mycodo_flask/translations/de/LC_MESSAGES/messages.mo
compiling catalog mycodo_flask/translations/nb/LC_MESSAGES/messages.po to mycodo_flask/translations/nb/LC_MESSAGES/messages.mo
compiling catalog mycodo_flask/translations/sv/LC_MESSAGES/messages.po to mycodo_flask/translations/sv/LC_MESSAGES/messages.mo
compiling catalog mycodo_flask/translations/nl/LC_MESSAGES/messages.po to mycodo_flask/translations/nl/LC_MESSAGES/messages.mo
compiling catalog mycodo_flask/translations/zh/LC_MESSAGES/messages.po to mycodo_flask/translations/zh/LC_MESSAGES/messages.mo
compiling catalog mycodo_flask/translations/fr/LC_MESSAGES/messages.po to mycodo_flask/translations/fr/LC_MESSAGES/messages.mo
compiling catalog mycodo_flask/translations/ru/LC_MESSAGES/messages.po to mycodo_flask/translations/ru/LC_MESSAGES/messages.mo
compiling catalog mycodo_flask/translations/sr/LC_MESSAGES/messages.po to mycodo_flask/translations/sr/LC_MESSAGES/messages.mo
Removing intermediate container 56cb67a91acd
 ---> fc98af08d7ac

Successfully built fc98af08d7ac
Successfully tagged app:latest
Building nginx
Step 1/7 : FROM nginx:1.15.9
1.15.9: Pulling from library/nginx
ecad9bd7ef0c: Already exists
f5cfe1bc5a80: Pull complete
b23447a4f47c: Pull complete
Digest: sha256:98efe605f61725fd817ea69521b0eeb32bef007af0e3d0aeb6258c6e6fe7fc1a
Status: Downloaded newer image for nginx:1.15.9
 ---> 9389658f86a0
Step 2/7 : RUN rm /etc/nginx/nginx.conf
 ---> Running in cce8a9a717f7
Removing intermediate container cce8a9a717f7
 ---> 9f7b3dec49cf
Step 3/7 : COPY nginx.conf /etc/nginx/
 ---> 9d9bd170a2e9
Step 4/7 : RUN rm /etc/nginx/conf.d/default.conf
 ---> Running in 832f6876e3e6
Removing intermediate container 832f6876e3e6
 ---> cee0013ca526
Step 5/7 : COPY project.conf /etc/nginx/conf.d/
 ---> b442270169e7
Step 6/7 : RUN mkdir -pv /var/mycodo
 ---> Running in 871a9c3f7753
mkdir: created directory '/var/mycodo'
Removing intermediate container 871a9c3f7753
 ---> 8bd0af5d1717
Step 7/7 : COPY 502.html /var/mycodo/
 ---> bbcfefa76198

Successfully built bbcfefa76198
Successfully tagged mycodo_nginx:latest
Creating influxdb ... done
Creating flask ... done
Creating nginx ... done
Creating daemon ... done
pi@everlast:~/Mycodo $

And guess what I got. Magic.

Gonna go explore now, however I have a few comments just for fun

Collecting itsdangerous>=0.24 (from Flask==1.0.2->-r /home/mycodo/requirements.txt (line 4))

That guy stole my best bad idea for a library.

The only misadventure was not adding 'sudo' to the 'make build' instruction. I'm starting to make a habit of writing instructions to include the 'sudo' and I bold the rest of the command-line. This makes it easy to cut and paste for lazy, root-less folks such as myself. I don't wanna be root. Being root warps the perceptions of usage, usually in unfortunate ways.

I have a GUI. Nice work Kyle!

I logged in and looked around a little so far. Will try some of the basic stuff and see what works.

I have this big smile right now. That saying about how 'nothing good ever happens after midnight' came from someone who was doing it wrong. At least that is my perspective.

@Theoi-Meteoroi
Copy link
Contributor

Well the first thing I tried was a USB connected sensor - the MH-z19. I cannot change the port from hardware serial due to some access issue:

Error: Modify Input: Invalid device or improper permissions to read device

I tried changing perms on the device, that isn't the issue. Its a container thing. And don't I like a challenge. Containers are attractive to me because as you become more ambitious with Mycodo, the platform becomes the limiting factor, even with four cores. For straight forward PID tasks with a few sensors, the Pi is more than cost effective. As the sensors become more sophisticated or you are simply ambitious ( voice control, integration with other code ) containers could allow the kind of isolation that prevents total system failure when a feature doesn't work as expected. Like the code I write.

I will have to come back to this later. So much to do. But it is a beginning and that is pretty exciting. The OS can take this to a number of higher performance platforms if ported with that in mind. There may be a way (I think there is) to push most of the work and storage to a cloud instance and have a lower end device like the Pi be the real-world proxy. Once you program a PID, the work is local and the rest can be more or less done elsewhere. This provides scale, if needed and still maintain a single pane of glass for complex configurations. Anything built in the cloud can also be done on a local server with virtualization, if you are allergic to clouds.

@kizniche
Copy link
Owner Author

kizniche commented Mar 21, 2019

Glad to see it's running! Here are a few notes before I begin my own investigation into getting external sensors working:

The only misadventure was not adding 'sudo' to the 'make build' instruction. I'm starting to make a habit of writing instructions to include the 'sudo' and I bold the rest of the command-line. This makes it easy to cut and paste for lazy, root-less folks such as myself. I don't wanna be root. Being root warps the perceptions of usage, usually in unfortunate ways.

After you issued the command sudo usermod -aG docker pi to add your user to the docker group, you must log out and back in for it to take effect. Then you can call docker without root privileges.

I have this big smile right now. That saying about how 'nothing good ever happens after midnight' came from someone who was doing it wrong. At least that is my perspective.

😃

Well the first thing I tried was a USB connected sensor - the MH-z19. I cannot change the port from hardware serial due to some access issue:
Error: Modify Input: Invalid device or improper permissions to read device

I haven't attempted to do this yet, so I'll see how I can fix this. I have privileged: true in the docker-compose.yml file, which should give access to the system devices, but I haven't done much more than this to get external sensors working on the Mycodo end.

In other news, today I'm implementing my recently-built outdoor LoRaWAN gateway (photo attached) on my university farm and sending sensor data from the surrounding greenhouses to The Things Network before being acquired by Mycodo (or multiple Mycodos). I got the BME280 working on my TTGO T-Beam dev. platform last night and just recently added support for downloading data from The Things Network into Mycodo via a TTN Input module. I'm going to be working on a way to make this Input module able to have a variable number if measurements selected (opposed to the current hard-coded ones for just the BME280), then each measurement can have its own unit/measurement configured, so there won't be any limitation to the number or type of measurements.

20190320_084245~01

@kizniche
Copy link
Owner Author

The gateway was successfully deployed on the farm and one node is currently measuring temperature, humidity, pressure, dew point, and vapor pressure deficit in one of the hydroponic greenhouses. Now to see if the system remains stable over a paltry cellular internet connection. I've already set up the Mycodo on the farm to download the data from TTN, just as I have at home, and it's working perfectly so far.

Regarding docker, I found the missing configuration settings I needed to detect devices after the container has started. I just pushed an update and successfully tested the MH-Z16/UART over USB, connected after the container started!

@kizniche
Copy link
Owner Author

kizniche commented May 6, 2019

I added Telegraf and Grafana to the docker build to experiment a bit with them. They were easily integrated, and add a new set of system monitoring and dashboard capability for Mycodo data. I'm not sure if they'll stay, but for the time being, they're included in the Docker build. I also fixed several issues with the dependency install script, moved everything to using Python 3, and successfully tested on a fresh install of Raspbian for everything to work.

@kizniche
Copy link
Owner Author

After much toiling, I have the latest version of Mycodo (8.1.1) running in Docker containers, without sacrificing its ability to be normally installed on a Raspberry Pi. I'll push my edits to master soon, after I tweak some of the volumes and directory structures. Here's it running on Ubuntu 18.04 (64-bit):

Screenshot_2019-11-30 c6b0d87e94bd - Dashboard - Mycodo 8 1 1

@kizniche
Copy link
Owner Author

The mycodo_docker branch is now defunct (and will be removed soon), as I've been successful at integrating the docker code to master without sacrificing any normal functionality. The Docker configuration/build files can be found under the docker folder, with docker/README.md containing all the current setup/build information.

There is a lot of functionality that doesn't work, but I'll be working on this gradually. This is a good step to bringing Mycodo available to other platforms.

Containers running on a full build

kiz@kimchi:~/PycharmProjects/Mycodo/docker$ docker container ls
CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS              PORTS                                                                    NAMES
22ea6edd7511        app                      "bash -c 'PYTHONPATH…"   15 minutes ago      Up 15 minutes       0.0.0.0:9090->9090/tcp                                                   mycodo_daemon
baa0b92e76f8        docker_nginx             "nginx -g 'daemon of…"   15 minutes ago      Up 15 minutes       0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp                                 nginx
777b051a7079        grafana/grafana:latest   "/run.sh"                15 minutes ago      Up 15 minutes       0.0.0.0:3000->3000/tcp                                                   grafana
9a153480c81c        app                      "gunicorn --workers …"   15 minutes ago      Up 15 minutes                                                                                mycodo_flask
27bc125d1cf8        telegraf:latest          "/entrypoint.sh tele…"   15 minutes ago      Up 15 minutes       8092/udp, 8125/udp, 8094/tcp                                             telegraf
075d0552cc63        docker_influxdb          "/entrypoint.sh /bin…"   16 minutes ago      Up 15 minutes       0.0.0.0:8083->8083/tcp, 0.0.0.0:8086->8086/tcp, 0.0.0.0:8090->8090/tcp   influxdb

Grafana/Telegraf (only part of full stats available)

Screenshot_2019-11-30 Telegraf system overview - Grafana

@Theoi-Meteoroi
Copy link
Contributor

Thanks Kyle! I'm going to spend some time looking at how this might work on a Mac with dockerdesktop. I'm just looking for serial port inputs right now and maybe a "sensor pod" on a FTDI-4232 with python code input to Mycodo. I can do the initial work on the standard release on a pi and then try it on a laptop with containers. USB-C changes what you can attach to a laptop (for instrumentation) and power has always been my biggest challenge. Hang enough sensors on a Pi and the power gets flaky with most wall-wart supplies. And some sensors I want to use ( AS7265x spectral sensor ) just crush the CPU on a pi with the matlab code to generate the spectral chart.
I think I whined earlier about Grafana - saying Mycodo saved me from having to do that. I'm using Grafana in my day job now for visualizing prometheus data. And so now, I'm doing that.

kizniche added a commit that referenced this issue Jun 14, 2020
@nargetdev
Copy link

I'm just beginning my journey towards Dockerized mycodo. I'm very keen to port to balenaOS for my RPi's but I'm shooting towards docker-compose on my Ubuntu machine first.

I'm specifically having trouble building mycodo_flask. I think it's an environment thing, it seems to be that pip is missing from mycodo's version of python?

    "${MYCODO_PATH}"/env/bin/python -m pip install --upgrade pip
                                                                       ^
                                                                       |
                                                                  missing

Why does mycodo manage it's own binaries? Vs venv or the like?

Anyways I was able to get mycodo_flask to build by commenting some of the following, but then get runtime failure.

RUN /home/mycodo/mycodo/scripts/upgrade_commands.sh create-files-directories
RUN /home/mycodo/mycodo/scripts/upgrade_commands.sh update-apt
RUN /home/mycodo/mycodo/scripts/upgrade_commands.sh update-packages
RUN /home/mycodo/mycodo/scripts/upgrade_commands.sh install-docker-ce-cli
#RUN /home/mycodo/mycodo/scripts/upgrade_commands.sh docker-update-pip
#RUN /home/mycodo/mycodo/scripts/upgrade_commands.sh docker-update-pip-packages
RUN /home/mycodo/mycodo/scripts/upgrade_commands.sh ssl-certs-generate
#RUN /home/mycodo/mycodo/scripts/upgrade_commands.sh docker-compile-translations
RUN /home/mycodo/mycodo/scripts/upgrade_commands.sh compile-mycodo-wrapper

@kizniche
Copy link
Owner Author

kizniche commented Jan 14, 2022

@nargetdev You should use the code from the master branch, not the latest release. You're currently using old docker code. Try the master branch and it should work.

@nargetdev
Copy link

Ah.. forgot to git pull

@kizniche
Copy link
Owner Author

kizniche commented Jan 14, 2022

I made a bunch of docker changes since the last release: bd38694, 11e4114, and d2f9dbc. So there should be significant improvements with building and more recent software versions.

@nargetdev
Copy link

Yes it worked this time. Nice work Kyle.

I'll stay posted regarding balena. Should be relatively straight forward.
A few minor structural changes needed - docker-compose.yml needs to be in the root of the repo, and all bind mounts (ref to explicit host path) needs removed.

@nargetdev
Copy link

For what it's worth I managed to get the following fork to successfully upload the docker images to the RPi via balena push ... but there's a myriad of runtime issues that crop up, probably because I ripped out all the bind mounts from the docker-compose.yml

https://github.com/nargetdev/balena-mycodo

More to come as I dig in further..

@jamie-mint
Copy link
Contributor

I'm getting errors with the host networking in the compose context. (because compose renames network hostnames)

the below example is illustrative:

[mycodo_telegraf] 2022-07-19T00:19:47Z E! [outputs.influxdb] When writing to [http://localhost:8086]: failed doing req: Post "http://localhost:8086/write?db=telegraf": dial tcp 127.0.0.1:8086: connect: connection refused

It should be found at:
mycodo_influxdb:8086

I'm wondering as you'd said previously @kizniche you don't want to break compatibility with the "normal" build. Without making a ton of defines/exceptions for every single mention of localhost/127.0.0.1 towards microservices names in docker-compose context what do you think is the path of least resistance here?

@kizniche
Copy link
Owner Author

kizniche commented Jul 19, 2022

Fortunately just a few weeks ago I added the ability to configure influxdb settings in the Mycodo database. This includes the ability to set the hostname to connect to influxdb. I haven't tested it, but I suspect if you change it from "localhost" to "mycodo_influxdb", it should work. You'll need to install from the master branch, because this hasn't been released yet.

@kizniche
Copy link
Owner Author

The docker influxdb install script run.sh was only designed for influxdb 1.x, and since 1.x and 2.x have incompatible commands, the commands used to create the db/user/password likely don't work with 2.x.

@kizniche
Copy link
Owner Author

See here for the difference between the two:

'update-influxdb-1-db-user')
printf "\n#### Creating InfluxDB 1.x database and user\n"
# Attempt to connect to influxdb 10 times, sleeping 60 seconds every fail
for _ in {1..10}; do
# Check if influxdb has successfully started and be connected to
printf "#### Attempting to connect...\n" &&
curl -sL -I localhost:8086/ping > /dev/null &&
influx -execute "CREATE DATABASE mycodo_db" &&
influx -database mycodo_db -execute "CREATE USER mycodo WITH PASSWORD 'mmdu77sj3nIoiajjs'" &&
printf "#### Influxdb database and user successfully created\n" &&
break ||
# Else wait 60 seconds if the influxd port is not accepting connections
# Everything below will begin executing if an error occurs before the break
printf "#### Could not connect to Influxdb. Waiting 60 seconds then trying again...\n" &&
sleep 60
done
;;
'update-influxdb-2-db-user')
printf "\n#### Creating InfluxDB 2.x database and user\n"
# Attempt to connect to influxdb 10 times, sleeping 60 seconds every fail
for _ in {1..10}; do
# Check if influxdb has successfully started and be connected to
printf "#### Attempting to connect...\n" &&
curl -sL -I localhost:8086/ping > /dev/null &&
influx setup \
--org mycodo \
--bucket mycodo_db \
--username mycodo \
--password mmdu77sj3nIoiajjs \
--force
printf "#### Influxdb database and user successfully created\n" &&
break ||
# Else wait 60 seconds if the influxd port is not accepting connections
# Everything below will begin executing if an error occurs before the break
printf "#### Could not connect to Influxdb. Waiting 60 seconds then trying again...\n" &&
sleep 60
done
;;

@nargetdev
Copy link

nargetdev commented Jul 30, 2022

Yes I just found the install commands that are invoked on the upstream (non-docker) install/setup.sh script

if [[ ${INFLUX} == '1)' ]]; then
    ${INSTALL_CMD} update-influxdb-1 2>&1 | tee -a "${LOG_LOCATION}"
    ${INSTALL_CMD} update-influxdb-1-db-user 2>&1 | tee -a "${LOG_LOCATION}"
elif [[ ${INFLUX} == '2)' ]]; then
    ${INSTALL_CMD} update-influxdb-2 2>&1 | tee -a "${LOG_LOCATION}"
    ${INSTALL_CMD} update-influxdb-2-db-user 2>&1 | tee -a "${LOG_LOCATION}"

I tested this out (outside of docker), but i still somehow end up with an influxdb1.8 install

Anyways, no worries. In due time I may take a look at porting influxdb2.x to the docker side, but ver 1.x is fine for now.

-- UPDATE, dirty system.. clean install from master and I'm up and running on 2.2

.. for anyone onlooking if you need to get around the SSL issues before setting up certs you can do the following
sudo ssh -L 8086:127.0.0.1:8086 -N -f username@mycodo_hostname.local
in order to port forward the influxdb2.0 gui to your localhost 127.0.0.1:8086

@kizniche
Copy link
Owner Author

kizniche commented Aug 26, 2022

one click deploy to any (or many) balenaOS devices simultaneously with single pane of glass management.

I'm not familiar with this. Can you give give a breakdown of how this works or how to do it?

balenaOS doesn't accept a parent dir context (i.e. context: ../)

Why is this? Is the only solution to put the docker root directory (or just docker-compose.yaml) at the root of the Mycodo repository? I guess this wouldn't be too much of an issue if all the other directories were placed inside a docker/ directory. The directory structure of nargetdev/balena-mycodo currently has all these docker directories in the root of Mycodo. Could these be moved to docker/ and still work? If so, I'd be more open to merging the pull request since it keeps the docker and non-docker portions of Mycodo more segregated. Docker is still an experimental feature that needs some improvement, so is still a secondary feature at this point.

@nargetdev
Copy link

Hey there. So for the time being I've actually graduated to a lightweight Kubernetes (k3s) based deployment to manage my RPis and I'm finding it to be delicious, albeit with a learning curve (k8s manifests are much more verbose than docker-compose.yml)

k8s is not opinionated about a specific file structure in the way that BalenaOS mandates - so it's definitely possible now without mutilating the structure / mucking up bare metal compatibility.

My workflow for my own services has generally involved a build command like the following:

docker buildx build --push \
            --platform linux/arm64 \
            --tag nargetdev/cam-gbucket-dgraph:0.2.1   .

... in order to build cross platform image for RPi from my Macbook (very zippy build)

My motivation for switching to k3s from balena initially was their 10 device limit, but since then I've realized quite a few advantages that come packaged with k8s ecosystem in terms of observability, and extensive tooling of the mainstream de-facto standard for container management.

P.S. regarding BalenaOS / BalenaCloud - best way to grok I think is to just make an account at https://www.balena.io/ and flash some RPis with their OS and push some containers to the runtime (they have tons of tutorials). It's a very nice docker distro with bells and whistles (like a filesystem watcher that automatically rebuilds and pushes images to your devices as you edit source), but they do have a 10 device limit for their cloud PaaS - at which point you could just run your own open source instance, but I haven't tried, as I'm all in on k3s for now.

@nargetdev
Copy link

nargetdev commented Nov 4, 2022

Ah.. one gotcha with k3s - you can choose to do this either the k3s way or the baremetal way at boot.

For k3s on the pi the cgroup_memory=1 cgroup_enable=memory must be set in /boot/cmdline.txt. This seems to muck up the nginx or flask or something when trying to run mycodo normally (really just the frontend - daemon still works fine). So normal Mycodo on the host or Mycodo via docker would have to be selected at boot.. but as long as one is aware that they are mutually exclusive at runtime I don't think it's a problem
.. furthermore other k8s edge distros don't have this problem - for instance I was running KubeEdge services and bare metal (normal mycodo) concurrently.

@nargetdev
Copy link

@kizniche do you have a map for which volume mounts are populated on initial creation by the file system of the container? I didn't realize how Docker handles this until just now (I.e. initialized volume will clobber Docker file system, vs empty volume will assume Docker file system). I haven't looked at this closely yet, but I noticed it when containers were crashing because /home/mycodo/env/python was getting clobbered. The python executable for example should be in a RO location. What is needing to be persisted across containers and for what reasons? I'd like to limit or eliminate the possibility of clobber / runtime inconsistency due to initialized / uninitialized volumes.

Cheers. To containers.

@kizniche
Copy link
Owner Author

Are you referring to these?

- mycodo:/usr/local/mycodo
- mycodo_env:/home/mycodo/env
- mycodo_databases:/home/mycodo/databases
- mycodo_custom_functions:/home/mycodo/mycodo/functions/custom_functions
- mycodo_custom_actions:/home/mycodo/mycodo/actions/custom_actions
- mycodo_custom_inputs:/home/mycodo/mycodo/inputs/custom_inputs
- mycodo_custom_outputs:/home/mycodo/mycodo/outputs/custom_outputs
- mycodo_custom_widgets:/home/mycodo/mycodo/widgets/custom_widgets
- mycodo_custom_user_scripts:/home/mycodo/mycodo/user_scripts
- mycodo_log:/var/log/mycodo
- mycodo_ssl_certs:/home/mycodo/mycodo/mycodo_flask/ssl_certs

@kizniche
Copy link
Owner Author

@nargetdev could you please provide some more information about building/running on kubernetes? I'd like to explore this option more, but my experience is virtually all with Docker, so I could use some help getting this going and want to avoid fumbling around and hitting common issues that can be avoided with some guidance. Thanks.

@jonny-sexton
Copy link

Hi,

I am having a few issues running Mycodo on my Raspberry Pi Zero via docker. I have run the following commands successfully:

git clone https://github.com/kizniche/Mycodo
cd Mycodo/docker
sudo /bin/bash ./setup.sh dependencies

However, when I then ran sudo make build I got the following error:

The requested image's platform (linux/arm/v7) does not match the detected host platform (linux/arm/v6) and no specific platform was requested

Which I fixed by repacing FROM influxdb:1.8.10 with FROM mendhak/arm32v6-influxdb in /Mycodo/docker/influxdb/Dockerfile

I now have another error that I am not able to resolve:

ERROR: Service 'mycodo_flask' failed to build: The command '/bin/sh -c /home/mycodo/mycodo/scripts/upgrade_commands.sh install-docker-ce-cli' returned a non-zero code: 1

I checked and the file /home/mycodo/mycodo/scripts/upgrade_commands.sh does not exist. It appears that the line:

COPY ./mycodo/scripts/upgrade_commands.sh /home/mycodo/mycodo/scripts/upgrade_commands.sh

in Mycodo/docker/Dockerfile is not correct, as it should be:

COPY ../mycodo/scripts/upgrade_commands.sh /home/mycodo/mycodo/scripts/upgrade_commands.sh

instead. I have of coursed tried correcting this, running sudo make build -C docker from the parent directory instead, which should fix the relevant path issue. I also tried copying the files manually. However, I am still not able to correct this issue (I always end up having the same error message).

I will try the standard installation method instead now, which should be sufficient for my purposes. I just thought I would let you know in case I am doing anything wrong here.

Looking forward to working with Mycodo!

Cheers,

Jonny

@kizniche
Copy link
Owner Author

kizniche commented Nov 20, 2022

I've actually been working on Docker all day today. The branch I'm working on is https://github.com/kizniche/Mycodo/tree/docker-01 but I have several changes still uncommitted. I just got everything to build nicely on a Pi 4 and will be pushing changes soon, then merging into master shortly after. You may need to perform your change still for 32-bit ARM devices like your Pi, unless we can figure out a way to detect this automatically.

@jonny-sexton
Copy link

Brilliant, thanks for the speedy response! I retried the steps outlined above on the docker-01 branch, and the orginial issue is solved. However I now have a new error message:

ERROR: Service 'mycodo_daemon' failed to build: The command '/bin/sh -c /home/mycodo/mycodo/scripts/upgrade_commands.sh install-docker' returned a non-zero code: 100

I had a quick look, but tbh I don't understand where the issue lies.

@jonny-sexton
Copy link

jonny-sexton commented Nov 20, 2022

unless we can figure out a way to detect this automatically.

You can detect which chip architecture a linux machine has with the arch command. On the pi zero I get the following:

armv6l

On the pi 4 you should get

aarch64

I believe.

@kizniche
Copy link
Owner Author

I just committed (and merged into master) my final changes for Docker. I haven't tested on a Pi Zero.

I now have a new error message: ERROR: Service 'mycodo_daemon' failed to build...

Is this all there was in the log? No other errors?

@jonny-sexton
Copy link

OK, I will try again then with the master branch. I ran the docker-compose up command with the --verbose option and here are the last few lines of code before the error appears:

compose.cli.verbose_proxy.proxy_callable: docker build -> <generator object APIClient._stream_helper at 0xb4849530>
compose.cli.verbose_proxy.proxy_callable: docker close <- ()
compose.cli.verbose_proxy.proxy_callable: docker close -> None
compose.service.build: Building mycodo_daemon
compose.cli.verbose_proxy.proxy_callable: docker build <- (path='/home/Jonny/Mycodo', tag='app', rm=True, forcerm=False, pull=False, nocache=False, dockerfile='docker/Dockerfile', cache_from=None, labels=None, buildargs={}, network_mode=None, target=None, shmsize=None, extra_hosts=None, container_limits={'memory': None}, gzip=False, isolation=None, platform=None)
docker.api.build._set_auth_headers: Looking for auth config
docker.api.build._set_auth_headers: No auth config in memory - loading from filesystem
docker.utils.config.find_config_file: Trying paths: ['/home/Jonny/.docker/config.json', '/home/Jonny/.dockercfg']
docker.utils.config.find_config_file: No config file found
docker.api.build._set_auth_headers: Sending auth config ()
urllib3.connectionpool._make_request: http://localhost:None "POST /v1.38/build?t=app&q=False&nocache=False&rm=True&forcerm=False&pull=False&dockerfile=docker%2FDockerfile HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker build -> <generator object APIClient._stream_helper at 0xb48e4e28>
ERROR: compose.cli.main.main: Service 'mycodo_daemon' failed to build: The command '/bin/sh -c /home/mycodo/mycodo/scripts/upgrade_commands.sh install-docker' returned a non-zero code: 100

@kizniche
Copy link
Owner Author

This command starts with printf, so for that to not be in the logs indicates an unusual issue.

'install-docker')
printf "\n#### Installing Docker Client\n"
apt install -y curl
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh

@jonny-sexton
Copy link

jonny-sexton commented Nov 21, 2022

I just tested with the main branch again, but still no dice:

Building mycodo_influxdb
Building mycodo_flask
ERROR: Service 'mycodo_flask' failed to build: The command '/bin/sh -c /home/mycodo/mycodo/scripts/upgrade_commands.sh install-docker' returned a non-zero code: 100

This command starts with printf, so for that to not be in the logs indicates an unusual issue.

Yes that's what I thought. I'll take a closer look when I have more time, will probably be this weekend though. I'll update you if I find anything.

@kizniche
Copy link
Owner Author

kizniche commented Nov 21, 2022

I just did a full test on a freshly installed Ubuntu 20.04 virtual machine. I changed the Linux image used and updated the build commands. I was able to build and run without issue. It also appears "docker compose" changed how output is displayed in the terminal from "docker-compose", which is much less verbose. I'm looking to see if it's possible to get the old behavior back. --verbose doesn't seem to have any effect, which I believe is a bug.

@jonny-sexton
Copy link

Hi @kizniche, sorry for the late reply. I still couldn't get this to work, and I have decided to write my own code for my needs.

However I think the crux of the issue was that my raspberry pi zero w (1st generation) supported 32-bit OS only, and Docker does not support 32 bit OS (I had to install Docker using unofficial 3rd party software: https://gitlab.com/docker-32bit). This caused all kinds of issues trying to fix it, so I think you should maybe add in the README that 32-bit raspberry pis are not supported for the docker installation of Mycodo.

@nargetdev
Copy link

nargetdev commented Jan 16, 2023

architecture heterogeneity can be addressed with buildx as follows..

#! /bin/bash
docker buildx build \
            . \
            --push \
            --platform linux/arm64,linux/arm/v7,linux/arm/v6 \
            --tag nargetdev/infinilapse:1.1.2

@nargetdev
Copy link

nargetdev commented Jan 16, 2023

@nargetdev could you please provide some more information about building/running on kubernetes? I'd like to explore this option more, but my experience is virtually all with Docker, so I could use some help getting this going and want to avoid fumbling around and hitting common issues that can be avoided with some guidance. Thanks.

@kizniche right now my workflow is using kompose tool to map the docker-compose.yml to kubernetes manifests. It mostly accomplishes an equivalent semantics of the services, containers, volumes, networks, etc. in k8s parlance.. but not 100% The main difference is how the volumes are initialized by k8s.

Here's my kompose output directory (nothing special .. just vanilla output from kompose convert -o kompose)
https://github.com/nargetdev/Mycodo/tree/master/kompose

On the one hand docker compose chooses to initialize a new volume implicitly on creation by copying over the contents at a given path from the container to initialize the volume contents.. however if the volume already had some contents at all (i.e. hi.txt) then the behavior is for the volume to clobber the contents within the container at the provided path. Kubernetes I guess views this as a liability and an edge case because it requires clients, scripts, etc to explicitly delete/recreate volumes for deterministic behavior. For this reason Kubernetes maintains only the latter behavior: always clobber at path, even with an empty volume.

Insofar as this concerns us we need to some method to bootstrap the volumes on first launch.

P.S. I'm going to make a separate issue but i'm just starting to look into the upgrade/restore function in container context.

@nargetdev
Copy link

nargetdev commented Jan 16, 2023

Actually i'll consolidate here regarding upgrade backup/restore since it's in the checklist above..

The first thing I'm facing down right off the batt is that the Docker containers are all set up with user mycodo and root directory stub mycodo.. as opposed to bare metal whatever_user and root directory stub Mycodo

Many of the scripts are hard coded with Mycodo.. i've started to convert them in my branch.

To illustrate:

on baremetal

MYCODO_ROOT=$( cd -P /var/mycodo-root && pwd -P )
echo $MYCODO_ROOT ==> /home/soma/Mycodo

in container

MYCODO_ROOT=$( cd -P /var/mycodo-root && pwd -P )
echo $MYCODO_ROOT ==> /home/mycodo

Is this a mistake or is there a reason for the inconsistency?

===

Secondly, perhaps more fundamentally, baremetal instance plays with systemd to stop the processes, but it's not set up this way for docker.

systemctl list-units --type=service
==> shows stuff for baremetal
==> error within docker

From a 20,000' view the "docker" way of handling an upgrade/restore would be to rip down the container, rehydrate the stateful filesystem via external process (the volumes), and then boot the containers. This could be orchestrated nicely with k8s control plane.
The "normal" way of doing it is where the system inside the container is none the wiser, stops it's process.. with this said my preliminary attempts at docker top mycodo_daemon ps aux and kill -9 <pid> have all failed at stoping the command specified by docker (which makes sense.. that command is the raison d'etre of the container so i'm not surprised it's hard/impossible to stop from that valence).

Let me know your thoughts on the two avenues / sanity check my logic @kizniche

@nargetdev
Copy link

Great success!

Mycodo on k8s..

#1263

@kizniche
Copy link
Owner Author

kizniche commented Jan 18, 2023

Is this a mistake or is there a reason for the inconsistency?

I found it easier to work with, but there's no reason other than that. The symlink mycodo-root is what I've been using to identify the root wherever it may be, since different users could be installing it in their home directory. Really, it should be installed in a more defined directory like /opt or /usr, for example, but this is difficult to change after having it at a different location for so many users.

I haven't been able to figure out a reliable way to perform an upgrade in docker. I agree this needs to be done external of the containers, with some sort of script. Discourse is one such project I use that utilizes docker and an external upgrade system with scripts, so perhaps we can look to that for inspiration.

@nargetdev
Copy link

Off the bat there are no systemd services to stop. These are rather the containers themselves, which should be ephemeral (able to be destroyed without notice)

An update could Docker "commit" the changes (I.e. dependencies installed) and use the newly committed image, but this seems messy..
The dependencies could persist in a volume as is the case currently.. but this is prone to corruption unless the volumes are incrementally backed up.

Finally a "fat" container could be built with all possible dependencies preinstalled.

What else is stateful outside of the running version of the sources?

mycodo.db

.. what else?

If you could help me just enumerate a bullet point list of stateful components so I can start my study? Thank you kindly

@samuk
Copy link

samuk commented Jan 27, 2024

I've run into an issue where libcamera-apps dependency won't install
libcamera

But following that:

libcamera-apps

@kizniche
Copy link
Owner Author

kizniche commented Jan 27, 2024

This is because Raspberry Pi OS is not the operating system installed in the Mycodo container. For that package, you need to use a Raspberry Pi OS variant to have access to their apt package source. You could try adding the package source to the current OS, but YMMV. Are you running Mycodo in Docker on actual Pi hardware? If so, why use Docker instead of installing on the actual hardware?

If you look in the Docker file, you'll see "debian:stable-slim" is used.

You will need to duplicate the Function and create a new one that uses a more generic package for libcamera than the Raspberry Pi OS-specific libcamera-apps, if you want to use a libcamera Function on an OS other than Raspberry Pi OS.

@samuk
Copy link

samuk commented Jan 27, 2024

Thanks, will give that a go.

Yes running in Docker on a Pi, just to test it out. Interested in running it under https://github.com/balena-os

The reason being that I could then swap the underlying hardware for any of their supported devices https://www.balena.io/os#download-os including this one https://www.compulab.com/products/iot-gateways/iot-gate-imx8plus-industrial-arm-iot-gateway/ which I like the look of.

@samuk
Copy link

samuk commented Jan 28, 2024

Just adding some notes in case this is useful to someone else later (including future-me)

Using the https://www.portainer.io/ webui

I accessed the terminal for the mycodo_flask container.

apt-install nano

nano /etc/apt/sources.list
paste:
deb http://archive.raspberrypi.org/debian/ bookworm main

Did a wget http://archive.raspberrypi.org/debian/raspberrypi.gpg.key
apt-key add raspberrypi.gpg.key
apt-get update
apt-get upgrade
I can then run the install process in the Mycodo WebUI.

I haven't yet successfully captured an image with it.

apt install sudo apt-get install v4l-utils

root@Mycodo:/home/mycodo/mycodo# v4l2-ctl --list-devices
bcm2835-codec-decode (platform:bcm2835-codec):
/dev/video10
/dev/video11
/dev/video12
/dev/video18
/dev/video31
/dev/media3

bcm2835-isp (platform:bcm2835-isp):
/dev/video13
/dev/video14
/dev/video15
/dev/video16
/dev/video20
/dev/video21
/dev/video22
/dev/video23
/dev/media1
/dev/media2

unicam (platform:fe801000.csi):
/dev/video0
/dev/video1
/dev/media0

rpivid (platform:rpivid):
/dev/video19
/dev/media4

HiCamera: UVC Camera (usb-0000:01:00.0-1.3):
/dev/video2
/dev/video3
/dev/media5

oot@Mycodo:/home/mycodo/mycodo# ls /dev/video*
/dev/video0 /dev/video10 /dev/video12 /dev/video14 /dev/video16 /dev/video19 /dev/video21 /dev/video23
/dev/video1 /dev/video11 /dev/video13 /dev/video15 /dev/video18 /dev/video20 /dev/video22 /dev/video31
root@Mycodo:/home/mycodo/mycodo# ls /dev/video*
/dev/video0 /dev/video10 /dev/video12 /dev/video14 /dev/video16 /dev/video19 /dev/video20 /dev/video22 /dev/video3
/dev/video1 /dev/video11 /dev/video13 /dev/video15 /dev/video18 /dev/video2 /dev/video21 /dev/video23 /dev/video31

I can apt install raspi-config

But there is no camera option

root@Mycodo:/home/mycodo/mycodo# v4l2-ctl --all
Driver Info:
Driver name : unicam
Card type : unicam
Bus info : platform:fe801000.csi
Driver version : 6.1.63
Capabilities : 0xa5a00001
Video Capture
Metadata Capture
Read/Write
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x25200001
Video Capture
Read/Write
Streaming
Extended Pix Format
Media Driver Info:
Driver name : unicam
Model : unicam
Serial :
Bus info : platform:fe801000.csi
Media version : 6.1.63
Hardware revision: 0x00000000 (0)
Driver version : 6.1.63
Interface Info:
ID : 0x03000006
Type : V4L Video
Entity Info:
ID : 0x00000004 (4)
Name : unicam-image
Function : V4L2 I/O
Flags : default
Pad 0x01000005 : 0: Sink
Link 0x02000008: from remote pad 0x1000002 of entity 'imx219 10-0010' (Camera Sensor): Data, Enabled, Immutable
Priority: 2
Video input : 0 (unicam-image: ok)
Format Video Capture:
Width/Height : 640/480
Pixel Format : 'Y12 ' (12-bit Greyscale)
Field : None
Bytes per Line : 1280
Size Image : 614400
Colorspace : Raw
Transfer Function : None
YCbCr/HSV Encoding: ITU-R 601
Quantization : Limited Range
Flags :
root@Mycodo:/home/mycodo/mycodo#

This looks potentially useful https://www.losant.com/blog/how-to-access-the-raspberry-pi-camera-in-docker
Libcamera commands https://docs.arducam.com/Raspberry-Pi-Camera/Native-camera/Libcamera-User-Guide/
WIP libcamera OpenCV code opencv/opencv#21653 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants