Hi everyone, my name is Agusti, I met Balena after Barcelona Balena Hackathon yesterday, however hack time run out very fast so let’s continue over here with Balena, RaspberryPi4 and SenseHAT.
Last thing I was doing was testing multicontainer capabilities on Balena OS and I was trying to set two containers.
These are the containers projects:
github/balena-io-projects/balena-node-red
github/balena-io-projects/balena-sense
I got some errors so any help would be really appreciated.
I created two folders with each container and set this file docker-compose.yml merging the two docker-compose.yml files in each container.
version: ‘2’
volumes:
resin-data:
sense-data:
services:
node-red:
build: ./nodered/node-red
volumes:
- ‘resin-data:/data’
restart: always
privileged: true
network_mode: host
labels:
io.balena.features.supervisor-api: ‘1’
cap_add:
- SYS_RAWIO
devices:
- “/dev/mem:/dev/mem”
- “/dev/gpiomem:/dev/gpiomem”
- “/dev/i2c-1:/dev/i2c-1”
ports:
- 80:80
influxdb:
restart: always
build: ./sense/influxdb
volumes:
- ‘sense-data:/data’
grafana:
restart: always
build: ./sense/grafana
ports:
- “80”
volumes:
- ‘sense-data:/data’
environment:
- ‘GF_SERVER_HTTP_PORT=80’
- ‘GF_PATHS_PROVISIONING=/usr/src/app/provisioning’
- ‘GF_SESSION_PROVIDER=memory’
sensor:
build: ./sense/sensor
privileged: true
restart: always
volumes:
- ‘sense-data:/data’
telegraf:
build: ./sense/telegraf
restart: always
So, after pushing to BalenaOS i got this output with errors
C:\balenasensors>balena push GettingStarted
[Info] Starting build for GettingStarted, user aXXXX
[Info] Dashboard link: https://dashboard.balena-cloud.com/apps/1535077/devices
[Info] Building on arm03
[Info] Pulling previous images for caching purposes…
[Success] Successfully pulled cache images
[telegraf] Step 1/8 : FROM balenalib/raspberrypi4-64:buster
[sensor] Step 1/17 : FROM balenalib/raspberrypi3-python:3-build
[node-red] Step 1/9 : FROM balenalib/raspberrypi4-64-debian-node:12-stretch-build as build
[influxdb] Step 1/4 : FROM balenalib/raspberrypi3-alpine
[grafana] Step 1/9 : FROM balenalib/raspberrypi4-64:buster
[sensor] —> 23fcc45ecdd8
[sensor] Step 2/17 : ARG BSEC_FILENAME=BSEC_1.4.7.4_Generic_Release.zip
[sensor] Using cache
[sensor] —> 63d69a42d0c4
[sensor] Step 3/17 : RUN install_packages unzip
[sensor] Using cache
[sensor] —> 89e0f5070c5f
[sensor] Step 4/17 : WORKDIR /usr/src/app
[influxdb] —> 5ee6b1f1354e
[influxdb] Step 2/4 : RUN apk add influxdb
[sensor] Using cache
[sensor] —> 5991cbbebaa1
[sensor] Step 5/17 : RUN git clone https://github.com/balena-io-playground/bsec_bme680_linux.git
[influxdb] Using cache
[influxdb] —> 8f9202e4b80f
[influxdb] Step 3/4 : RUN sed -i ‘s|/var/lib/influxdb|/data/influxdb|g’ /etc/influxdb/influxdb.conf
[telegraf] —> 8c9909c5c978
[telegraf] Step 2/8 : COPY ./.sh /usr/src/app/
[grafana] —> 8c9909c5c978
[grafana] Step 2/9 : COPY ./grafana.ini /usr/share/grafana/conf/custom.ini
[influxdb] Using cache
[influxdb] —> 6af2f444fecd
[influxdb] Step 4/4 : CMD influxd
[sensor] Using cache
[sensor] —> 2f81c1b2698c
[sensor] Step 6/17 : RUN wget https://ae-bst.resource.bosch.com/media/_tech/media/bsec/$BSEC_FILENAME
[telegraf] Using cache
[telegraf] —> fb1dfd03fb26
[telegraf] Step 3/8 : RUN chmod +x /usr/src/app/.sh
[influxdb] Using cache
[influxdb] —> 1b181d262494
[influxdb] Successfully built 1b181d262494
[grafana] Using cache
[grafana] —> cf10842c3552
[grafana] Step 3/9 : COPY ./provisioning /usr/src/app/provisioning
[sensor] Using cache
[sensor] —> d113a3ac0729
[sensor] Step 7/17 : RUN unzip -d bsec_bme680_linux/src $BSEC_FILENAME
[telegraf] Using cache
[telegraf] —> b628a9436207
[telegraf] Step 4/8 : RUN install_packages wget
[grafana] Using cache
[grafana] —> 7250722cf001
[grafana] Step 4/9 : COPY ./.sh /usr/src/app/
[telegraf] Using cache
[telegraf] —> 0b5be93b6092
[telegraf] Step 5/8 : RUN /usr/src/app/download.sh “aarch64”
[sensor] Using cache
[sensor] —> 71695e97693c
[sensor] Step 8/17 : RUN echo $BSEC_FILENAME > version
[grafana] Using cache
[grafana] —> 5970f540958e
[grafana] Step 5/9 : RUN chmod +x /usr/src/app/.sh
[telegraf] Using cache
[telegraf] —> a5135a363422
[telegraf] Step 6/8 : RUN dpkg -i /tmp/telegraf.deb && rm /tmp/telegraf.deb
[grafana] Using cache
[grafana] —> f8c7e1c64aae
[grafana] Step 6/9 : RUN install_packages fontconfig-config fonts-dejavu-core libfontconfig1 ucf jq wget
[telegraf] Using cache
[telegraf] —> ea89cfcebf2d
[telegraf] Step 7/8 : COPY telegraf.conf /etc/telegraf/telegraf.conf
[sensor] Using cache
[sensor] —> d945f5e7bd84
[sensor] Step 9/17 : WORKDIR /usr/src/app/bsec_bme680_linux
[grafana] Using cache
[grafana] —> a845fc228e09
[grafana] Step 7/9 : RUN /usr/src/app/download.sh “aarch64”
[telegraf] Using cache
[telegraf] —> cb61dbd913e8
[telegraf] Step 8/8 : CMD /usr/src/app/entry.sh
[sensor] Using cache
[sensor] —> c8d01c6afa11
[sensor] Step 10/17 : RUN chmod +x make.sh
[telegraf] Using cache
[telegraf] —> c31c9e769abd
[telegraf] Successfully built c31c9e769abd
[grafana] Using cache
[grafana] —> 642995acfc31
[grafana] Step 8/9 : RUN dpkg -i /tmp/grafana.deb && rm /tmp/grafana.deb
[grafana] Using cache
[grafana] —> 079f00dc00f4
[grafana] Step 9/9 : CMD ["/bin/sh","/usr/src/app/entry.sh"]
[sensor] Using cache
[sensor] —> 63585d964f66
[sensor] Step 11/17 : RUN ./make.sh
[grafana] Using cache
[grafana] —> 01c8379e3c8f
[grafana] Successfully built 01c8379e3c8f
[sensor] Using cache
[sensor] —> e2f034e4546a
[sensor] Step 12/17 : RUN pip install smbus
[sensor] Using cache
[sensor] —> 392e0b162aa1
[sensor] Step 13/17 : WORKDIR /usr/src/app
[sensor] Using cache
[sensor] —> 9272ed1ee151
[sensor] Step 14/17 : COPY ./scripts ./scripts
[sensor] Using cache
[sensor] —> dd4fc9a639ca
[sensor] Step 15/17 : COPY ./entry.sh /usr/src/app/
[sensor] Using cache
[sensor] —> 1ef7b78f7639
[sensor] Step 16/17 : RUN chmod +x /usr/src/app/entry.sh
[sensor] Using cache
[sensor] —> 82bf869aa6c3
[sensor] Step 17/17 : CMD ./entry.sh
[sensor] Using cache
[sensor] —> e493b5168851
[sensor] Successfully built e493b5168851
[node-red] —> f94b8bc13e54
[node-red] Step 2/9 : RUN JOBS=MAX npm install -g --production --unsafe-perm node-red node-red-admin node-red-contrib-balena
[node-red] —> Running in 16314395fbb1
[node-red] /usr/local/bin/node-red-admin -> /usr/local/lib/node_modules/node-red-admin/node-red-admin.js
[node-red] /usr/local/bin/node-red -> /usr/local/lib/node_modules/node-red/red.js
[node-red] /usr/local/bin/node-red-pi -> /usr/local/lib/node_modules/node-red/bin/node-red-pi
[node-red] > bcrypt@3.0.6 install /usr/local/lib/node_modules/node-red/node_modules/bcrypt
[node-red] > node-pre-gyp install --fallback-to-build
[node-red] node-pre-gyp
[node-red]
[node-red] WARN
[node-red] Using request for node-pre-gyp https download
[node-red]
[node-red] node-pre-gyp
[node-red]
[node-red] WARN
[node-red]
[node-red] Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.6/bcrypt_lib-v3.0.6-node-v72-linux-arm64-glibc.tar.gz
[node-red]
[node-red] node-pre-gyp
[node-red] WARN
[node-red]
[node-red] Pre-built binaries not found for bcrypt@3.0.6 and node@12.11.0 (node-v72 ABI, glibc) (falling back to source compile with node-gyp)
[node-red]
[node-red]
[node-red] make: Entering directory ‘/usr/local/lib/node_modules/node-red/node_modules/bcrypt/build’
[node-red] CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
[node-red] CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
[node-red] CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
[node-red] SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
[node-red] COPY Release/bcrypt_lib.node
[node-red] COPY /usr/local/lib/node_modules/node-red/node_modules/bcrypt/lib/binding/bcrypt_lib.node
[node-red] TOUCH Release/obj.target/action_after_build.stamp
[node-red] make: Leaving directory ‘/usr/local/lib/node_modules/node-red/node_modules/bcrypt/build’
[node-red] > bcrypt@3.0.6 install /usr/local/lib/node_modules/node-red-admin/node_modules/bcrypt
[node-red] > node-pre-gyp install --fallback-to-build
[node-red] node-pre-gyp
[node-red] WARN
[node-red]
[node-red] Using request for node-pre-gyp https download
[node-red]
[node-red]
[node-red] node-pre-gyp
[node-red]
[node-red] WARN
[node-red]
[node-red] Tried to download(404): github/kelektiv/node.bcrypt.js/releases/download/v3.0.6/bcrypt_lib-v3.0.6-node-v72-linux-arm64-glibc.tar.gz
[node-red]
[node-red]
[node-red] node-pre-gyp
[node-red]
[node-red] WARN
[node-red] Pre-built binaries not found for bcrypt@3.0.6 and node@12.11.0 (node-v72 ABI, glibc) (falling back to source compile with node-gyp)
[node-red]
[node-red]
[node-red] make: Entering directory ‘/usr/local/lib/node_modules/node-red-admin/node_modules/bcrypt/build’
[node-red] CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
[node-red] CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
[node-red] CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
[node-red] SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
[node-red] COPY Release/bcrypt_lib.node
[node-red] COPY /usr/local/lib/node_modules/node-red-admin/node_modules/bcrypt/lib/binding/bcrypt_lib.node
[node-red] TOUCH Release/obj.target/action_after_build.stamp
[node-red] make: Leaving directory ‘/usr/local/lib/node_modules/node-red-admin/node_modules/bcrypt/build’
[node-red] + node-red@1.0.2
[node-red] + node-red-admin@0.1.5
[node-red] + node-red-contrib-balena@1.0.1
[node-red] added 507 packages from 348 contributors in 27.23s
[node-red] Removing intermediate container 16314395fbb1
[node-red] —> b75a1c4ecae8
[node-red] Step 3/9 : FROM balenalib/raspberrypi4-64-debian-node:12-stretch-run
[node-red] —> c34dbd74d6ab
[node-red] Step 4/9 : RUN apt-get update && apt-get install -yq --no-install-recommends python-dev python-rpi.gpio && apt-get clean && rm -rf /var/lib/apt/lists/*
[node-red] —> Running in 214c30da3104
[node-red] Ign:1 /deb.debian/debian stretch InRelease
[node-red] Get:2 /deb.debian/debian stretch-updates InRelease [91.0 kB]
[node-red] Get:3 /security.debian/debian-security stretch/updates InRelease [94.3 kB]
[node-red] Get:4 deb.debian/debian stretch Release [118 kB]
[node-red] Get:5 deb.debian/debian stretch Release.gpg [2365 B]
[node-red] Get:6 deb.debian/debian stretch-updates/main arm64 Packages [27.3 kB]
[node-red] Get:7 security.debian/debian-security stretch/updates/main arm64 Packages [482 kB]
[node-red] Get:8 deb.debian/debian stretch/main arm64 Packages [6927 kB]
[node-red] Fetched 7742 kB in 1s (4009 kB/s)
[node-red] Reading package lists…
[node-red] Reading package lists…
[node-red] Building dependency tree…
[node-red] Reading state information…
[node-red] E: Unable to locate package python-rpi.gpio
[node-red] E: Couldn’t find any package by glob ‘python-rpi.gpio’
[node-red] E: Couldn’t find any package by regex ‘python-rpi.gpio’
[node-red]
[node-red] Removing intermediate container 214c30da3104
[node-red] The command ‘/bin/sh -c apt-get update && apt-get install -yq --no-install-recommends python-dev python-rpi.gpio && apt-get clean && rm -rf /var/lib/apt/lists/’ returned a non-zero code: 100
[Info] Uploading images
[Success] Successfully uploaded images
[Error] Some services failed to build:
[Error] Service: node-red
[Error] Error: The command '/bin/sh -c apt-get update && apt-get install -yq --no-install-recommends python-dev python-rpi.gpio && apt-get clean && rm -rf /var/lib/apt/lists/’ returned a non-zero code: 100
[Info] Built on arm03
[Error] Not deploying release.
Remote build failed
Additional information may be available by setting a DEBUG=1 environment
variable: “set DEBUG=1” on a Windows command prompt, or “export DEBUG=1”
on Linux or macOS.
If you need help, don’t hesitate in contacting our support forums at
forumsbalenaio
For bug reports or feature requests, have a look at the GitHub issues or
create a new one at: github/balena-io/balena-cli/issues/