fxgsell / GG-Edge-Inference

Using AWS Greengrass with the Nvidia Jetson TX2 to run ML models prepared with Amazon SageMaker.
MIT License
17 stars 7 forks source link

2-face-detection - make failure #5

Closed shirkeyaws closed 6 years ago

shirkeyaws commented 6 years ago

make execution fails:

ec2-user:~/environment/GG-Edge-Inference/2-face-detection (master) $ make

echo "Zipping..."
Zipping...
rm -f package.zip
zip -rq package.zip greengrass_common  greengrass_ipc_python_sdk  greengrasssdk  *.py
echo "Uploading to Lambda"
Uploading to Lambda
aws --profile default --region us-east-1 lambda update-function-code --function-name  --zip-file fileb://`pwd`/package.zip
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:

  aws help
  aws <command> help
  aws <command> <subcommand> help
aws: error: argument --function-name: expected one argument
make: *** [deploy] Error 2

properties.mk

# Static
PROFILE=default
LAMBDA_ALIAS=latest
AWS_COMMAND=aws --profile $(PROFILE) --region $(REGION)

# Edit these values (where required)
REGION=us-east-1
GG_GROUP=ml-edge-workshop
BUCKET=ml-edge-workshop-shirkeys

Is function_name a value we need to pass? Assuming that could be changed during Lab 1, including it would make sense

shirkeyaws commented 6 years ago

Added LAMBDA_FUNCTION to properties.mk file, now the following occurs:

ec2-user:~/environment/GG-Edge-Inference/2-face-detection (master) $ make
echo "Zipping..."
Zipping...
rm -f package.zip
zip -rq package.zip greengrass_common  greengrass_ipc_python_sdk  greengrasssdk  *.py
echo "Uploading to Lambda"
Uploading to Lambda
aws --profile default --region us-east-1 lambda update-function-code --function-name ml-edge-workshop-lab-1 --zip-file fileb://`pwd`/package.zip
{
    "TracingConfig": {
        "Mode": "PassThrough"
    }, 
    "CodeSha256": "x4otKs1etleHIqP+H5tMfeRe9D5DUhGK44wQ4svy1tk=", 
    "FunctionName": "ml-edge-workshop-lab-1", 
    "CodeSize": 21229, 
    "MemorySize": 128, 
    "FunctionArn": "arn:aws:lambda:us-east-1:306280812807:function:ml-edge-workshop-lab-1", 
    "Version": "$LATEST", 
    "Role": "arn:aws:iam::306280812807:role/ml-edge-workshop-lab-1-role", 
    "Timeout": 3, 
    "LastModified": "2018-06-09T11:44:11.594+0000", 
    "Handler": "lambda_function.lambda_handler", 
    "Runtime": "python2.7", 
    "Description": ""
}
aws --profile default --region us-east-1 lambda publish-version --function-name ml-edge-workshop-lab-1 --query Version --output text  > LAMBDA_VERSION
aws --profile default --region us-east-1 lambda update-alias --name latest --function-name ml-edge-workshop-lab-1 --function-version `cat LAMBDA_VERSION`

An error occurred (ResourceNotFoundException) when calling the UpdateAlias operation: Alias not found: arn:aws:lambda:us-east-1:306280812807:function:ml-edge-workshop-lab-1:latest
make: *** [deploy] Error 255

Likely an issue with Lab 1 setup of Lambda function, investigating