MLab的webthingscompliant网络测量工具。
murakami的Python项目详细描述
村上春树
村上春树是一个工具,用于创建一个自动化的互联网测量服务,运行在一个Docker容器中。村上春树测量容器可以配置为使用随机计划每天自动运行四次支持的测试,并将每个测试结果导出到本地存储设备、通过SCP导出到一个或多个远程服务器或Google云存储桶。结果以JSON新行格式(.jsonl
)保存为单个文件。在
支持的测量测试
- M-Lab Network Diagnostic Tool(NDT)ndt5和{a3}协议,使用libndt client library
- Neubot DASH-基于HTTP的动态自适应流媒体,由M-Lab托管
- speedtest-cli-用于测试internet带宽的命令行接口速度测试.net在
村上部署方案
村上春树在支持的系统上支持三种类型的容器部署场景:
- Standalone:在设备上配置的单个村上设备
- Local Managed:单个网络中的一个或多个村上设备,在设备上单独配置,或在同一网络上使用Mozilla WebThings Gateway,通过M-Lab WebThings Murakami Add-on
- Balena Cloud:由Balena Cloud IoT platform配置和管理的一个或多个村上设备
支持的操作系统
村上支持Linux操作系统,如Ubuntu、Debian等,不支持Windows。macos可以作为独立设备来支持,但与Webthings接口不完全兼容。Balena cloud尚未在Mac OS上进行测试。在
待办事项:在MacOS上测试部署
村上配置和定制
Murkami容器可以根据部署场景灵活配置。如果您只需在Dockerhub上使用M-Lab的预构建映像运行村上容器,默认情况下,所有测试都配置为每天随机运行四次,但没有启用数据导出器。本节重点介绍可以使用文件murakami.toml
或使用环境变量配置哪些选项。本文件后面几节提供了示例。在
村上集装箱可以定制使用:
- 运行docker时命令行上的环境变量(独立、本地管理)
- 文件中的环境变量,在运行docker时通过命令行传递(独立的,本地管理的)
- 自定义
murakami.toml
配置文件(独立、本地管理、Balena Cloud) - Balena Cloud项目中的环境变量,或每设备(Balena Cloud)
下表总结了您可以在murakami.toml
中配置的选项,以及如何在命令行将这些选项格式化为命令行变量。在
murakami.toml | corresponding environment variable | options/examples | function |
---|---|---|---|
[settings] | |||
port = 80 | MURAKAMI_SETTINGS_PORT | 80, 8080 | Sets the web port used by the Murakami WebThing code |
loglevel = "DEBUG" | MURAKAMI_SETTINGS_LOGLEVEL | DEBUG, ?, ? | Sets the log level for the Murakami service |
immediate = 1 | MURAKAMI_SETTINGS_IMMEDIATE | 0, 1, true, false | If set to ^{ |
location = "Baltimore" | MURAKAMI_SETTINGS_LOCATION | any string | Optional - If set, value is used in exported test file names. |
network_type = "home" | MURAKAMI_SETTINGS_NETWORK_TYPE | any string | Optional - If set, value is used in exported test file names |
connection_type = "wired" | MURAKAMI_SETTINGS_CONNECTION_TYPE | any string | Optional - If set, value is used in exported test file names |
[exporters] | The 'exporters' configuration sections OR environment variables define where test data should be saved or exported. For each exporter all variables listed must be defined. | ||
[exporters.local] | The 'local' exporter defines where on the system's local disk to save test results. | ||
type = "local" | MURAKAMI_EXPORTERS_LOCAL_TYPE | local | |
enabled = true | MURAKAMI_EXPORTERS_LOCAL_ENABLED | 0, 1, true, false | |
path = "/data/" | MURAKAMI_EXPORTERS_LOCAL_PATH | Any system path available to the Murakami container service may be used to save local data. | |
[exporters.scp] | The 'scp' exporter defines a remote server where data should be copied. The server must be configured to allow secure copy via SSH using a private key file. | ||
type = "scp" | MURAKAMI_EXPORTERS_SCP_TYPE | scp | |
enabled = true | MURAKAMI_EXPORTERS_SCP_ENABLED | 0, 1, true, false | |
target = "myserver.com:system/path/" | MURAKAMI_EXPORTERS_SCP_TARGET | hostname:path/ | Defines the remote server and system path where the SCP exporter should save data. A server's IP address is also supported. |
port = 22 | MURAKAMI_EXPORTERS_SCP_PORT | 22, alternate SCP port used by the remote server | Defines the port used by the remote server for the server's SCP/SSH service. |
username = "murakami" | MURAKAMI_EXPORTERS_SCP_USERNAME | remote server username | Defines the username to be used by the SCP exporter. |
private_key = "/murakami/keys/id_rsa_murakami" | MURAKAMI_EXPORTERS_SCP_PRIVATE_KEY | The system path within the Murakami container where the SCP user's private SSH key is located. | |
[exporters.gcs] | The 'gcs' exporter defines a storage bucket in a Google Cloud Storage project where test data should be saved. | ||
type = "gcs" | MURAKAMI_EXPORTERS_GCS_TYPE | gcs | |
enabled = true | MURAKAMI_EXPORTERS_GCS_ENABLED | 0, 1, true, false | |
target = "gs://murakami-gcs-test/" | MURAKAMI_EXPORTERS_GCS_TARGET | gs://bucketname | Defines the GCS storage bucket name where data should be stored. |
service_account = "murakami-test-gcs@mlab-sandbox.iam.gserviceaccount.com" | MURAKAMI_EXPORTERS_GCS_SERVICE_ACCOUNT | The name of the GCS service account which has access to write data to the GCS storage bucket. | |
key = "/murakami/keys/murakami-gcs-serviceaccount.json" | MURAKAMI_EXPORTERS_GCS_KEY | The system path within the Murakami container where the GCS service account's JSON keyfile is located. |
支持多种类型的导出器。例如,如果要定义两个不同的SCP服务器或GCS存储桶,其中应导出数据,则配置文件导出器部分可能如下所示:
[exporters]
[exporters.gcs1]
type = "gcs"
enabled = true
target = "gs://murakami-storage-bucket-archive/"
service_account = "murakami-test-gcs@mlab-sandbox.iam.gserviceaccount.com"
key = "/murakami/keys/murakami-gcs-serviceaccount.json"
[exporters.gcs2]
type = "gcs"
enabled = true
target = "gs://murakami-storage-bucket-access/"
service_account = "murakami-test-gcs@mlab-sandbox.iam.gserviceaccount.com"
key = "/murakami/keys/murakami-gcs-serviceaccount.json"
或作为环境变量:
^{pr2}$M-Lab支持Dockerhub图像和标记
TO DO描述我们如何为不同的系统架构构造标签。在
- 项目
标签: