AWS Batch Multiple Compute Environments Not Working

2

I have the following setup for an AWS Batch Job Queue

    const queue = new batch.JobQueue(this, 'Ec2JobQueue', {
      computeEnvironments: [
        {
          computeEnvironment: ec2SpotEnvironment,
          order: 1,
        },
        {
          computeEnvironment: ec2OnDemandEnvironment,
          order: 2,
        },
      ],
    })

The intent being that when i submit a job it will try to provision an ec2 instance by trying the spot market but if that is not possible it will fallback to using on demand.

What i have observed is that it never uses the on demand compute environment. If there are jobs in the queue and I have hit the service quota limit for number of spot instances I can provision then those jobs will just sit in the queue until a spot instance becomes available. I've confirmed that both compute environments are healthy/valid/enabled in the console.

What should be my expectation around when the second compute environment is used? Ideally there would be an additional 'timeout' setting on a compute environment to facilitate something along the lines of (try spot for for 15mins if no luck, try the next compute environment).

已提問 1 年前檢視次數 247 次
1 個回答
1

also interested in this

qxmips
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南