Running each BATCH job on dedicated instance. How to?

0

Here is an example of a BATCH setup.

  sampleBatch:
    Type: AWS::Batch::ComputeEnvironment
    Properties:
      State: ENABLED
      Type: MANAGED
      ServiceRole: !GetAtt awsBatchServiceRole.Arn
      ComputeResources:
        MaxvCpus: 20
        MinvCpus: 0
        SecurityGroupIds:
          - !Join [ ",", !Ref "securityGroups" ]
        Type: EC2
        ImageId: !Ref batchAmiImage
        InstanceRole: !GetAtt ecsInstanceProfile.Arn
        InstanceTypes:
          - m4.large
        Ec2KeyPair: !Ref ec2KeyPair
        Subnets: !Ref subnets
        Tags:
          Name: "Testing Batch Env"

  sampleBatchJobQueue:
    Type: "AWS::Batch::JobQueue"
    Properties:
      ComputeEnvironmentOrder:
        - Order: 1
          ComputeEnvironment: !Ref sampleBatch
      State: ENABLED
      Priority: 1000

  sampleCnvBatchJobDefinition:
    Type: "AWS::Batch::JobDefinition"
    Properties:
      Type: container
      ContainerProperties:
        JobRoleArn: !Ref ecsTaskRole
        Image: !Sub "${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/${dockerCnvCallerRepository}:latest"
        Vcpus: 2
        Memory: 2000
        MountPoints:
          - ReadOnly: false
            SourceVolume: genomics
            ContainerPath: /genomics
        Volumes:
          - Host:
              SourcePath: /genomics
            Name: genomics

When I submit multiple jobs, they get queued.
What I want to achieve is that Batch start new instance for each job.

I cannot find a combination of settings that will allow me to do this.

Any advice welcome.

demandé il y a 5 ans290 vues
2 réponses
0

The solution is to wait a little bit in order to let Batch launch more instances = )

répondu il y a 5 ans
0

I accomplished this by defining a job environment with a specific instance type. Then the job definition used that job environment with the specific cpu/memory requirements of that instance. This always ensured each job would run on its own instance.

répondu il y a 5 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions