|
| 1 | +**This image is for a specific use case and that most device connectors will not function properly this way, so it's not recommended for use in most cases.** |
| 2 | + |
| 3 | +# Description |
| 4 | +This Dockerfile is used to build an OCI image includes testflinger-agent, testflinger-cli, testfliger-device-connector inside. |
| 5 | +Testflinger-agent is the only application that running at beginning. |
| 6 | + |
| 7 | +# How to build |
| 8 | +```shell |
| 9 | +docker build -t [where is the images registry]/[image name]:[tag] . |
| 10 | +``` |
| 11 | + |
| 12 | +# Variables |
| 13 | +There are some environment variables that could be used to change the setting: |
| 14 | +|Variable|description|default| |
| 15 | +|--|--|--| |
| 16 | +|CONFIG\_DIR|where the configuration files are|/tmp/config| |
| 17 | +|INFLUX\_HOST|for testflinger-agent|127.0.0.1| |
| 18 | +|INFLUX\_PORT|for testflinger-agent|8086| |
| 19 | +|INFLUX\_USER|for testflinger-agent|testflinger-agent| |
| 20 | +|INFLUX\_PW|for testflinger-agent|testflinger-agent| |
| 21 | +|DC\_CONFIG|configuration file of device-connector|device-connectors.yaml| |
| 22 | +|DC\_DUT\_IP|DUT IP that device-connector will operate|127.0.0.1| |
| 23 | +|DC\_DUT\_SID|secure id of DUT|aabbccdd| |
| 24 | +|DC\_NODE\_ID|where the device-connector running is|| |
| 25 | +|DC\_NODE\_NAME|where the device-connector running is|staging-tfagent-cid-REPLACE\_TO\_HOSTNAME(This defualt value will replace `REPLACE_TO_HOSTNAME` to hostname. Therefore, you could use CID as the hostname while starting container)| |
| 26 | +|DC\_MASS\_USER|mass user|bot| |
| 27 | +|DC\_TIMEOUT|timeout of device-connector|120| |
| 28 | +|AGENT\_CONFIG|configuration file of testflinger-agent|agent.yaml| |
| 29 | +|AGENT\_ID|name of agent|same with `DC_AGENT_NAME`| |
| 30 | +|TESTFLINGER\_SERVER|where the testflinger server is|https://testflinger.canonical.com| |
| 31 | +|AGENT\_TIMEOUT|timeout of testflinger-agent|43200| |
| 32 | +|AGENT\_OUTPUT\_TIMEOUT| output timeout of testflinger-agent|9000| |
| 33 | +|AGENT\_EXEC\_DIR|where the testflinger-agent to store running info is|/testflinger/run/| |
| 34 | +|AGENT\_LOG\_DIR|where the testflinger-agent to store log info is|/testflinger/log/| |
| 35 | +|AGENT\_RESULT\_DIR|where the testflinger-agent to store result info is|/testflinger/result/| |
| 36 | +|AGENT\_LOG\_LEVEL|log level of testflinger-agent|DEBUG| |
| 37 | +|AGENT\_JOB\_QUEUE|the job queue the testflinger-agent listened|staging-job-cid-REPLACE\_TO\_HOSTNAME(This defualt value will replace `REPLACE_TO_HOSTNAME` to hostname. Therefore, you could use CID as the hostname while starting container)| |
| 38 | +|AGENT\_SET\_CMD|set command of testflinger-agent|/bin/true| |
| 39 | +|AGENT\_PROV\_CMD|provision command of testflinger-agent|/bin/true| |
| 40 | +|AGENT\_CLEAN\_CMD|cleanup command of testflinger-agent|/bin/true| |
| 41 | +|AGENT\_TEST\_CMD|test command of testflinger-agent|PYTHONIOENCODING=utf-8 PYTHONUNBUFFERED=1 testflinger-device-connector maas2 runtest -c ${CONFIG\_DIR}/${DC\_CONFIG} testflinger.json| |
| 42 | + |
| 43 | +# How to start this container |
| 44 | +```shell |
| 45 | +docker run -d --rm -e INFLUX_HOST=[where it is] --hostname [CID] [images name] |
| 46 | +``` |
| 47 | + |
| 48 | +The user in this conatiner is `root`, you don't have to add `sudo` before the command while root-privilege being needed. For security reason, this container should be ran by `rootless` container runtime. |
| 49 | + |
| 50 | +# How to put configuration file into this container |
| 51 | +The start script will check the configuration files are under `CONFIG_DIR` or not, you could mount volume that contain the configuration files to use your own setting without using too much environment varialbs. |
| 52 | + |
0 commit comments