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

Is there a way to add a Bitbucket pipelines template

Kapil Gupta June 28, 2023

I wanted to know if there is a way we can contribute a MATLAB based template for Bitbucket pipeline users so that they simply choose our template on the below shown screen and use MATLAB commands in their workflow. I couldn't find any documentation mentioning how you can do so. Are all the following templates prepared and provided by Bitbucket/Atlassian themselves? If not, can you guide me to the process of adding one?

 

Screenshot 2023-06-28 145409.png

Screenshot 2023-06-28 150109.png

Thanks,

Kapil

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 30, 2023

Hello @Kapil Gupta and welcome to the Community!

The available templates provided to the user during the pipeline onboarding are created by the Bitbucket engineering team. While we currently don't have a process for vendors and the community to contribute with the templates, we do have a process in place if you are willing to develop a custom pipe for your product. 

The following resource provides instructions on how third parties can contribute with a pipe: 

Thank you, @Kapil Gupta !

Patrik S

Kapil Gupta July 3, 2023

Hey @Patrik S , thanks for your response!

We originally were discovering if it would be feasible for us to develop an official pipe for the users but realized the pipes functionality is not supported on self-hosted runners. This made us move towards a template based approach for informing users on how to use MATLAB with Bitbucket pipelines.

  • Are there any plans to extend the pipes functionality for self-hosted runners?
  • Is there a way we can collaborate with the Bitbucket engineering team to contribute a template related to MATLAB? We can help you with all the required information and files.

Regards,

Kapil

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 4, 2023

Hello @Kapil Gupta ,

The usage of pipes is supported for Linux Docker self-hosted runners, and you can configure the pipe on the YML file the same way you would when using the cloud runners.

Pipes are only not supported when using Linux Shell, Windows, or macOS runners, because those runners are executed directly in a shell session, and pipes are essentially a docker image, so they need to be executed on a container environment.

Thank you, @Kapil Gupta !

Patrik S

Kapil Gupta July 5, 2023

Hey @Patrik S ,

I see pipes are usable with Linux Docker self-hosted runners. Since docker is also available on Windows and macOS, are there any plans to add Windows docker and macOS docker support with Bitbucket pipelines, similar to what we have for Linux docker.

Regards,

Kapil

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 6, 2023

Hello @Kapil Gupta ,

Docker Desktop for Windows and macOS actually runs in a Linux virtual machine under the hood, so in theory, you should be able to run the Linux docker containers in a Windows and/or macOS environment with Docker Desktop. The pipes should work just fine as well as they are treated like normal containers. 

However, given the extra layer of complexity added by virtualization, you might have an impact on performance or unexpected errors when running in a non-Linux host.

Thank you, @Kapil Gupta !
Patrik S

Kapil Gupta July 8, 2023

Hey @Patrik S ,

Thanks a lot for your responses, it really helped in clarifying things a lot more.

Since we are on this topic, are all bitbucket pipeline hosted agents linux based? It would be helpful if you could shed some light on what type of agents are provided when a user decides to run on Bitbucket's infrastructure.

Regards,

Kapil

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 11, 2023

Hello @Kapil Gupta

You're correct, all the cloud runners (the agents that run on Bitbucket infrastructure) are based on Linux.

So if you configure your step to run on atlassian infrastructure, it will run on an instance based on Linux.

Thank you, @Kapil Gupta !

Patrik S

Kapil Gupta July 14, 2023

Hey @Patrik S ,

Thanks for all the info!

You mentioned we can use pipes on a self hosted linux docker runner and to add a linux docker we can use this doc. When I try to add a repository runner on my Debian 11 machine, it errors out saying that the value provided is not a valid uuid even though I am using the exact command as provided. I have attached images for the error, can you please have a look and let me know what might be the issue?

1.png

2.png

3.png

4.png

5.png

Small addition to previous question:

  • Do all the bitbucket hosted machines have same distributions?
  • If not, what all can be the distribution? And if there is a way to use a specific distribution, can you make me aware with that?

Thanks and regards,

Kapil

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 20, 2023

Hello @Kapil Gupta ,

The error on the screenshot is returned when the UUID in the pre-defined runner command is not valid. This may be happening due to a copy/paste operation inserting invalid characters or line breaks in the command. I would suggest first copying to a text editor and then from the text editor copy to the terminal.

I also saw this error happening when using the bash terminal, so you can try executing the runner command in the sh terminal instead. To do that you can open the terminal on the host machine and execute the following sequence of commands: 

$ sh # open the SH shell. Next instructions will be executed on SH
$ docker container run -it <rest of the command> # the pre-defined runner command you received when creating it

You can test the suggestion above and let us know how it goes.

As for your other questions, all bitbucket-hosted machines run in a Kubernetes cluster that uses Ubuntu. You can find more details in our Infrastructure Changes on BItbucket Pipelines page.

Thank you, @Kapil Gupta !

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events