Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bitbucket Pipelines Runners is now in open beta

113 comments

Riccardo Trivellato May 26, 2021

unfortunately i need to run a pipeline inside my cluster but right now it's not possible to due SSL problem that basically it seems to me very strange @Justin Thomas 

plussier May 26, 2021

This great news, as it's a feature I've greatly missed from GitLab.

However, I can't figure out from the existing docs how to specify a particular image to be used in my pipeline on my runner.  For example, I tried to run a SonarQube scan using the SonarQube container and using the `runs_on` configuration in my pipeline:

pipelines:
default:
- step:
name: SonarQube Scan
image: sonarsource/sonar-scanner-cli:latest
runs_on:
- 'self.hosted'
- 'linux'
script:
- export SONAR_HOST_URL=${SONARQUBE_URL}
- export SONAR_LOGIN=${SONARQUBE_TOKEN}
- sonar-scanner -X

 

The existing docs only provide an example using a custom: pipeline, and the docs for that seem to imply that it is only for use with manually triggered steps, which is not at all what I want. The above configuration seems logical and intuitive, but it's not working, and I can't figure out why it's not working. The docs provide no insight on how to troubleshoot or debug Bitbucket <-> Runner communications. The runner shows up as "online". But there seems to be no indication that it's being sent a job at all.  The SonarQube container is definitely being used, but it seems as if it's being launched on Bitbucket's runners, not mine.

 

Is there more complete documentation available somewhere?

Thanks.

Justin Thomas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 26, 2021

@Luis Thanks for trying out the runner. As self-hosted runners is in beta the REST APIs are still internal, we will be making it public when we go GA. I would suggest not depending on the internal APIs till then. Thanks

Like Luis likes this
Justin Thomas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 26, 2021

@polRk There are multiple things that can impact the speed of a step on a self-hosted runner. Network latency is a known cause to slow down builds in self-hosted runners. I would suggest getting help from Atlassian support to debug the issue. Thanks for trying the runner.

lassian
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 26, 2021

Hi @polRk

What do you mean macos runner? We dont currently support macos are you meaning running it under docker for mac?

The first time you run a step it will have to pull the images from the docker registries which may not be geo located close to you, same for artifacts and caches.

In the cloud we have a registry mirror which caches most of the public layers of dockerhub, and we are geo located close to dockerhub and where caches and artifacts are stored plus the networking provided to those instances would be much higher than whats available to your development machine.

If you would like us to investigate please raise a support ticket, so we can advise.

Kind Regards,

Nathan

lassian
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 26, 2021

Hi @Riccardo Trivellato

Can you please raise a support case so we can investigate this issue.

Kind Regards,

Nathan Burrell

lassian
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 26, 2021

Hi @Erwan d_Orgeville 

We dont support windows containers, we do support linux containers on windows using docker for windows.

Can you please raise a support case, so we can investigate this.

Kind Regards,

Nathan

lassian
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 26, 2021

Hi @plussier

Your yml file is incorrect you need to use `runs-on` not `runs_on` as we ignore unknown properties its thus not reading your runs_on and scheduling on our cloud runner which is the default behaviour when a step doesnt contain `runs-on`.

Kind Regards,

Nathan

Riccardo Trivellato May 26, 2021

Hi @lassian 


i opened a ticket for your team, i hope it can help.

Best regards,
Riccardo Trivellato

plussier May 27, 2021

@lassian - I noticed that .0037 seconds after I finished clicking submit ! ;)

 

Sorry for the noise!

Johnathan Gilday June 7, 2021

Will users be able to allocate more memory to the `docker` service in a self-hosted runner?

Builds are currently constrained by the same 1x and 2x limits that exist with the Atlassian infrastructure, and my motivation for using a self-hosted runner is to allocate more resources to builds.

Thomas Varga June 8, 2021

Is anyone else having issues seeing logs from the execution on the local runner appear in the Bitbucket UI? I see the 'Runner' and 'Build teardown' sections, but nothing in between. If I comment out my 'runs-on' line and have the pipeline execute in the Bitbucket cloud then the log entries show up as expected.

 

Update 2021-06-10: have raised a ticket and the issue has been referred to the internal development team after some troubleshooting efforts.

Michał “McFly” Kasprzyk June 9, 2021

hey

whether the date of implement of the ssh is known?

Alec Keeler June 11, 2021

Just trying to get a runner working on a RHEL7 docker host and getting java errors related to a missing lib

 

[2021-06-11 09:25:37,385] Runner starting version: 1.139 [2021-06-11 09:25:38,537] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dockerServiceImpl' defined in URL [jar:file:/opt/atlassian/pipelines/runner/runner.jar!/com/atlassian/pipelines/runner/core/service/docker/DockerServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'containerServiceImpl' defined in URL 

Then buried down in the hundreds of lines of Java stack trace I can see:

Caused by: java.lang.UnsatisfiedLinkError: could not load a native library: netty_transport_native_epoll_x86_64 at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:226) at io.netty.channel.epoll.Native.loadNativeLibrary(Native.java:250) at io.netty.channel.epoll.Native.<clinit>(Native.java:69) at io.netty.channel.epoll.Epoll.<clinit>(Epoll.java:39) ... 68 more

 Anyone else seen similar errors and know what the required RHEL rpm is to supply netty_transport_native_epoll_x86_64

I thought I had found it with devtoolset-4-netty.noarch but this seemed unlikely as a noarch rpm is unlikely to deliver a x86_64 and didn't resolve the issue

We are currently looking at switching to git from SubVersion and I have been trialling GitHub, GitLab and BitBucket, have got self-hosted runners working on the other 2 and want to get it working on BitBucket as well

Have raised a support ticket BBS-165731

Alec

Thomas Varga June 11, 2021

Hi @Alec Keeler , are you using Docker on RHEL 7? The 'Redhat way' is to use podman instead (see https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux_atomic_host/7/html-single/getting_started_with_containers/index). Not sure if this contributing to your problem or not. FYI I am successfully running the BB Runner on a CentOS 7 Docker host. 

--Thomas

Like Alec Keeler likes this
Alec Keeler June 11, 2021

Thanks for the info, was using docker itself as had a host already set up.

Will have a look at podman

Alec

Alec Keeler June 11, 2021

@Thomas Varga Have set up a CentOS 7 box with podman installed, what did you put in /etc/containers/registries.conf to configure the Atlassian registry

The docker command to run had docker-public.packages.atlassian.com/sox/atlassian/bitbucket-pipelines-runner as the name of the image

I tried just adding docker-public.packages.atlassian.com as follows

[registries.search]
registries = ['docker-public.packages.atlassian.com', 'registry.access.redhat.com', 'registry.redhat.io', 'docker.io']

But that didn't seem to work ?

Thomas Varga June 11, 2021

@Alec Keeler, I may have inadvertently caused some confusion. On CentOS 7 I am using Docker. RHEL however uses podman to run containers. The former I have working with a BB runner , the latter I have not tried.

To get the runner to work on CentOS/Docker I followed the steps in https://support.atlassian.com/bitbucket-cloud/docs/set-up-and-use-runners-for-linux/ . When adding a runner in the BB UI you will be provided a CLI command to copy and paste. Use that verbatim. That will download the Atlassian image and also register your container with the BB cloud. As long as you have the Docker service running it should work without any extra Docker config changes. I followed the instructions on the page to the letter. Apart from an issue with logging all else appears to be working.

Have fun!

 

-- Thomas

Sander Mol June 15, 2021

@Justin ThomasPreviously you have shared that restrictions of memory/run-time will be removed on Pipeline Runners. However, what will happen with the costs? Will you still charge per build minute when using Pipeline Runners? I would expect costs to be significantly lower as we are using our own hardware for this and. Any info about this?

Thomas Varga June 15, 2021

@Sander Mol, from https://support.atlassian.com/bitbucket-cloud/docs/runners/:

"Runners allows you to run builds in Pipelines on your own infrastructure, and you won’t be charged for the build minutes used by your self-hosted runners."

-- Thomas

lassian
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 15, 2021

Hi @Sander Mol 

Correct we dont and wont charge for minutes consumed by steps running on runner regardless of what limits/run-time you use.

Kind Regards,

Nathan Burrell

Ovidiu Gabriel June 16, 2021

@Justin Thomas there is something strange, I can run the build only once, all subsequent builds are hanging. To recover I have to stop, rm and run the docker again.

Thomas Varga June 16, 2021

@Ovidiu Gabriel, after the first build completes, do you still see the 'runner' Docker instance as active? Eg in the 'docker ps' output.

Alec Keeler June 17, 2021

Changed to use docker from dockers own repo on CentOS 7 (installed as per https://docs.docker.com/engine/install/centos/) and the docker runner image now starts OK and connects to bitbucket

Think there might be an issue with the RedHat packaged version of docker included in RHEL 7, so be aware if using the latest RedHat rpm, docker-1.13.1-208.git7d71120.el7_9.x86_64.rpm  

Like Thomas Varga likes this
drichards-alcon June 17, 2021

Just an FYI I was able to get this working on Ubuntu using SNAP by altering the docker command as the location of /var/lib/docker is moved when running it under SNAP.

docker container run -it -v /tmp:/tmp -v /var/run/docker.sock:/var/run/docker.sock -v /var/snap/docker/common/var-lib-docker/containers:/var/lib/docker/containers:ro -e ACCOUNT_UUID...

 

I would like to put a vote to have both repo specific runners as well as runners that were available for all repos in our Workspace. Our use case is that we want to access an on-prem Thycotic Secret Server to be able to pull passwords dynamically during our deployment. To have to run a container for every repo would make this unwieldly.

Love the new feature, is there a public road map available?

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events