christophebougere / stepfunctions-local Goto Github PK
View Code? Open in Web Editor NEWExecute AWS Step Functions locally
License: Apache License 2.0
Execute AWS Step Functions locally
License: Apache License 2.0
It would be helpful if you could also print out/provide details about a failed schema validation from the asl-validator
, see: https://github.com/airware/asl-validator/blob/d5e4b55ba4e3caa054cc166f5d00e18e884d3554/src/validator.js#L41
Hi,
Is there a way to obtain the detailed execution logs/stack trace for a step function?
I am asking because my step function execution is failing and when i use the describe-execution cli command i only see the json containing the execution status (RUNNING, SUCCEEDED, FAILED,etc.). I wanted to see the logs to determine the reason for this failure.
Thanks in advance!
I followed the steps in this documentation: https://github.com/airware/stepfunctions-local/wiki/Lambdas-deployed-on-Localstack.
1 execution should pass, 3 should fail. However, all 4 fail. I've even created the default AWS Hello World step function template and it also fails. The --debug option with aws cli isn't showing any errors in the output, so I'm not why the status is always "failed" even for single step functions of type Pass.
I did hook up to my AWS and test the Hello World step function and the AWS CLI reported Success.
Let me know if you need anymore info. I think it should be rather easy to reproduce since it involves following the steps in the wiki link above.
Following this: https://github.com/airware/stepfunctions-local/wiki/Lambdas-deployed-on-Localstack
aws lambda --endpoint http://localhost:4574 create-function --function-name Success --runtime nodejs6.10 --role success-role --handler handlers.successHandler --zip-file fileb://handlers.zip | export SUCCESS_LAMBDA_ARN=`jq -r .FunctionArn`
Error:
"parse error: Invalid numeric literal at line 1, column 4"
When creating 2 times the same step function, the JS SDK fails with a Bad Request
while the StateMachineAlreadyExists
error is well catched in the server. The response format must differ a little bit, and the SDK isn't able to parse it. This could potentially be the same issue for many other errors.
After testing lambda's in isolation and deploying to aws, can we test stepfunction locally and point the --lambda-endpoint
to the actual aws? Is that use case supported.
Love the idea behind this project and have been trying to incorporate it into one of my apps that uses step functions so I can test 100% locally. I've been able to:
--lambda-endpoint
option to have it call a mock lambda server I'm running locally.The gotcha is that my mock lambda server gets the POST
... But the body contains an empty JSON input: {}
. For some reason, the original JSON input I passed in is dropped. Any ideas what I'm doing wrong?
Hi, this tool can help me doing this local test:
I want to test the step function logic, I have the template yml/json, can I use stepfuntions-local to execute that template locally?
And then replace the resource arn with local lambdas running? (the local lambda will only return some json info to test the InputPath and ResultPath of the step function logic).
I am not a developer sorry that i dont know the basics, would be great if you can please elaborate how to configure the activity worker
@ChristopheBougere The following command just hangs, I am running it on localstack and tested some hello world functions on lambda. All is OK, but this command just hangs:
stepfunctions-local start --lambda-endpoint http://localhost:4574 --lambda-region local
...
I have no idea what is going on?
I've been using this project heavily for local testing with step functions and it has been working great ๐บ
A few months ago, AWS added support for executing a variety of AWS services from Step Functions, including ECS, SNS, etc. I tried the following to run an ECS Task:
"example-ecs-task": {
"Resource": "arn:aws:states:::ecs:runTask.sync",
"Type": "Task",
"Parameters": {
"Cluster": "my-ecs-cluster",
"LaunchType": "FARGATE",
"TaskDefinition": "example-ecs-task"
},
"Next": "some-other-state"
}
When I try to run the state machine, I get the error:
Error while retrieving task type of resource: arn:aws:states:::ecs:runTask.sync
Is this not yet supported?
When the machine is executed in local with SUCCEEDED status.
Trying to get the description throw AWS API:
val describeExecutionRequest = new DescribeExecutionRequest().withExecutionArn("" +
"arn:aws:states:local:012826867935:execution:Machine_Test16022018:edb6b75e-9e29-4e8f-80a6-bb502e01f0c3")
val describeExecution: DescribeExecutionResult = client.describeExecution(describeExecutionRequest)
Throws exception below:
Exception in thread "main" com.amazonaws.SdkClientException: Unable to unmarshall response (We expected a VALUE token but got: START_OBJECT)
It works correctly with the state machine running on AWS.
Hi,
I'm unable to execute a single 'hello world' python lambda with localstack and stepfunctions-local.
The lambda is working as expected:
aws --endpoint-url=http://localhost:4574 lambda invoke --function-name lambda1 outfile.txt && cat outfile.txt { "StatusCode": 200 } Hello from Lambda
Then created a statemachine that uses the ARN of 'lambda1':
aws stepfunctions --endpoint http://localhost:4584 create-state-machine --role-arn arn:aws:iam::000000000000:role/service-role/MyRole --name successmachine --definition '{"Comment": "Test Step Function","StartAt": "SuccessLambda","States": {"SuccessLambda": {"Type": "Task","Resource": "arn:aws:lambda:us-east-1:000000000000:function:lambda1","Next": "EndState"},"EndState": {"Type": "Pass","End": true}}}'
But after starting an execution and grabbing the details of the execution-arn:
aws stepfunctions --endpoint http://localhost:4584 get-execution-history --execution-arn arn:aws:states:local:000000000000:execution:successmachine:14410b5c-ff6b-4a6c-a1a6-88c06a1fc39c { "events": [ { "timestamp": 1526997500.206, "executionStartedEventDetails": { "input": {} }, "type": "ExecutionStarted", "id": 1, "previousEventId": 0 }, { "timestamp": 1526997500.208, "type": "TaskStateEntered", "id": 2, "stateEnteredEventDetails": { "input": {}, "name": "SuccessLambda" }, "previousEventId": 1 }, { "timestamp": 1526997500.208, "lambdaFunctionScheduledEventDetails": { "input": {}, "timeoutInSeconds": 99999999 }, "type": "LambdaFunctionScheduled", "id": 3, "previousEventId": 2 }, { "timestamp": 1526997500.209, "type": "LambdaFunctionStarted", "id": 4, "previousEventId": 3 }, { "lambdaFunctionFailedEventDetails": { "cause": "SyntaxError", "error": "Unexpected token H in JSON at position 0" }, "timestamp": 1526997500.247, "type": "LambdaFunctionFailed", "id": 5, "previousEventId": 4 }, { "executionFailedEventDetails": { "cause": "SyntaxError", "error": "Unexpected token H in JSON at position 0" }, "timestamp": 1526997500.248, "type": "ExecutionFailed", "id": 6, "previousEventId": 5 } ] }
I'm not getting the clue of the JSON error. Any help is appreciated!
There is nothing in the API spec that requires the state to be an object. In fact, I have several state machines in production that pass around non-object states.
This issue can be reproduced by creating a state machine like this:
{"Comment":"Test Step Function","StartAt":"Pass","States":{"Pass":{"Type":"Pass","OutputPath":"$.pass","Next":"Pass2"},"Pass2":{"Type":"Pass","End":true}}}
Then run the state machine with this input: {"pass": 5}
Here's my output:
stepfunctions-local:log executions: [
stepfunctions-local:log {
stepfunctions-local:log name: '2c5244a2-3abb-4dc7-ba2c-34f60d270aa6',
stepfunctions-local:log input: { pass: 5 },
stepfunctions-local:log executionArn: 'arn:aws:states:local:0123456789:execution:TestString:2c5244a2-3abb-4dc7-ba2c-34f60d270aa6',
stepfunctions-local:log startDate: 1562358255.26,
stepfunctions-local:log stateMachineArn: 'arn:aws:states:us-east-1:0123456789:stateMachine:TestString',
stepfunctions-local:log status: 'SUCCEEDED',
stepfunctions-local:log events: [
stepfunctions-local:log {
stepfunctions-local:log id: 1,
stepfunctions-local:log previousEventId: 0,
stepfunctions-local:log timestamp: 1562358255.263,
stepfunctions-local:log type: 'ExecutionStarted',
stepfunctions-local:log executionStartedEventDetails: { input: '{"pass":5}' }
stepfunctions-local:log },
stepfunctions-local:log {
stepfunctions-local:log id: 2,
stepfunctions-local:log previousEventId: 1,
stepfunctions-local:log timestamp: 1562358255.265,
stepfunctions-local:log type: 'PassStateEntered',
stepfunctions-local:log stateEnteredEventDetails: { input: '{"pass":5}', name: 'Pass' }
stepfunctions-local:log },
stepfunctions-local:log {
stepfunctions-local:log id: 3,
stepfunctions-local:log previousEventId: 2,
stepfunctions-local:log timestamp: 1562358255.267,
stepfunctions-local:log type: 'PassStateExited',
stepfunctions-local:log stateExitedEventDetails: { name: 'Pass', output: '5' }
stepfunctions-local:log },
stepfunctions-local:log {
stepfunctions-local:log id: 4,
stepfunctions-local:log previousEventId: 3,
stepfunctions-local:log timestamp: 1562358255.269,
stepfunctions-local:log type: 'PassStateEntered',
stepfunctions-local:log stateEnteredEventDetails: { input: '{}', name: 'Pass2' }
stepfunctions-local:log },
stepfunctions-local:log {
stepfunctions-local:log id: 5,
stepfunctions-local:log previousEventId: 4,
stepfunctions-local:log timestamp: 1562358255.27,
stepfunctions-local:log type: 'PassStateExited',
stepfunctions-local:log stateExitedEventDetails: { name: 'Pass2', output: '{}' }
stepfunctions-local:log },
stepfunctions-local:log {
stepfunctions-local:log id: 6,
stepfunctions-local:log previousEventId: 5,
stepfunctions-local:log timestamp: 1562358255.271,
stepfunctions-local:log type: 'ExecutionSucceeded',
stepfunctions-local:log executionSucceededEventDetails: { output: '{}' }
stepfunctions-local:log }
stepfunctions-local:log ],
stepfunctions-local:log stopDate: 1562358255.273,
stepfunctions-local:log output: {}
stepfunctions-local:log }
stepfunctions-local:log ],
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.