Bitbucket Runners vs. Spot Fleet

0

Hello,

I have attempted to configure Bitbucket Runners by following this article, but I am experiencing an issue which I am unsure is intended or not.

When I run the TF script, AWS creates 3 spot instances based on the launch specification, resulting in the following list:

  1. build-runners-0
  2. build-runners-1
  3. build-runners-2

If I or AWS terminate the instance build-runners-0 (for example), the persistent spot request attempts to fill the empty space with a new instance.

However, sometimes it creates build-runners-0 again, and sometimes it creates build-runners-1 or build-runners-2 instead. This means I no longer have build-runners-0, and instead, I have duplicated build-runners-1 or build-runners-2. This is problematic for Bitbucket because each runner has a different UUID => docker cmd => user_data script. As a result, I have three running ec2 instances, but only one or two running Bitbucket runner(s).

According to the official AWS documentation, the allocation strategy diversified should evenly distribute instances within defined subnets and types. I was expecting that if, for example, the build-runners-0 of type t3.xlarge in subnet A is terminated, the persistent spot request should wait until a t3.xlarge in subnet A is available again. It should NOT create a duplicated instance such as r5.xlarge in subnet B again.

My question is whether this behaviour is expected, which would mean that a fleet cannot be used with different user_data configurations, or if it is unexpected, indicating a bug in the diversified allocation strategy.

I have tried the rest of the allocation strategies as well.

Thank you, Jozef

Jozef
asked a year ago72 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions