tinkerbell / osie

An in-memory installation environment for bare metal.
https://tinkerbell.org
Apache License 2.0
99 stars 30 forks source link

workflow-helper.sh doesn't execute 2nd docker run #21

Closed Ottovsky closed 4 years ago

Ottovsky commented 4 years ago

Hey there,

It looks like there is some sort of race condition in workflow-helper.sh. When workflow-helper.sh is executed as part of init.rd the following command from the mentioned script is not executed:

https://github.com/tinkerbell/osie/blob/master/installer/workflow-helper.sh#L69-L81

docker run --privileged -ti \
    -e "container_uuid=$id" \
    -e "WORKER_ID=$worker_id" \
    -e "DOCKER_REGISTRY=$docker_registry" \
    -e "TINKERBELL_GRPC_AUTHORITY=$grpc_authority" \
    -e "TINKERBELL_CERT_URL=$grpc_cert_url" \
    -e "REGISTRY_USERNAME=$registry_username" \
    -e "REGISTRY_PASSWORD=$registry_password" \
    -v /worker:/worker \
    -v /var/run/docker.sock:/var/run/docker.sock \
    --log-driver=fluentd -t \
    --net host \
    "$docker_registry/tink-worker:latest"

Re-running workflow-helper.sh manually succeeds and executes without problems.

invidian commented 4 years ago

I added some logging capabilities to the script and I get the following error:

the input device is not a TTY

https://stackoverflow.com/a/43099210/2974814 suggests to just remove -it from the command, which I think make sense, as we don't run it interactively anyway.

After this change, tink-worker starts just fine. Will submit a PR.