{"action":"created","comment":{"url":"https://api.github.com/repos/azavea/raster-foundry-tiler/pulls/comments/42202211","id":42202211,"diff_hunk":"@@ -0,0 +1,171 @@\n+#!/usr/bin/env python\n+# -*- coding: utf-8 -*-\n+from __future__ import print_function\n+from __future__ import unicode_literals\n+from __future__ import division\n+\n+import boto3\n+\n+\n+def create_cluster():\n+    \"\"\"\n+    Create new EMR cluster.\n+    \"\"\"\n+    instances = {\n+        # For debugging only.\n+        'Ec2KeyName': 'rf-emr',\n+        'KeepJobFlowAliveWhenNoSteps': True,\n+\n+        'InstanceGroups': [\n+            {\n+                'Name': 'Master',\n+                'InstanceRole': 'MASTER',\n+                'InstanceType': 'm3.xlarge',\n+                'InstanceCount': 1,\n+            },\n+            {\n+                'Name': 'Workers',\n+                'InstanceRole': 'CORE',\n+                'InstanceType': 'm3.xlarge',\n+\n+                # For debugging only.\n+                # 'Market': 'SPOT',\n+                # 'BidPrice': '0.15',\n+                # 'InstanceCount': 10,\n+\n+                'Market': 'ON_DEMAND',\n+                'InstanceCount': 1,\n+            },\n+        ],\n+    }\n+\n+    configurations = [\n+        {\n+            'Classification': 'hadoop-env',\n+            'Configurations': [\n+                {\n+                    'Classification': 'export',\n+                    'Properties': {\n+                        'GDAL_DATA': '/usr/local/share/gdal',\n+                        'LD_LIBRARY_PATH': '/usr/local/lib',\n+                        'PYSPARK_PYTHON': 'python27',\n+                        'PYSPARK_DRIVER_PYTHON': 'python27'\n+                    }\n+                }\n+            ]\n+        },\n+        {\n+            'Classification': 'spark-env',\n+            'Configurations': [\n+                {\n+                    'Classification': 'export',\n+                    'Properties': {\n+                        'GDAL_DATA': '/usr/local/share/gdal',\n+                        'LD_LIBRARY_PATH': '/usr/local/lib',\n+                        'PYSPARK_PYTHON': 'python27',\n+                        'PYSPARK_DRIVER_PYTHON': 'python27'\n+                    }\n+                }\n+            ]\n+        },\n+        {\n+            'Classification': 'yarn-env',\n+            'Configurations': [\n+                {\n+                    'Classification': 'export',\n+                    'Properties': {\n+                        'GDAL_DATA': '/usr/local/share/gdal',\n+                        'LD_LIBRARY_PATH': '/usr/local/lib',\n+                        'PYSPARK_PYTHON': 'python27',\n+                        'PYSPARK_DRIVER_PYTHON': 'python27'\n+                    }\n+                }\n+            ]\n+        }\n+    ]\n+\n+    client = boto3.client('emr')\n+    response = client.run_job_flow(\n+        Name='RF Tiler (test)',\n+        LogUri='s3://raster-foundry-tiler/logs/',\n+        ReleaseLabel='emr-4.0.0',\n+\n+        # These roles are created when you manually launch an EMR cluster\n+        # or by using the following command:\n+        # > aws emr create-default-roles\n+        ServiceRole='EMR_DefaultRole',\n+        JobFlowRole='EMR_EC2_DefaultRole',\n+\n+        Applications=[\n+            {\n+                'Name': 'Spark',\n+            }\n+        ],\n+        BootstrapActions=[\n+            {\n+                'Name': 'Install dependencies',\n+                'ScriptBootstrapAction': {\n+                    'Path': 's3://raster-foundry-tiler/bootstrap.sh',","path":"examples/create_cluster.py","position":108,"original_position":108,"commit_id":"10ca47740eed74d1211f5bb3b17f96b1d2ad0d1b","original_commit_id":"10ca47740eed74d1211f5bb3b17f96b1d2ad0d1b","user":{"login":"hectcastro","id":43639,"avatar_url":"https://avatars.githubusercontent.com/u/43639?v=3","gravatar_id":"","url":"https://api.github.com/users/hectcastro","html_url":"https://github.com/hectcastro","followers_url":"https://api.github.com/users/hectcastro/followers","following_url":"https://api.github.com/users/hectcastro/following{/other_user}","gists_url":"https://api.github.com/users/hectcastro/gists{/gist_id}","starred_url":"https://api.github.com/users/hectcastro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hectcastro/subscriptions","organizations_url":"https://api.github.com/users/hectcastro/orgs","repos_url":"https://api.github.com/users/hectcastro/repos","events_url":"https://api.github.com/users/hectcastro/events{/privacy}","received_events_url":"https://api.github.com/users/hectcastro/received_events","type":"User","site_admin":false},"body":"I wonder if we should include this bootstrap script as part of the release artifacts. Seems like a thing you'd need in order for things to actually work.\r\n\r\nAlso unclear why GDAL is installed via random tarball.","created_at":"2015-10-16T01:52:14Z","updated_at":"2015-10-16T01:52:14Z","html_url":"https://github.com/azavea/raster-foundry-tiler/pull/3#discussion_r42202211","pull_request_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/azavea/raster-foundry-tiler/pulls/comments/42202211"},"html":{"href":"https://github.com/azavea/raster-foundry-tiler/pull/3#discussion_r42202211"},"pull_request":{"href":"https://api.github.com/repos/azavea/raster-foundry-tiler/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/azavea/raster-foundry-tiler/pulls/3","id":47818257,"html_url":"https://github.com/azavea/raster-foundry-tiler/pull/3","diff_url":"https://github.com/azavea/raster-foundry-tiler/pull/3.diff","patch_url":"https://github.com/azavea/raster-foundry-tiler/pull/3.patch","issue_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/issues/3","number":3,"state":"open","locked":false,"title":"Add example EMR boto script","user":{"login":"kdeloach","id":43062,"avatar_url":"https://avatars.githubusercontent.com/u/43062?v=3","gravatar_id":"","url":"https://api.github.com/users/kdeloach","html_url":"https://github.com/kdeloach","followers_url":"https://api.github.com/users/kdeloach/followers","following_url":"https://api.github.com/users/kdeloach/following{/other_user}","gists_url":"https://api.github.com/users/kdeloach/gists{/gist_id}","starred_url":"https://api.github.com/users/kdeloach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdeloach/subscriptions","organizations_url":"https://api.github.com/users/kdeloach/orgs","repos_url":"https://api.github.com/users/kdeloach/repos","events_url":"https://api.github.com/users/kdeloach/events{/privacy}","received_events_url":"https://api.github.com/users/kdeloach/received_events","type":"User","site_admin":false},"body":"Demonstrates how to create a cluster and run the chunk and mosaic steps\r\nusing boto3.","created_at":"2015-10-15T17:42:25Z","updated_at":"2015-10-16T01:52:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7a6622f41d45ab950d5e93063930779a44d8326e","assignee":{"login":"hectcastro","id":43639,"avatar_url":"https://avatars.githubusercontent.com/u/43639?v=3","gravatar_id":"","url":"https://api.github.com/users/hectcastro","html_url":"https://github.com/hectcastro","followers_url":"https://api.github.com/users/hectcastro/followers","following_url":"https://api.github.com/users/hectcastro/following{/other_user}","gists_url":"https://api.github.com/users/hectcastro/gists{/gist_id}","starred_url":"https://api.github.com/users/hectcastro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hectcastro/subscriptions","organizations_url":"https://api.github.com/users/hectcastro/orgs","repos_url":"https://api.github.com/users/hectcastro/repos","events_url":"https://api.github.com/users/hectcastro/events{/privacy}","received_events_url":"https://api.github.com/users/hectcastro/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/pulls/3/commits","review_comments_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/pulls/3/comments","review_comment_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/pulls/comments{/number}","comments_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/issues/3/comments","statuses_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/statuses/10ca47740eed74d1211f5bb3b17f96b1d2ad0d1b","head":{"label":"kdeloach:feature/example","ref":"feature/example","sha":"10ca47740eed74d1211f5bb3b17f96b1d2ad0d1b","user":{"login":"kdeloach","id":43062,"avatar_url":"https://avatars.githubusercontent.com/u/43062?v=3","gravatar_id":"","url":"https://api.github.com/users/kdeloach","html_url":"https://github.com/kdeloach","followers_url":"https://api.github.com/users/kdeloach/followers","following_url":"https://api.github.com/users/kdeloach/following{/other_user}","gists_url":"https://api.github.com/users/kdeloach/gists{/gist_id}","starred_url":"https://api.github.com/users/kdeloach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdeloach/subscriptions","organizations_url":"https://api.github.com/users/kdeloach/orgs","repos_url":"https://api.github.com/users/kdeloach/repos","events_url":"https://api.github.com/users/kdeloach/events{/privacy}","received_events_url":"https://api.github.com/users/kdeloach/received_events","type":"User","site_admin":false},"repo":{"id":44202860,"name":"raster-foundry-tiler","full_name":"kdeloach/raster-foundry-tiler","owner":{"login":"kdeloach","id":43062,"avatar_url":"https://avatars.githubusercontent.com/u/43062?v=3","gravatar_id":"","url":"https://api.github.com/users/kdeloach","html_url":"https://github.com/kdeloach","followers_url":"https://api.github.com/users/kdeloach/followers","following_url":"https://api.github.com/users/kdeloach/following{/other_user}","gists_url":"https://api.github.com/users/kdeloach/gists{/gist_id}","starred_url":"https://api.github.com/users/kdeloach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdeloach/subscriptions","organizations_url":"https://api.github.com/users/kdeloach/orgs","repos_url":"https://api.github.com/users/kdeloach/repos","events_url":"https://api.github.com/users/kdeloach/events{/privacy}","received_events_url":"https://api.github.com/users/kdeloach/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kdeloach/raster-foundry-tiler","description":"The Raster Foundry tile processor.","fork":true,"url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler","forks_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/forks","keys_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/teams","hooks_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/hooks","issue_events_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/issues/events{/number}","events_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/events","assignees_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/assignees{/user}","branches_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/branches{/branch}","tags_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/tags","blobs_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/git/refs{/sha}","trees_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/statuses/{sha}","languages_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/languages","stargazers_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/stargazers","contributors_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/contributors","subscribers_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/subscribers","subscription_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/subscription","commits_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/commits{/sha}","git_commits_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/git/commits{/sha}","comments_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/comments{/number}","issue_comment_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/issues/comments{/number}","contents_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/contents/{+path}","compare_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/merges","archive_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/downloads","issues_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/issues{/number}","pulls_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/pulls{/number}","milestones_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/milestones{/number}","notifications_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/labels{/name}","releases_url":"https://api.github.com/repos/kdeloach/raster-foundry-tiler/releases{/id}","created_at":"2015-10-13T20:28:19Z","updated_at":"2015-10-13T19:58:53Z","pushed_at":"2015-10-15T21:21:29Z","git_url":"git://github.com/kdeloach/raster-foundry-tiler.git","ssh_url":"git@github.com:kdeloach/raster-foundry-tiler.git","clone_url":"https://github.com/kdeloach/raster-foundry-tiler.git","svn_url":"https://github.com/kdeloach/raster-foundry-tiler","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"azavea:develop","ref":"develop","sha":"f3f7d5e561c261b3decf8cab6567cf144b9fa4ca","user":{"login":"azavea","id":595231,"avatar_url":"https://avatars.githubusercontent.com/u/595231?v=3","gravatar_id":"","url":"https://api.github.com/users/azavea","html_url":"https://github.com/azavea","followers_url":"https://api.github.com/users/azavea/followers","following_url":"https://api.github.com/users/azavea/following{/other_user}","gists_url":"https://api.github.com/users/azavea/gists{/gist_id}","starred_url":"https://api.github.com/users/azavea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azavea/subscriptions","organizations_url":"https://api.github.com/users/azavea/orgs","repos_url":"https://api.github.com/users/azavea/repos","events_url":"https://api.github.com/users/azavea/events{/privacy}","received_events_url":"https://api.github.com/users/azavea/received_events","type":"Organization","site_admin":false},"repo":{"id":44200699,"name":"raster-foundry-tiler","full_name":"azavea/raster-foundry-tiler","owner":{"login":"azavea","id":595231,"avatar_url":"https://avatars.githubusercontent.com/u/595231?v=3","gravatar_id":"","url":"https://api.github.com/users/azavea","html_url":"https://github.com/azavea","followers_url":"https://api.github.com/users/azavea/followers","following_url":"https://api.github.com/users/azavea/following{/other_user}","gists_url":"https://api.github.com/users/azavea/gists{/gist_id}","starred_url":"https://api.github.com/users/azavea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azavea/subscriptions","organizations_url":"https://api.github.com/users/azavea/orgs","repos_url":"https://api.github.com/users/azavea/repos","events_url":"https://api.github.com/users/azavea/events{/privacy}","received_events_url":"https://api.github.com/users/azavea/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/azavea/raster-foundry-tiler","description":"The Raster Foundry tile processor.","fork":false,"url":"https://api.github.com/repos/azavea/raster-foundry-tiler","forks_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/forks","keys_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/teams","hooks_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/hooks","issue_events_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/issues/events{/number}","events_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/events","assignees_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/assignees{/user}","branches_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/branches{/branch}","tags_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/tags","blobs_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/git/refs{/sha}","trees_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/statuses/{sha}","languages_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/languages","stargazers_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/stargazers","contributors_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/contributors","subscribers_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/subscribers","subscription_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/subscription","commits_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/commits{/sha}","git_commits_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/git/commits{/sha}","comments_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/comments{/number}","issue_comment_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/issues/comments{/number}","contents_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/contents/{+path}","compare_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/merges","archive_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/downloads","issues_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/issues{/number}","pulls_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/pulls{/number}","milestones_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/milestones{/number}","notifications_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/labels{/name}","releases_url":"https://api.github.com/repos/azavea/raster-foundry-tiler/releases{/id}","created_at":"2015-10-13T19:48:39Z","updated_at":"2015-10-16T01:26:50Z","pushed_at":"2015-10-16T01:38:17Z","git_url":"git://github.com/azavea/raster-foundry-tiler.git","ssh_url":"git@github.com:azavea/raster-foundry-tiler.git","clone_url":"https://github.com/azavea/raster-foundry-tiler.git","svn_url":"https://github.com/azavea/raster-foundry-tiler","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":6,"forks":2,"open_issues":6,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/azavea/raster-foundry-tiler/pulls/3"},"html":{"href":"https://github.com/azavea/raster-foundry-tiler/pull/3"},"issue":{"href":"https://api.github.com/repos/azavea/raster-foundry-tiler/issues/3"},"comments":{"href":"https://api.github.com/repos/azavea/raster-foundry-tiler/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/azavea/raster-foundry-tiler/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/azavea/raster-foundry-tiler/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/azavea/raster-foundry-tiler/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/azavea/raster-foundry-tiler/statuses/10ca47740eed74d1211f5bb3b17f96b1d2ad0d1b"}}}}