ooni / probe

OONI Probe network measurement tool for detecting internet censorship
https://ooni.org/install
BSD 3-Clause "New" or "Revised" License
750 stars 142 forks source link

Raspberry Pi armv7 support #807

Closed nvjacobo closed 3 years ago

nvjacobo commented 5 years ago

I want to install ooniprobe on docker container in a Raspberry Pi. What do you recommend? do you have some resource?

Thanks, Jacobo

hellais commented 5 years ago

I have been working on armv7 for https://github.com/ooni/probe-cli, but it's not yet finished.

The gist of what you should do is:

As mentioned this is still work in progress, but help to get raspberry pi support is greatly appreciated.

bassosimone commented 4 years ago

To make this easier, we're planning on rewriting the OONI engine in Go. Cross compiling is very simple with Go. Unfortunately, it's also true that performance tests using TLS and written in Go have issues because Go does not use assembly for armv7 (while uses it for arm64). So, my suggestion would be to use arm64 devices, or accept that performance tests using TLS will be slow.

(Currently all OONI performance test do not use TLS. We're adding ndt7, which is TLS only, tho.)

anadahz commented 4 years ago

What is the latest status of the arm* support on probe-cli?

If I was to compile probe-cli to arm* what would you suggest me to try?

bassosimone commented 4 years ago

What is the latest status of the arm* support on probe-cli?

Not less painful than before. Namely, you need to recompile and link with Measurement Kit.

In the next weeks we'll bless as production ready the following experiments written in Go:

  1. psiphon
  2. dash
  3. telegram

These experiments are already available if you build with export CGO_ENABLED=0. We will (slowly) rewrite more tests in Go and, eventually, you would not probably need C++ code.

If I was to compile probe-cli to arm* what would you suggest me to try?

To recompile Measurement Kit for your arm platform and report back on the issues you have. (You may also not have issues, which is great; maybe now the Debian used by arm distros is new enough that there is C++14 support and everything works great.)

bassosimone commented 4 years ago

A OONI probe user told us that they were able to compile both miniooni and ooniprobe compiled and executed successfully on RPI 4 with go version 1.14.2. Of course, they did not compile in the support for MK. This is reassuring to us, because it gives us high confidence that it will be possible to compile ooniprobe for Raspberry Pi once we have rewritten all the experiments in Go. (This process will take some more time, but already the recent releases of both Desktop and mobile have started replacing some experiments.)

bassosimone commented 3 years ago

Update: all the tests are now written in Go. We're going to do QA and make sure we don't introduce regressions. This use case should be possible soon. See also https://github.com/ooni/probe/issues/1228.

bassosimone commented 3 years ago

@nvjacobo probe-cli's master branch does not depend anymore on Measurement Kit. We still depend on sqlite3 but that should be very easy to compile and it should be done as part of go get .... Let me know if you have issues? I suspect running ./build.sh linux from probe-cli's top-level directory with Go 1.14 and a C compiler installed should be enough.

bassosimone commented 3 years ago

Consider closing in Sprint 21. We received reports that it's now easy to compile on Raspberry Pi.

bassosimone commented 3 years ago

So, I've spent a couple more minutes thinking about this issue. There is no further action here. We can build on Raspberry Pi according to reports and we are not aware of major issues. We could reopen if needed, of course.

Bougakov commented 3 years ago

Sadly, the current version won't build on armhf if instructions are followed:

root@orangepipc:/tmp/probe-cli# ./build.sh linux
+ git describe --tags
+ v=v3.4.0-4-gb84fe2c
+ ./build.sh linux_amd64
+ git describe --tags
+ v=v3.4.0-4-gb84fe2c
+ docker pull --platform linux/amd64 golang:1.14-alpine
./build.sh: 39: ./build.sh: docker: not found

Ok, here is the docker for ya:

root@orangepipc:/tmp/probe-cli# apt-get -y install docker
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  docker
0 upgraded, 1 newly installed, 0 to remove and 162 not upgraded.
Need to get 12.4 kB of archives.
After this operation, 39.9 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com bionic/universe armhf docker armhf 1.5-1build1 [12.4 kB]
Fetched 12.4 kB in 0s (31.7 kB/s) 
Selecting previously unselected package docker.
(Reading database ... 49958 files and directories currently installed.)
Preparing to unpack .../docker_1.5-1build1_armhf.deb ...
Unpacking docker (1.5-1build1) ...
Setting up docker (1.5-1build1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...

Nope, doesn't help:

root@orangepipc:/tmp/probe-cli# ./build.sh linux
+ git describe --tags
+ v=v3.4.0-4-gb84fe2c
+ ./build.sh linux_amd64
+ git describe --tags
+ v=v3.4.0-4-gb84fe2c
+ docker pull --platform linux/amd64 golang:1.14-alpine
./build.sh: 39: ./build.sh: docker: not found

Trying to build directly:

root@orangepipc:/tmp/probe-cli# echo 'export PATH=$PATH:/usr/local/go/bin' >> /root/.bashrc
root@orangepipc:/tmp/probe-cli# source /root/.bashrc
root@orangepipc:/tmp/probe-cli# export PATH=$PATH:/usr/local/go/bin
root@orangepipc:/tmp/probe-cli# go version
go version go1.10.4 linux/arm
root@orangepipc:/tmp/probe-cli# go build -ldflags='-s -w' -v ./cmd/ooniprobe
cmd/ooniprobe/main.go:4:2: cannot find package "github.com/apex/log" in any of:
    /usr/lib/go-1.10/src/github.com/apex/log (from $GOROOT)
    /root/go/src/github.com/apex/log (from $GOPATH)
cmd/ooniprobe/main.go:5:2: cannot find package "github.com/ooni/probe-cli/internal/cli/app" in any of:
    /usr/lib/go-1.10/src/github.com/ooni/probe-cli/internal/cli/app (from $GOROOT)

OK, trying to add dependencies:

root@orangepipc:/tmp/probe-cli# dep ensure
could not find project Gopkg.toml
bassosimone commented 3 years ago
root@orangepipc:/tmp/probe-cli# echo 'export PATH=$PATH:/usr/local/go/bin' >> /root/.bashrc
root@orangepipc:/tmp/probe-cli# source /root/.bashrc
root@orangepipc:/tmp/probe-cli# export PATH=$PATH:/usr/local/go/bin
root@orangepipc:/tmp/probe-cli# go version
go version go1.10.4 linux/arm
root@orangepipc:/tmp/probe-cli# go build -ldflags='-s -w' -v ./cmd/ooniprobe
cmd/ooniprobe/main.go:4:2: cannot find package "github.com/apex/log" in any of:
    /usr/lib/go-1.10/src/github.com/apex/log (from $GOROOT)

Your version of Go is too old. You need Go >= 1.14.

bassosimone commented 3 years ago
root@orangepipc:/tmp/probe-cli# ./build.sh linux
+ git describe --tags
+ v=v3.4.0-4-gb84fe2c
+ ./build.sh linux_amd64
+ git describe --tags
+ v=v3.4.0-4-gb84fe2c
+ docker pull --platform linux/amd64 golang:1.14-alpine
./build.sh: 39: ./build.sh: docker: not found

This looks surprising: you have installed docker above but there is no docker command on the system?!

(In any case, ./build.sh linux is building for linux/386 and linux/amd64, so it won't give you the binary you want.)

Would it be useful if we also create and publish builds for linux/arm and linux/arm64?

bassosimone commented 3 years ago

@Bougakov this is the output of ./build.sh help:

Usage: ./build.sh darwin|linux|macos|windows|release

You need a C compiler and Go >= 1.14. The C compiler must be a
UNIX like compiler like GCC, Clang, Mingw-w64.

To build a static Linux binary, we use Docker and Alpine. We currently
build for linux/386 and linux/amd64.

You can cross compile for Windows from macOS or Linux. You can
compile for Linux as long as you have Docker. Cross compiling for
macOS has never been tested. We have a bunch of cross compiling
checks inside the .github/workflows/cross.yml file.

The macos rule is an alias for the darwin rule. The generated
binary file is named ooniprobe_${version}_darwin_${arch}.tar.gz
because the platform name is darwin.

I have slightly tweaked it to clarify that we compile for linux/386 and linux/amd64. Please, let me know if there is any way in which I can further improve the documentation. In the meanwhile I'll commit this tweak change. Thank you!

nunesgh commented 3 years ago

Would it be useful if we also create and publish builds for linux/arm and linux/arm64?

Yes, please! @bassosimone, it would be really appreciated!

bassosimone commented 3 years ago

@nunesgh okay, I'll try to figure this out! Thanks for the feedback!

bassosimone commented 3 years ago

Moving to Sprint 32

Bougakov commented 3 years ago

Your version of Go is too old. You need Go >= 1.14.

This is the latest I can get on my 32-bit board running a very popular "Armbian" distribution for ARM boards, based on Debian. If you are targeting the cutting-edge versions, you'll be leaving lots of still functional hardware behind:

➜  ~ ssh root@192.168.100.52
  ___  ____  _   ____   ____ 
 / _ \|  _ \(_) |  _ \ / ___|
| | | | |_) | | | |_) | |    
| |_| |  __/| | |  __/| |___ 
 \___/|_|   |_| |_|    \____|

Welcome to Armbian Bionic with Linux 5.4.30-sunxi

System load:   0.38 0.17 0.06   Up time:       11 days      
Memory usage:  21 % of 998MB    IP:            192.168.100.52
CPU temp:      56°C             
Usage of /:    36% of 7.2G      

Last login: Mon Jan 25 15:06:24 2021 from 192.168.100.86

root@orangepipc:~# apt-get -y install golang docker
Reading package lists... Done
Building dependency tree       
Reading state information... Done
golang is already the newest version (2:1.10~4ubuntu1).
docker is already the newest version (1.5-1build1).
bassosimone commented 3 years ago

@Bougakov wrote:

This is the latest I can get on my 32-bit board running a very popular "Armbian" distribution for ARM boards, based on Debian. If you are targeting the cutting-edge versions, you'll be leaving lots of still functional hardware behind

You're absolutely right! We are not actually planning on leaving these systems behind. We need to latest version of Go because that enables us to use all the new features. But Linux has a very stable ABI, which means we should be able to build with the latest version of Go and run on less up-to-date systems.

We are aiming to build for arm32/arm64 precisely for this reason.

In the meanwhile, the following strategy probably will get you the latest version of Go on your system:

export GOPATH=$HOME/go   # maybe not necessary for you, I needed it b/c I tested with go 1.7
go get -v golang.org/dl/go1.15.7

This created $HOME/sdk/go1.15.7/bin/go, which is the latest version.

Let me know if this strategy works for you. Since I don't have an arm32 system, I could only test for amd64. I used Debian oldstable for this test, which has a very old version of Go (1.7).

Bougakov commented 3 years ago

I used the suggested method to update Go:

root@orangepipc:~# export GOPATH=$HOME/go   # maybe not necessary for you, I needed it b/c I tested with go 1.7
root@orangepipc:~# go get -v golang.org/dl/go1.15.7
Fetching https://golang.org/dl/go1.15.7?go-get=1
Parsing meta tags from https://golang.org/dl/go1.15.7?go-get=1 (status code 200)
get "golang.org/dl/go1.15.7": found meta tag get.metaImport{Prefix:"golang.org/dl", VCS:"git", RepoRoot:"https://go.googlesource.com/dl"} at https://golang.org/dl/go1.15.7?go-get=1
get "golang.org/dl/go1.15.7": verifying non-authoritative meta tag
Fetching https://golang.org/dl?go-get=1
Parsing meta tags from https://golang.org/dl?go-get=1 (status code 200)
golang.org/dl (download)
created GOPATH=/root/go; see 'go help gopath'
golang.org/dl/internal/version
golang.org/dl/go1.15.7
root@orangepipc:/tmp/probe-cli# ./build.sh  linux
+ git describe --tags
+ v=v3.4.0-4-gb84fe2c
+ ./build.sh linux_amd64
+ git describe --tags
+ v=v3.4.0-4-gb84fe2c
+ docker pull --platform linux/amd64 golang:1.14-alpine
./build.sh: 39: ./build.sh: docker: not found

I tried to add:

sudo apt install golang-github-apex-log-dev

which didn't help. I then tried another method which didn't work either:

root@orangepipc:/tmp/probe-cli# go get github.com/apex/apex-go
root@orangepipc:/tmp/probe-cli# go build -ldflags='-s -w' -v ./cmd/ooniprobe
cmd/ooniprobe/main.go:4:2: cannot find package "github.com/apex/log" in any of:
    /usr/lib/go-1.10/src/github.com/apex/log (from $GOROOT)
    /root/go/src/github.com/apex/log (from $GOPATH)
cmd/ooniprobe/main.go:5:2: cannot find package "github.com/ooni/probe-cli/internal/cli/app" in any of:
    /usr/lib/go-1.10/src/github.com/ooni/probe-cli/internal/cli/app (from $GOROOT)
    /root/go/src/github.com/ooni/probe-cli/internal/cli/app (from $GOPATH)
cmd/ooniprobe/main.go:6:2: cannot find package "github.com/ooni/probe-cli/internal/cli/autorun" in any of:
    /usr/lib/go-1.10/src/github.com/ooni/probe-cli/internal/cli/autorun (from $GOROOT)
    /root/go/src/github.com/ooni/probe-cli/internal/cli/autorun (from $GOPATH)
cmd/ooniprobe/main.go:7:2: cannot find package "github.com/ooni/probe-cli/internal/cli/geoip" in any of:
    /usr/lib/go-1.10/src/github.com/ooni/probe-cli/internal/cli/geoip (from $GOROOT)
    /root/go/src/github.com/ooni/probe-cli/internal/cli/geoip (from $GOPATH)
cmd/ooniprobe/main.go:8:2: cannot find package "github.com/ooni/probe-cli/internal/cli/info" in any of:
    /usr/lib/go-1.10/src/github.com/ooni/probe-cli/internal/cli/info (from $GOROOT)
    /root/go/src/github.com/ooni/probe-cli/internal/cli/info (from $GOPATH)
cmd/ooniprobe/main.go:9:2: cannot find package "github.com/ooni/probe-cli/internal/cli/list" in any of:
    /usr/lib/go-1.10/src/github.com/ooni/probe-cli/internal/cli/list (from $GOROOT)
    /root/go/src/github.com/ooni/probe-cli/internal/cli/list (from $GOPATH)
cmd/ooniprobe/main.go:10:2: cannot find package "github.com/ooni/probe-cli/internal/cli/onboard" in any of:
    /usr/lib/go-1.10/src/github.com/ooni/probe-cli/internal/cli/onboard (from $GOROOT)
    /root/go/src/github.com/ooni/probe-cli/internal/cli/onboard (from $GOPATH)
cmd/ooniprobe/main.go:11:2: cannot find package "github.com/ooni/probe-cli/internal/cli/reset" in any of:
    /usr/lib/go-1.10/src/github.com/ooni/probe-cli/internal/cli/reset (from $GOROOT)
    /root/go/src/github.com/ooni/probe-cli/internal/cli/reset (from $GOPATH)
cmd/ooniprobe/main.go:12:2: cannot find package "github.com/ooni/probe-cli/internal/cli/rm" in any of:
    /usr/lib/go-1.10/src/github.com/ooni/probe-cli/internal/cli/rm (from $GOROOT)
    /root/go/src/github.com/ooni/probe-cli/internal/cli/rm (from $GOPATH)
cmd/ooniprobe/main.go:13:2: cannot find package "github.com/ooni/probe-cli/internal/cli/run" in any of:
    /usr/lib/go-1.10/src/github.com/ooni/probe-cli/internal/cli/run (from $GOROOT)
    /root/go/src/github.com/ooni/probe-cli/internal/cli/run (from $GOPATH)
cmd/ooniprobe/main.go:14:2: cannot find package "github.com/ooni/probe-cli/internal/cli/show" in any of:
    /usr/lib/go-1.10/src/github.com/ooni/probe-cli/internal/cli/show (from $GOROOT)
    /root/go/src/github.com/ooni/probe-cli/internal/cli/show (from $GOPATH)
cmd/ooniprobe/main.go:15:2: cannot find package "github.com/ooni/probe-cli/internal/cli/upload" in any of:
    /usr/lib/go-1.10/src/github.com/ooni/probe-cli/internal/cli/upload (from $GOROOT)
    /root/go/src/github.com/ooni/probe-cli/internal/cli/upload (from $GOPATH)
cmd/ooniprobe/main.go:16:2: cannot find package "github.com/ooni/probe-cli/internal/cli/version" in any of:
    /usr/lib/go-1.10/src/github.com/ooni/probe-cli/internal/cli/version (from $GOROOT)
    /root/go/src/github.com/ooni/probe-cli/internal/cli/version (from $GOPATH)
cmd/ooniprobe/main.go:17:2: cannot find package "github.com/ooni/probe-cli/internal/crashreport" in any of:
    /usr/lib/go-1.10/src/github.com/ooni/probe-cli/internal/crashreport (from $GOROOT)
    /root/go/src/github.com/ooni/probe-cli/internal/crashreport (from $GOPATH)

I've read that this is the proper way to fix dependencies, but this method isn't working:

root@orangepipc:/tmp/probe-cli# dep init
ctx.DetectProjectGOPATH: /tmp/probe-cli is not within a known GOPATH/src

(Sorry but I don't know a bit about Go so I am throwing everything I could google on StackOverflow and checking what sticks)

Bougakov commented 3 years ago

Turns out the correct command to install docker is apt install docker.io. With it:

root@orangepipc:/tmp/probe-cli# ./build.sh  linux
+ git describe --tags
+ v=v3.4.0-4-gb84fe2c
+ ./build.sh linux_amd64
+ git describe --tags
+ v=v3.4.0-4-gb84fe2c
+ docker pull --platform linux/amd64 golang:1.14-alpine
"--platform" is only supported on a Docker daemon with experimental features enabled
Bougakov commented 3 years ago

A different approach:

root@orangepipc:/tmp/probe-cli# go get -v golang.org/dl/go1.15.7
root@orangepipc:/tmp/probe-cli# find / -name go1.15.7
/root/go/bin/go1.15.7
/root/go/src/golang.org/dl/go1.15.7
root@orangepipc:/tmp/probe-cli# /root/go/bin/go1.15.7 
go1.15.7: not downloaded. Run 'go1.15.7 download' to install to /root/sdk/go1.15.7
root@orangepipc:/tmp/probe-cli# /root/go/bin/go1.15.7 download
Downloaded   0.0% (   15258 / 97914155 bytes) ...
Downloaded   1.0% (  998286 / 97914155 bytes) ...
...
Downloaded  99.9% (97844110 / 97914155 bytes) ...
Downloaded 100.0% (97914155 / 97914155 bytes)
Unpacking /root/sdk/go1.15.7/go1.15.7.linux-armv6l.tar.gz ...
Success. You may now run 'go1.15.7'
root@orangepipc:/tmp/probe-cli# /root/go/bin/go1.15.7 version
go version go1.15.7 linux/arm
root@orangepipc:/tmp/probe-cli# /root/go/bin/go1.15.7  get github.com/apex/apex-go
go: downloading github.com/apex/apex-go v1.0.0
go: github.com/apex/apex-go upgrade => v1.0.0
root@orangepipc:/tmp/probe-cli# /root/go/bin/go1.15.7 build -ldflags='-s -w' -v ./cmd/ooniprobe
go: downloading github.com/apex/log v1.9.0
go: downloading gopkg.in/AlecAivazis/survey.v1 v1.8.8
go: downloading github.com/alecthomas/kingpin v2.2.6+incompatible
...
github.com/ooni/probe-engine/internal/runtimex
github.com/ooni/probe-engine/netx/bytecounter
github.com/ooni/probe-engine/legacy/netx/dialid
...
github.com/ooni/probe-cli/internal/cli/autorun
github.com/ooni/probe-cli/internal/cli/run
github.com/ooni/probe-cli/internal/cli/version
github.com/ooni/probe-cli/cmd/ooniprobe
root@orangepipc:/tmp/probe-cli# ./ooniprobe --version
3.5.0-alpha
root@orangepipc:/tmp/probe-cli# cp ooniprobe /etc
root@orangepipc:/tmp/probe-cli# /etc/ooniprobe onboard
┏━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ What is OONI Probe?      ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Your tool for detecting internet censorship!

It appears to work (BTW, notice the confusing argument run all* in help - it doesn't work)

root@orangepipc:/tmp/probe-cli# /etc/ooniprobe run all*
   ⨯ failure in main command   error=unexpected all*
root@orangepipc:/tmp/probe-cli# /etc/ooniprobe run all
   • Running im tests
[engine] session: using probe services: {Address:https://ps2.ooni.io Type:https Front:}
   4.76% facebook_messenger: measure tcpconnect://external.xx.fbcdn.net:443: <nil> 
   9.52% facebook_messenger: measure tcpconnect://b-api.facebook.com:443: <nil> 
   14.29% facebook_messenger: measure tcpconnect://star.c10r.facebook.com:443: <nil>

So I've configured it this way:

root@orangepipc:~# /etc/ooniprobe autorun start
   ⨯ failure in main command   error=autorun: not implemented on this platform
root@orangepipc:~# (crontab -l 2>/dev/null; echo "@daily ooni /etc/ooniprobe run all") | crontab -
root@orangepipc:~# crontab -l
@daily ooni /etc/ooniprobe run all

Update:

root@orangepipc:~# /etc/ooniprobe list
┏━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Results                  ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━┛
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ #1 - 02 Feb 21 20:21 UTC                         ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ im                       3 tested                │
│ PJSC Rostelecom          0 blocked               │
│ AS42610 (RU)                                     │
┢━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┪
┃ #2 - 02 Feb 21 20:22 UTC                         ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ circumvention            3 tested                │
│ PJSC Rostelecom          1 blocked               │
│ AS42610 (RU)                                     │
┢━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┪
┃ #3 - 02 Feb 21 20:23 UTC                         ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ websites                 2098 tested             │
│ PJSC Rostelecom          239 blocked             │
│ AS42610 (RU)                                     │
┢━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┪
┃ #4 - 02 Feb 21 22:37 UTC                         ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ performance              Download: 31.66 Mbit/s  │
│ PJSC Rostelecom          Upload: 37.97 Mbit/s    │
│ AS42610 (RU)             Ping: 23.18ms           │
┢━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┪
┃ #5 - 02 Feb 21 22:38 UTC                         ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ middlebox                Detected: false         │
│ PJSC Rostelecom                                  │
│ AS42610 (RU)                                     │
└┬──────────────┬─────────────┬───────────────────┬┘
 │ 5 tests      │ 1 nets      │ ⬆ 206.3M  ⬇ 398.4M │
 └──────────────┴─────────────┴───────────────────┘

(speed tests are wildly inaccurate since the Pi uses an old 2.4Ghz WiFi through $2 Chinese USB dongle)

bassosimone commented 3 years ago

Hey @Bougakov,

A different approach: [...]

I am so happy to see that it worked! :smile:

So I've configured it this way:

root@orangepipc:~# /etc/ooniprobe autorun start
  ⨯ failure in main command   error=autorun: not implemented on this platform

Yes, we don't have an implementation of autorun on Linux. We do that in the Debian package. (Forgive my ignorance, does your system have systemd? What version?)

Also, I would like to advise you against putting the binary in /etc. That does not feel very much in line with the FHS. I would instead recommend /usr/local/bin/ooniprobe.

root@orangepipc:~# (crontab -l 2>/dev/null; echo "@daily ooni /etc/ooniprobe run all") | crontab -
root@orangepipc:~# crontab -l
@daily ooni /etc/ooniprobe run all

Please, change that to @daily ooni /usr/local/bin/ooniprobe run unattended. This is the way in which we would like people to run OONI in the background. In this mode, we will try to strike a compromise between resources usage and testing.

(speed tests are wildly inaccurate since the Pi uses an old 2.4Ghz WiFi through $2 Chinese USB dongle)

Yes, unfortunately, there is no assembly implementation of the TLS primitives for arm32 in Go. This means that every operation using TLS is significantly slower. I wonder whether we should disable speed tests altogether for arm32?

BTW, notice the confusing argument run all* in help - it doesn't work)

I agree that this is confusing. The asterisk is meant to signal that this is the default argument. I am not very fond of the library we are currently using for parsing command-line options. I think it's possible to do better, but that's an improvement for later.

Thank you for your patience and commitment!

Bougakov commented 3 years ago

Also, I would like to advise you against putting

For starters, I am guilty of running all of that as root...

FedericoCeratto commented 3 years ago

Upcoming PR to enable armhf builds in CI https://github.com/ooni/probe-cli/pull/199

bassosimone commented 3 years ago

For starters, I am guilty of running all of that as root...

LOL, definitely! (If you haven't already, @Bougakov, you should join our Slack for more UNIX jokes and other interesting conversations!)

bassosimone commented 3 years ago

To complete this task, we need to extend the build system we've been working on recently (i.e., ./make) to build ./cmd/ooniprobe on Linux Alpine for --platform linux/arm/v7 using Docker. We probably also need to tweak the output path to mention armv7 explicitly.

This work has already been started here: https://github.com/ooni/probe-cli/pull/342.

bassosimone commented 3 years ago

We now have the debian package for armhf in https://github.com/ooni/probe-cli/pull/344.

bassosimone commented 3 years ago

As such, it feels okay to close this issue because we have provided what was originally requested. The instructions to install such a package should be the vanilla install instructions (https://ooni.org/install/cli/ubuntu-debian). Please, let us know if there are issues either by reopening this issue or opening a new one, depending on the circumstances. Thank you all!

PocketSam commented 2 years ago

For some reason it doesn't run automatically on Ubuntu 18.04. If I run it by hand everything works just fine.