5

Let's suppose I have an AWS Step function, a state of which is a Batch Job, associated with a Docker image.

  1. Is there more efficient way to associate a Docker image with a state, instead of using a Batch Job (arn:aws:states:::batch:submitJob.sync)? Creating an activity looks too complex.

  2. Is there any realistic way to exchange data between such "dockerized" states, except AWS-based file storages, object DBs, Docker volumes sharing on a separate instance? For example transferring STDOUT content of containerized apps between states?

  3. How application-level errors can be transferred(reported) from Docker container to the corresponding state to invalidate it, mark it as "failed"? Does that depend on the app's return value?

anton
  • 247
  • 3
  • 13

1 Answers1

5

I use ECS Fargate in step functions which allows you to focus on the Container level (a container will be launched and executed for your task).

When you say exchange data are you referring to a simple JSON document vs a large file? If the simple JSON document is what you want you can use. This should help explain that: https://docs.aws.amazon.com/step-functions/latest/dg/concepts-input-output-filtering.html.

If theres an application error I would generally set an exit code with 0 being successful and other numbers being unsuccessful.

Hope this helps

Chris Williams
  • 32,215
  • 4
  • 30
  • 68
  • 2
    Thank you for the quick answer! I'm tied to the Docker, so Fargate solution doesn't play for me. About the output - let's assume that's a JSON object sized from small to medium. And the application's exit code explains the 3rd item of my question very well, I highly appreciate for that. Thank you one more time! – anton May 06 '20 at 17:06
  • Hi, when you say tied to the Docker solution does that mean you have to use Batch instead of using Fargate (which is a Docker Orchestrator)? :) – Chris Williams May 06 '20 at 17:15
  • 2
    Yes, it looks like a misunderstanding from my side because of lack of AWS experience. There are no strict restrictions in using Batch Jobs only. – anton May 06 '20 at 17:24
  • Ah great, use Fargate its AWSome :) – Chris Williams May 06 '20 at 17:26
  • 2
    Of course, I'll try it nearest time and put my feedback here! Many thanks for your advises! – anton May 06 '20 at 17:32