Build TorizonOS in Azure pipeline

I started updating how my Azure pipleine uses torizoncore-builder.

If I understood, the preferred way is now using the container torizonextras/torizon-dev as done by github workflow and gitlab automation.

Inside this container everything should be already available and created (xonsh, …).

Am I right?

The problem is that this container cannot start in Azure Devops pipeline, with the following error log:

...
Status: Downloaded newer image for torizonextras/torizon-dev:dev

Final exit code for Docker pull: 0
/usr/bin/docker info -f “{{range .Plugins.Network}}{{println .}}{{end}}”
bridge
host
ipvlan
macvlan
null
overlay
/usr/bin/docker network create --label f63c4c vsts_network_aecd63d112f04a268fedec70eb29e396
3eccdb092ba70aa486f3895ddeaf1d298147d07bb8ed3407d6b5d93bc657d60f
/usr/bin/docker inspect --format=“{{index .Config.Labels "com.azure.dev.pipelines.agent.handler.node.path"}}” torizonextras/torizon-dev:dev
/usr/bin/docker create --name a0dc1085c29e49478c8416c89591b478_torizonextrastorizondevdev_608e91 --label f63c4c --network vsts_network_aecd63d112f04a268fedec70eb29e396 --user root -v “/var/run/docker.sock”:“/var/run/docker.sock” -v “/home/vsts/work/1”:“/__w/1” -v “/home/vsts/work/_temp”:“/__w/_temp” -v “/home/vsts/work/_tasks”:“/__w/_tasks” -v “/opt/hostedtoolcache”:“/__t” -v “/home/vsts/actions-runner/cached/4.270.0/externals”:“/__a/externals”:ro -v “/home/vsts/work/.taskkey”:“/__w/.taskkey” torizonextras/torizon-dev:dev bash -c “‘/__a/externals/node20_1/bin/node’ --version && echo ‘container-startup-using-node-20’ && ‘/__a/externals/node20_1/bin/node’ -e ‘setInterval(function(){}, 24 * 60 * 60 * 1000);’ || ‘/__a/externals/node16/bin/node’ --version && echo ‘container-startup-using-node-16’ && ‘/__a/externals/node16/bin/node’ -e ‘setInterval(function(){}, 24 * 60 * 60 * 1000);’ || echo ‘container-startup-failed’”
4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1
DockerActionRetries variable value: True
/usr/bin/docker start 4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1
4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1
Final exit code for Docker start: 0
/usr/bin/docker ps --all --filter id=4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1 --filter status=running --no-trunc --format “{{.ID}} {{.Status}}”
4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1 Up Less than a second
/usr/bin/docker logs --details 4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1
/usr/bin/docker logs --details 4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1
/usr/bin/docker logs --details 4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1
/usr/bin/docker logs --details 4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1
/usr/bin/docker logs --details 4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1
/usr/bin/docker logs --details 4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1
/usr/bin/docker logs --details 4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1
/usr/bin/docker logs --details 4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1
/usr/bin/docker logs --details 4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1
usage: zygote [-h] [–version] {scan,target,connect,new,init,tasks,fetch} …
zygote: error: argument {scan,target,connect,new,init,tasks,fetch}: invalid choice: ‘bash’ (choose from ‘scan’, ‘target’, ‘connect’, ‘new’, ‘init’, ‘tasks’, ‘fetch’)
/usr/bin/docker logs --details 4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1
usage: zygote [-h] [–version] {scan,target,connect,new,init,tasks,fetch} …
zygote: error: argument {scan,target,connect,new,init,tasks,fetch}: invalid choice: ‘bash’ (choose from ‘scan’, ‘target’, ‘connect’, ‘new’, ‘init’, ‘tasks’, ‘fetch’)
/usr/bin/docker logs --details 4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1

...

##[warning]Container startup timeout after 10100ms. Cannot get startup status from container.
/usr/bin/docker exec  4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1 sh -c "command -v bash"
##[error]Docker-exec executed: `sh -c "command -v bash"`; container id: `4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1`; exit code: `1`; command output: `Error response from daemon: container 4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1 is not running`

How can I fix this?

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


The issue you’re experiencing is related to Azure DevOps trying to execute bash within the torizonextras/torizon-dev container, but the container’s entrypoint is configured to use zygote instead (1).

Solution

Based on community discussions, there are several approaches to resolve this:

Option 1: Use the script Command Wrapper

You can wrap your torizoncore-builder commands with the script command to simulate a TTY environment (1):

script -q -c "torizoncore-builder build"

(1)

Option 2: Manual Alias Definition

Instead of relying on the container’s setup script, define the torizoncore-builder alias manually in your pipeline (1). This approach avoids the TTY-related issues entirely.

Option 3: Modify the Setup Script

Some users have successfully used sed to remove the -it flag from the setup script before running it (1). This removes the interactive terminal requirement that causes issues in CI/CD environments.

Alternative Approach

For Azure DevOps specifically, consider using a different container approach or running TorizonCore Builder directly on the host system. The documentation shows that TorizonCore Builder can be used effectively in CI/CD pipelines, but the specific container configuration needs to match your pipeline’s execution model (2).

The error you’re seeing (zygote: error: argument {scan,target,connect,new,init,tasks,fetch}: invalid choice: 'bash') indicates that Azure DevOps is trying to execute bash commands directly against the container’s entrypoint, which expects zygote commands instead.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Greetings @vix,

How exactly are you invoking torizonextras/torizon-dev in your pipeline? Based on your logs it looks like you’re doing something like docker run torizonextras/torizon-dev:dev bash. Due to the presence of the error:

zygote: error: argument {scan,target,connect,new,init,tasks,fetch}: invalid choice: ‘bash’ (choose from ‘scan’, ‘target’, ‘connect’, ‘new’, ‘init’, ‘tasks’, ‘fetch’)
/usr/bin/docker logs --details 4860247cec64091f341f86349e4c65f3b1ae73c218fbb507aeef34541ad6d2e1

Am I right?

The container here provides an environment similar to what is found in the IDE extension. To allow the execution of various xonsh scripts and tasks for automation.

Best Regards,
Jeremias