fabfile.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:Distributed-CellProfiler 作者: CellProfiler 项目源码 文件源码
def create_or_update_ecs_service():
    # Create the service with no workers (0 desired count)
    info = local('aws ecs list-services', capture=True)
    data = json.loads(info)
    service = [srv for srv in data['serviceArns'] if srv.endswith(ECS_SERVICE_NAME)]
    if len(service) > 0:
        print 'Service exists. Removing'
    local('aws ecs delete-service --cluster ' + ECS_CLUSTER + 
          ' --service ' + ECS_SERVICE_NAME,
          capture=True)
    time.sleep(WAIT_TIME)

    print 'Creating new service'
    local('aws ecs create-service --cluster ' + ECS_CLUSTER + 
          ' --service-name ' + ECS_SERVICE_NAME + 
          ' --task-definition ' + ECS_TASK_NAME + 
          ' --desired-count 0 ',
          capture=True
    )


# Amazon SQS
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号