I work on a project where we have specific computers (configured specs) which pair with our products (hardware). My aim is to configure a self hosted runner so that we can run our test suite on a real product with the same computer and environment that our customers have.
I've been able to set up a self hosted agent with this code
runs-on:
- "self.hosted"
- "ubuntu18.04" But this gives me a docker container on my self host.
Q1) is there any way to use bitbucket-pipelines to run the CI on the self hosted machine itself, rather than a docker container inside of the self hosted machine?
My research has suggested the answer to this Q1 is no, so I then continued to try and develop using the docker container provided by bitbucket for self hosted runner.
The problem now, was that I did not have the environment needed in the docker container provided by bitbucket. Configuring the environment with bash script is doable, but not an attractive option due to increases in build time.
I then found the docker-in-docker (dind) option so that I can run my normal build environment inside the self-hosted runner environment. Essentially then involved adding a CLONE_IMAGE
argument to the docker command provided by bitbucket.
We now reach my current problem in that I get the following error in bitbucket-pipelines:
# under build tab
GIT_LFS_SKIP_SMUDGE=1 GIT_SSL_NO_VERIFY=true retry 6 git clone --branch="feature/testing-infrastructure" https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/$BITBUCKET_REPO_FULL_NAME.git $BUILD_DIR
/tmp/7b85a726-7c76-55d5-b4f4-d7fe74abc8e0/tmp/cloneScript5351248756573077914.sh: line 13: retry: command not found
# under the docker tab
time="2022-07-13T13:38:41.939639712Z" level=info msg="Starting up"
time="2022-07-13T13:38:41.940255296Z" level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found"
time="2022-07-13T13:38:41.940338812Z" level=warning msg="Binding to IP address without --tlsverify is insecure and gives root access on this machine to everyone who has access to your network." host="tcp://0.0.0.0:2375"
time="2022-07-13T13:38:41.940347755Z" level=warning msg="Binding to an IP address, even on localhost, can also give access to scripts run in a browser. Be safe out there!" host="tcp://0.0.0.0:2375"
The logging output from the docker container on the self-hosted runner is:
Completing step with result Result{status=ERROR, error=Some(Error{key='runner.bitbucket-pipelines.clone-container-failure', message='We couldn't clone the repository. Try rerunning the pipeline.', arguments={}})}.
Q2) What is the problem? What is this retry comment that can't be found? I tried sudo apt install retry
which worked, but this is not the program that is needed.
(apologies for the formatting, it seems bitbucket-questions does not want to let me have any more code blocks (?))