Esempio n. 1
0
import os
import sys

import domovoi

pkg_root = os.path.abspath(
    os.path.join(os.path.dirname(__file__), 'domovoilib'))  # noqa
sys.path.insert(0, pkg_root)  # noqa

from dss.logging import configure_lambda_logging
import dss.stepfunctions.s3copyclient as s3copyclient

configure_lambda_logging()
app = domovoi.Domovoi(configure_logs=False)

app.register_state_machine(s3copyclient.copy_write_metadata_sfn)
#!/usr/bin/env python3.6

import os, sys, json, time, random, signal, base64, pickle, zlib
import boto3, domovoi

app = domovoi.Domovoi()

sfn = {
    "Comment": """
    This is a Domovoi integrated AWS Step Functions state machine using a threadpool pattern.
    See https://github.com/kislyuk/domovoi/blob/master/domovoi/examples/state_machine_app.py for more information on
    this state machine.
    """,
    "StartAt": "Scatter",
    "States": {
        "Scatter": {
            "Type": "Task",
            "Resource": None,  # This will be set by Domovoi to the Lambda ARN
            "Next": "Threadpool"
        },
        "Threadpool": {
            "Type": "Parallel",
            "Branches":
            [],  # This will be filled in with an array of "thread" state machines below
            "Next": "Finalizer"
        },
        "Finalizer": {
            "Type": "Task",
            "Resource": None,  # This will be set by Domovoi to the Lambda ARN
            "End": True
        }