{"action":"created","comment":{"url":"https://api.github.com/repos/awslabs/aws-sam-cli/pulls/comments/230474597","pull_request_review_id":171228610,"id":230474597,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMDQ3NDU5Nw==","diff_hunk":"@@ -0,0 +1,442 @@\n+``sam build`` command\n+=====================\n+This is the design for a command to **build** a Lambda function. **Build** is the operation of converting the function's\n+source code to an artifact that can be executed on AWS Lambda.\n+\n+\n+What is the problem?\n+--------------------\n+To run a function on AWS Lambda, customers need to provide a zip file containing an executable form of the code. The\n+process of creating the executable usually involves downloading dependent libraries, optionally compiling the code\n+on Amazon Linux, copying static assets, and arranging the files in a directory structure that AWS Lambda accepts.\n+In some programming languages like Javascript, this process is fairly straightforward (just zip a folder), and in\n+others like Python, it is much involved.\n+\n+Customers using SAM CLI can easily create Lambda function code (using ``sam init``) and package their artifact as a\n+zip file (using ``sam package``), but they have to handle the build process themselves. Customers usually implement\n+their own build scripts or adopt other's scripts from the internet. This is where many customers fall off the cliff.\n+\n+\n+What will be changed?\n+---------------------\n+In this proposal, we will be providing a new command, ``sam build``, to build Lambda functions for all programming\n+languages that AWS Lambda supports. The cardinality of the problem is number of programming languages (N) times the\n+number of package managers (M) per language. Hence is it is nearly impossible to natively support each combination.\n+Instead, ``sam build`` will support an opinionated set of package managers for all programming languages. We will\n+provide an option for customers to bring their own build commands or override the default for any programming language.\n+SAM CLI will still take care of the grunt work of iterating through every function in the SAM template, figuring out\n+the source code location, creating temporary folders to store built artifacts, running the build command and\n+move artifacts to right location.\n+\n+\n+Success criteria for the change\n+-------------------------------\n+#. Support all programming languages supported by AWS Lambda\n+\n+   * Nodejs with NPM\n+   * Java with Maven\n+   * Python with PIP\n+   * Golang with Go CLI\n+   * Dotnetcore with DotNet CLI\n+\n+\n+#. Each Lambda function in SAM template gets built\n+\n+#. Produce stable builds (best effort): If the source files did not change, built artifacts should not change.\n+\n+#. Built artifacts should \"just work\" with ``sam local`` and ``sam package`` suite of commands\n+\n+#. Ability to provide arbitrary build commands for each Lambda Function runtime. This will either override the built-in\n+   default or add build support for languages/tools that SAM CLI does not support (ex: java+gradle).\n+\n+#. Opt-in to building native dependencies that can run on AWS Lambda using Docker.\n+\n+#. Support one dependency manifest (ex: package.json) entire app or one per each Lambda function.\n+\n+#. Support out-of-source builds: ie. source code of Lambda function is outside the directory containing SAM template.\n+\n+#. Integrate build action with ``sam local/package/deploy`` commands so the Lambda functions will be automatically\n+   built as part of the command without explicitly running the build command.\n+\n+\n+Out-of-Scope\n+------------\n+#. Supports adding data files ie. files that are not referenced by the package manager (ex: images, css etc)\n+#. Support to exclude certain files from the built artifact (ex: using .gitignore or using regex)","path":"designs/sam_build_cmd.rst","position":65,"original_position":65,"commit_id":"9d503f00dbec0cd2ed33ecfb48aa1dfb4aa830d6","original_commit_id":"9d503f00dbec0cd2ed33ecfb48aa1dfb4aa830d6","user":{"login":"sanathkr","id":22755571,"node_id":"MDQ6VXNlcjIyNzU1NTcx","avatar_url":"https://avatars3.githubusercontent.com/u/22755571?v=4","gravatar_id":"","url":"https://api.github.com/users/sanathkr","html_url":"https://github.com/sanathkr","followers_url":"https://api.github.com/users/sanathkr/followers","following_url":"https://api.github.com/users/sanathkr/following{/other_user}","gists_url":"https://api.github.com/users/sanathkr/gists{/gist_id}","starred_url":"https://api.github.com/users/sanathkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanathkr/subscriptions","organizations_url":"https://api.github.com/users/sanathkr/orgs","repos_url":"https://api.github.com/users/sanathkr/repos","events_url":"https://api.github.com/users/sanathkr/events{/privacy}","received_events_url":"https://api.github.com/users/sanathkr/received_events","type":"User","site_admin":false},"body":"We will exclude certain files & folders by default like `*.pyc` that makes sense, but we won't be able to support parsing an arbitrary `.gitignore` file. So it is possible that we don't create the slimmest zip file. But this could be a fast follow feature.","created_at":"2018-11-02T18:52:09Z","updated_at":"2018-11-02T18:52:10Z","html_url":"https://github.com/awslabs/aws-sam-cli/pull/743#discussion_r230474597","pull_request_url":"https://api.github.com/repos/awslabs/aws-sam-cli/pulls/743","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/awslabs/aws-sam-cli/pulls/comments/230474597"},"html":{"href":"https://github.com/awslabs/aws-sam-cli/pull/743#discussion_r230474597"},"pull_request":{"href":"https://api.github.com/repos/awslabs/aws-sam-cli/pulls/743"}},"in_reply_to_id":230078109},"pull_request":{"url":"https://api.github.com/repos/awslabs/aws-sam-cli/pulls/743","id":227086111,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI3MDg2MTEx","html_url":"https://github.com/awslabs/aws-sam-cli/pull/743","diff_url":"https://github.com/awslabs/aws-sam-cli/pull/743.diff","patch_url":"https://github.com/awslabs/aws-sam-cli/pull/743.patch","issue_url":"https://api.github.com/repos/awslabs/aws-sam-cli/issues/743","number":743,"state":"open","locked":false,"title":"Request for Comments: Design of new `sam build` command","user":{"login":"sanathkr","id":22755571,"node_id":"MDQ6VXNlcjIyNzU1NTcx","avatar_url":"https://avatars3.githubusercontent.com/u/22755571?v=4","gravatar_id":"","url":"https://api.github.com/users/sanathkr","html_url":"https://github.com/sanathkr","followers_url":"https://api.github.com/users/sanathkr/followers","following_url":"https://api.github.com/users/sanathkr/following{/other_user}","gists_url":"https://api.github.com/users/sanathkr/gists{/gist_id}","starred_url":"https://api.github.com/users/sanathkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanathkr/subscriptions","organizations_url":"https://api.github.com/users/sanathkr/orgs","repos_url":"https://api.github.com/users/sanathkr/repos","events_url":"https://api.github.com/users/sanathkr/events{/privacy}","received_events_url":"https://api.github.com/users/sanathkr/received_events","type":"User","site_admin":false},"body":"\r\n💻 [**Rendered Design Doc is here**](https://github.com/sanathkr/aws-sam-cli/blob/build-cmd-design/designs/sam_build_cmd.rst)\r\n\r\n🗓 **RFC Open for feedback until**: 5 Nov, 2018\r\n\r\n*Description of changes:*\r\n\r\nAdding a design document for discussion. In this document, I explain the motivation and technical design behind a new command to create deployable artifacts for Lambda functions from source - `sam build`. \r\n\r\nRequesting comments on every aspect of the design, from user experience to implementation details. Once the discussion is closed, I will update the Task Breakdown section with actual list of tasks to implement this feature and create corresponding Github Issues.\r\n\r\nThis document is based on the design document template I added in #742  \r\n\r\n\r\nBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.\r\n","created_at":"2018-10-30T21:22:03Z","updated_at":"2018-11-02T18:52:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8adf40b8771a95e3ff461fa8e37b600f25ff4768","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/awslabs/aws-sam-cli/pulls/743/commits","review_comments_url":"https://api.github.com/repos/awslabs/aws-sam-cli/pulls/743/comments","review_comment_url":"https://api.github.com/repos/awslabs/aws-sam-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/awslabs/aws-sam-cli/issues/743/comments","statuses_url":"https://api.github.com/repos/awslabs/aws-sam-cli/statuses/9d503f00dbec0cd2ed33ecfb48aa1dfb4aa830d6","head":{"label":"sanathkr:build-cmd-design","ref":"build-cmd-design","sha":"9d503f00dbec0cd2ed33ecfb48aa1dfb4aa830d6","user":{"login":"sanathkr","id":22755571,"node_id":"MDQ6VXNlcjIyNzU1NTcx","avatar_url":"https://avatars3.githubusercontent.com/u/22755571?v=4","gravatar_id":"","url":"https://api.github.com/users/sanathkr","html_url":"https://github.com/sanathkr","followers_url":"https://api.github.com/users/sanathkr/followers","following_url":"https://api.github.com/users/sanathkr/following{/other_user}","gists_url":"https://api.github.com/users/sanathkr/gists{/gist_id}","starred_url":"https://api.github.com/users/sanathkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanathkr/subscriptions","organizations_url":"https://api.github.com/users/sanathkr/orgs","repos_url":"https://api.github.com/users/sanathkr/repos","events_url":"https://api.github.com/users/sanathkr/events{/privacy}","received_events_url":"https://api.github.com/users/sanathkr/received_events","type":"User","site_admin":false},"repo":{"id":152456799,"node_id":"MDEwOlJlcG9zaXRvcnkxNTI0NTY3OTk=","name":"aws-sam-cli","full_name":"sanathkr/aws-sam-cli","private":false,"owner":{"login":"sanathkr","id":22755571,"node_id":"MDQ6VXNlcjIyNzU1NTcx","avatar_url":"https://avatars3.githubusercontent.com/u/22755571?v=4","gravatar_id":"","url":"https://api.github.com/users/sanathkr","html_url":"https://github.com/sanathkr","followers_url":"https://api.github.com/users/sanathkr/followers","following_url":"https://api.github.com/users/sanathkr/following{/other_user}","gists_url":"https://api.github.com/users/sanathkr/gists{/gist_id}","starred_url":"https://api.github.com/users/sanathkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanathkr/subscriptions","organizations_url":"https://api.github.com/users/sanathkr/orgs","repos_url":"https://api.github.com/users/sanathkr/repos","events_url":"https://api.github.com/users/sanathkr/events{/privacy}","received_events_url":"https://api.github.com/users/sanathkr/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sanathkr/aws-sam-cli","description":"AWS SAM CLI 🐿 is a CLI tool for local development and testing of Serverless applications","fork":true,"url":"https://api.github.com/repos/sanathkr/aws-sam-cli","forks_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/forks","keys_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/teams","hooks_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/hooks","issue_events_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/issues/events{/number}","events_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/events","assignees_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/assignees{/user}","branches_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/branches{/branch}","tags_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/tags","blobs_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/languages","stargazers_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/stargazers","contributors_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/contributors","subscribers_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/subscribers","subscription_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/subscription","commits_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/contents/{+path}","compare_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/merges","archive_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/downloads","issues_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/issues{/number}","pulls_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/labels{/name}","releases_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/releases{/id}","deployments_url":"https://api.github.com/repos/sanathkr/aws-sam-cli/deployments","created_at":"2018-10-10T16:41:42Z","updated_at":"2018-10-18T18:07:39Z","pushed_at":"2018-11-01T16:00:53Z","git_url":"git://github.com/sanathkr/aws-sam-cli.git","ssh_url":"git@github.com:sanathkr/aws-sam-cli.git","clone_url":"https://github.com/sanathkr/aws-sam-cli.git","svn_url":"https://github.com/sanathkr/aws-sam-cli","homepage":"","size":17225,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"awslabs:develop","ref":"develop","sha":"ec5c62b513f560053ed99a77350cae82de528694","user":{"login":"awslabs","id":3299148,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyOTkxNDg=","avatar_url":"https://avatars0.githubusercontent.com/u/3299148?v=4","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"repo":{"id":92205085,"node_id":"MDEwOlJlcG9zaXRvcnk5MjIwNTA4NQ==","name":"aws-sam-cli","full_name":"awslabs/aws-sam-cli","private":false,"owner":{"login":"awslabs","id":3299148,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyOTkxNDg=","avatar_url":"https://avatars0.githubusercontent.com/u/3299148?v=4","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/awslabs/aws-sam-cli","description":"AWS SAM CLI 🐿 is a CLI tool for local development and testing of Serverless applications","fork":false,"url":"https://api.github.com/repos/awslabs/aws-sam-cli","forks_url":"https://api.github.com/repos/awslabs/aws-sam-cli/forks","keys_url":"https://api.github.com/repos/awslabs/aws-sam-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/awslabs/aws-sam-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/awslabs/aws-sam-cli/teams","hooks_url":"https://api.github.com/repos/awslabs/aws-sam-cli/hooks","issue_events_url":"https://api.github.com/repos/awslabs/aws-sam-cli/issues/events{/number}","events_url":"https://api.github.com/repos/awslabs/aws-sam-cli/events","assignees_url":"https://api.github.com/repos/awslabs/aws-sam-cli/assignees{/user}","branches_url":"https://api.github.com/repos/awslabs/aws-sam-cli/branches{/branch}","tags_url":"https://api.github.com/repos/awslabs/aws-sam-cli/tags","blobs_url":"https://api.github.com/repos/awslabs/aws-sam-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/awslabs/aws-sam-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/awslabs/aws-sam-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/awslabs/aws-sam-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/awslabs/aws-sam-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/awslabs/aws-sam-cli/languages","stargazers_url":"https://api.github.com/repos/awslabs/aws-sam-cli/stargazers","contributors_url":"https://api.github.com/repos/awslabs/aws-sam-cli/contributors","subscribers_url":"https://api.github.com/repos/awslabs/aws-sam-cli/subscribers","subscription_url":"https://api.github.com/repos/awslabs/aws-sam-cli/subscription","commits_url":"https://api.github.com/repos/awslabs/aws-sam-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/awslabs/aws-sam-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/awslabs/aws-sam-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/awslabs/aws-sam-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/awslabs/aws-sam-cli/contents/{+path}","compare_url":"https://api.github.com/repos/awslabs/aws-sam-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/awslabs/aws-sam-cli/merges","archive_url":"https://api.github.com/repos/awslabs/aws-sam-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/awslabs/aws-sam-cli/downloads","issues_url":"https://api.github.com/repos/awslabs/aws-sam-cli/issues{/number}","pulls_url":"https://api.github.com/repos/awslabs/aws-sam-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/awslabs/aws-sam-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/awslabs/aws-sam-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/awslabs/aws-sam-cli/labels{/name}","releases_url":"https://api.github.com/repos/awslabs/aws-sam-cli/releases{/id}","deployments_url":"https://api.github.com/repos/awslabs/aws-sam-cli/deployments","created_at":"2017-05-23T18:16:23Z","updated_at":"2018-11-02T18:35:28Z","pushed_at":"2018-11-01T22:29:37Z","git_url":"git://github.com/awslabs/aws-sam-cli.git","ssh_url":"git@github.com:awslabs/aws-sam-cli.git","clone_url":"https://github.com/awslabs/aws-sam-cli.git","svn_url":"https://github.com/awslabs/aws-sam-cli","homepage":"","size":17190,"stargazers_count":3401,"watchers_count":3401,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":461,"mirror_url":null,"archived":false,"open_issues_count":111,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":461,"open_issues":111,"watchers":3401,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/awslabs/aws-sam-cli/pulls/743"},"html":{"href":"https://github.com/awslabs/aws-sam-cli/pull/743"},"issue":{"href":"https://api.github.com/repos/awslabs/aws-sam-cli/issues/743"},"comments":{"href":"https://api.github.com/repos/awslabs/aws-sam-cli/issues/743/comments"},"review_comments":{"href":"https://api.github.com/repos/awslabs/aws-sam-cli/pulls/743/comments"},"review_comment":{"href":"https://api.github.com/repos/awslabs/aws-sam-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/awslabs/aws-sam-cli/pulls/743/commits"},"statuses":{"href":"https://api.github.com/repos/awslabs/aws-sam-cli/statuses/9d503f00dbec0cd2ed33ecfb48aa1dfb4aa830d6"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"sanathkr"}}