Giter Club home page Giter Club logo

tf-aws-container's People

Contributors

thatderek avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

tf-aws-container's Issues

Potential solution for containers that take longer than 15m to build

Currently, the whole process of building a container is controlled / gated by controller_lambda.py running in an aws lambda. The issue with this is that it means, given the use of a single lambda, the operation will fail for any container that takes longer than 15m to build.

If people did want to build containers that take longer though, it could maybe be done by chaining a few lambda invocations together: an initial build-it lambda and then a set number of waiter lambdas. Like, for instance, if a container took ~45m to build (and what great sadness it would be if that were the case, but I've seen it before) then it could probably be covered by 2 lambda_invocation resources that looked something like:

resource "aws_lambda_invocation" "builder" { 
  [ all the configs ]
 }
 
resource "aws_lambda_invocation" "waiters" { 
  count = 4 # or maybe a var
  env {
    task-arn = aws_lambda.invocation.builder.result.task-arn-to-watch
  }
}

data "aws_ecr_image" { 
  # other configs
  digest = compact(flatten(aws_lambda_invocation.waiters[*].result["image_digest"])][0]
}

And so every time a container got built, 5 functions would run, each with a timeout of 15m: the first one would be responsible for firing off the kaniko builder in ecs and waiting for the rest of the 15m; each subsequent builder would come up, look for the image, and if it didn't exist, wait up to 15m for it to show up. Perhaps the last in the chain would exit non-zero if the image never showed up. The additional cost would be negligible because, should the image be built in a prior stage, the subsequent lambda firings would only go for a few milliseconds per tf-run.

Anyhow, this is the mechanism I thought to solve this issue but I don't really intend to tackle it unless someone chimes in saying they need it. In the mean time, this is a placeholder for me to remember my thinking in the future should someone need it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.