Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSII libraries with assets not found #1716

Closed
costleya opened this issue Feb 9, 2019 · 1 comment · Fixed by #2182 · May be fixed by MechanicalRock/account-reaper#6
Closed

JSII libraries with assets not found #1716

costleya opened this issue Feb 9, 2019 · 1 comment · Fixed by #2182 · May be fixed by MechanicalRock/account-reaper#6
Assignees
Labels
@aws-cdk/assets Related to the @aws-cdk/assets package @aws-cdk/core Related to core CDK functionality bug This issue is a bug. effort/medium Medium work item – several days of effort

Comments

@costleya
Copy link
Contributor

costleya commented Feb 9, 2019

When trying to use a JSII-built library with assets, those assets will not be found at deployment time. For example, if the library has embedded lambda code, the metadata for the asset will point to a temporary folder. This may be the reason why the .zip file in S3 is empty.

Interesting line in synth: aws:asset:path: /private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/jsii-kernel-tL6ToE/node_modules/cdk-dynamo-table-viewer/lib/lambda

Library used: cdk-dynamo-table-viewer
Binding Language Used: C# (.NET)
Synth output:

ViewHitCounterRendered9C783E45:
    Type: AWS::Lambda::Function
    Properties:
      Code:
        S3Bucket:
          Ref: ViewHitCounterRenderedCodeS3Bucket7AAA6C2C
        S3Key:
          Fn::Join:
            - ""
            - - Fn::Select:
                  - 0
                  - Fn::Split:
                      - "||"
                      - Ref: ViewHitCounterRenderedCodeS3VersionKey7A5EC4B1
              - Fn::Select:
                  - 1
                  - Fn::Split:
                      - "||"
                      - Ref: ViewHitCounterRenderedCodeS3VersionKey7A5EC4B1
      Handler: index.handler
      Role:
        Fn::GetAtt:
          - ViewHitCounterRenderedServiceRole254DB4EA
          - Arn
      Runtime: nodejs8.10
      Environment:
        Variables:
          TABLE_NAME:
            Ref: HelloHitCounterHits7AAEBF80
          TITLE: Hello Hits
          SORT_BY: -hits
    DependsOn:
      - ViewHitCounterRenderedServiceRoleDefaultPolicy9ADB8C83
      - ViewHitCounterRenderedServiceRole254DB4EA
    Metadata:
      aws:cdk:path: CdkWorkshopStack/ViewHitCounter/Rendered/Resource
      aws:asset:path: /private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/jsii-kernel-tL6ToE/node_modules/cdk-dynamo-table-viewer/lib/lambda
      aws:asset:property: Code

deploy trace:

 - /private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/jsii-kernel-4sE9J8/node_modules/cdk-dynamo-table-viewer/lib/lambda (zip)
Preparing asset {"path":"/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/jsii-kernel-4sE9J8/node_modules/cdk-dynamo-table-viewer/lib/lambda","id":"CdkWorkshopStackViewHitCounterRenderedCode7E728AF9","packaging":"zip","s3BucketParameter":"ViewHitCounterRenderedCodeS3Bucket7AAA6C2C","s3KeyParameter":"ViewHitCounterRenderedCodeS3VersionKey7A5EC4B1"}
Preparing zip asset from directory: /private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/jsii-kernel-4sE9J8/node_modules/cdk-dynamo-table-viewer/lib/lambda
zip archive: /var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/cdk-assetsjmwzs1/archive.zip
Preparing file asset: /var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/cdk-assetsjmwzs1/archive.zip
s3://cdktoolkit-stagingbucket----------/assets/CdkWorkshopStackViewHitCounterRenderedCode7E728AF9/8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85.zip: checking if already exists
s3://cdktoolkit-stagingbucket----------/assets/CdkWorkshopStackViewHitCounterRenderedCode7E728AF9/8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85.zip: uploading
s3://cdktoolkit-stagingbucket---------/assets/CdkWorkshopStackViewHitCounterRenderedCode7E728AF9/8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85.zip: upload complete
S3 url for ../../../../private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/jsii-kernel-4sE9J8/node_modules/cdk-dynamo-table-viewer/lib/lambda: s3://cdktoolkit-stagingbucket--------/assets/CdkWorkshopStackViewHitCounterRenderedCode7E728AF9/8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85.zip
Updated: ../../../../private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/jsii-kernel-4sE9J8/node_modules/cdk-dynamo-table-viewer/lib/lambda (zip)
s3://cdktoolkit-stagingbucket------
15/37 | 11:12:07 PM | CREATE_FAILED        | AWS::Lambda::Function       | ViewHitCounter/Rendered (ViewHitCounterRendered9C783E45) Uploaded file must be a non-empty zip (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: ----------------)
        new Function (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/jsii-kernel-4sE9J8/node_modules/@aws-cdk/aws-lambda/lib/function.js:62:26)
        \_ new TableViewer (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/jsii-kernel-4sE9J8/node_modules/cdk-dynamo-table-viewer/lib/table-viewer.js:14:25)
        \_ s._wrapSandboxCode (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:86829)
        \_ t.Kernel._wrapSandboxCode (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:95312)
        \_ t.Kernel._create (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:86808)
        \_ t.Kernel.create (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:81792)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78503)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ t.KernelHost.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78957)
        \_ t.KernelHost.run (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78192)
        \_ e.processRequest (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78218)
        \_ i.then.e (/private/var/folders/0t/_hd2htfd497g3b2z41wlvlx439_1m_/T/fuxkshgm.mys/jsii-runtime.js:1:78831)
@costleya costleya added bug This issue is a bug. @aws-cdk/assets Related to the @aws-cdk/assets package labels Feb 9, 2019
@eladb
Copy link
Contributor

eladb commented Feb 10, 2019

Wow, yes! That’s definitely something we need to address. The jsii runtime uses a temporary directory to unpack the module npm tarball and so it can load it at runtime and the assets are contained in this tarball.

A few proposals:

  1. manage jsii npm modules in a location which persists runtime invocations. The problem with this approach is: a) it will introduce potential race conditions across runtime instances; b) it will need garbage collection.
  2. Modify how assets work in the cdk such that the asset will be emitted into the CDK_OUT dir. this will ensure that the output is self-contained but will require file operations as part of synthesis (copy @SamGood)

@eladb eladb self-assigned this Feb 12, 2019
@eladb eladb closed this as completed Feb 12, 2019
@eladb eladb reopened this Feb 12, 2019
@fulghum fulghum added the effort/medium Medium work item – several days of effort label Feb 18, 2019
sam-goodwin pushed a commit that referenced this issue Mar 1, 2019
This change enables each construct in the tree to participate in synthesis
by overriding the synthesize and add "artifacts" and write files to a synthesis session.

At the moment, the only construct that implements synthesize is Stack which emits an `aws:cloudformation:stack` artifact which includes a reference to a template file stored into the synthesis session as well.

`App.run()` traverses the tree and invokes synthesize on all constructs.

When synthesis is finalized, a manifest is produced and stored in the root `manifest.json` file. This is accordance with the draft specification for cloud assemblies as authored by @RomainMuller and included in this change.

For backwards compatibility, and until we implement the required changes in the toolkit, the output also contains `cdk.out` which is 100% compatible with the current output.

Related #1716 
Related #1893
@eladb eladb added the @aws-cdk/core Related to core CDK functionality label Mar 4, 2019
eladb pushed a commit that referenced this issue Apr 4, 2019
To ensure that assets are available for the toolchain to deploy after the CDK app
exists, the CLI will, by default, request that the app will stage the assets under
the `.cdk.assets` directory (relative to working directory).

The CDK will then *copy* all assets from their source locations to this staging
directory and will refer to the staging location as the asset path. Assets will
be stored using their content fingerprint (md5 hash) so they will never be copied
twice unless they change.

Fixes #1716

TODO:
- [ ] docker assets
- [ ] toolkit support
- [ ] toolkit test
eladb pushed a commit that referenced this issue Apr 4, 2019
To ensure that assets are available for the toolchain to deploy after the CDK app
exists, the CLI will, by default, request that the app will stage the assets under
the `.cdk.assets` directory (relative to working directory).

The CDK will then *copy* all assets from their source locations to this staging
directory and will refer to the staging location as the asset path. Assets will
be stored using their content fingerprint (md5 hash) so they will never be copied
twice unless they change.

Docker build context directories will also be staged.

Staging is disabled by default and in cdk-integ.

Added .cdk.staging to all .gitignore files in cdk init templates.

Fixes #1716
eladb pushed a commit that referenced this issue Apr 8, 2019
To ensure that assets are available for the toolchain to deploy after the CDK app
exists, the CLI will, by default, request that the app will stage the assets under
the `.cdk.assets` directory (relative to working directory).

The CDK will then *copy* all assets from their source locations to this staging
directory and will refer to the staging location as the asset path. Assets will
be stored using their content fingerprint (md5 hash) so they will never be copied
twice unless they change.

Docker build context directories will also be staged.

Staging is disabled by default and in cdk-integ.

Added .cdk.staging to all .gitignore files in cdk init templates.

Fixes #1716
Fixes #2096
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/assets Related to the @aws-cdk/assets package @aws-cdk/core Related to core CDK functionality bug This issue is a bug. effort/medium Medium work item – several days of effort
Projects
None yet
3 participants