Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions cloudformation/templates/1-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ Metadata:
- ResponseHeadersPolicy
- Label:
default: App CodePipeline information
Parameters:
Parameters:
- GitHubConnectionArn
- GitHubRepo
- GitHubBranch
- CreateS3Bucket
- BundlesGitHubRepo
- BundlesGitHubTriggerBranch
- ViteAlternateMatomoUrl
- ViteAlternateMatomoSiteId
- ViteAlternateMatomoSubdomain
Expand Down Expand Up @@ -202,6 +204,12 @@ Parameters:
GitHubConnectionArn:
Description: Can be found or created in CodePipeline console, settings, connections.
Type: String
BundlesGitHubRepo:
Type: String
Description: GitHub repo name for the bundles repo (e.g. edanalytics/earthmover_edfi_bundles)
BundlesGitHubTriggerBranch:
Type: String
Description: Branch of the bundles repo whose merges should trigger an executor image rebuild.
CreateS3Bucket:
Type: String
Description: Create the S3 bucket named 'codepipeline-artifact-store-{AWS::Region}-{AWS::AccountId}'? Do not change this value if updating an existing stack.
Expand Down Expand Up @@ -467,6 +475,8 @@ Resources:
GitHubBranch: !Ref GitHubBranch
GitHubConnectionArn: !Ref GitHubConnectionArn
GitHubRepo: !Ref GitHubRepo
BundlesGitHubRepo: !Ref BundlesGitHubRepo
BundlesGitHubTriggerBranch: !Ref BundlesGitHubTriggerBranch
CreateS3Bucket: 'The S3 Bucket already exists'
EcsStack:
Type: AWS::CloudFormation::Stack
Expand Down Expand Up @@ -497,4 +507,4 @@ Resources:
Outputs:
TemplateVersion:
Description: The version of the cloudformation template
Value: '2.0.2'
Value: '2.0.3'
29 changes: 29 additions & 0 deletions cloudformation/templates/code-pipeline-executor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ Parameters:
GitHubBranch:
Type: String
Description: Name of the branch in the GitHub repo to build from.
BundlesGitHubRepo:
Type: String
Description: GitHub repo name for the bundles repo
BundlesGitHubTriggerBranch:
Type: String
Description: Branch of the bundles repo whose merges should trigger a rebuild.
CreateS3Bucket:
Type: String
Description: Create the S3 bucket named 'job-executor-codepipeline-artifact-store-{AWS::Region}-{AWS::AccountId}'? Do not change this value if updating an existing stack.
Expand Down Expand Up @@ -119,6 +125,13 @@ Resources:
Includes:
- 'executor/**'
ProviderType: CodeStarSourceConnection
- GitConfiguration:
SourceActionName: BundlesSource
Push:
- Branches:
Includes:
- !Ref BundlesGitHubTriggerBranch
ProviderType: CodeStarSourceConnection
Stages:
- Name: SourceStage
Actions:
Expand All @@ -137,6 +150,21 @@ Resources:
OutputArtifacts:
- Name: SourceArtifact
Region: !Ref 'AWS::Region'
- Name: BundlesSource
ActionTypeId:
Category: Source
Owner: AWS
Provider: CodeStarSourceConnection
Version: 1
RunOrder: 1
Configuration:
BranchName: !Ref BundlesGitHubTriggerBranch
ConnectionArn: !Ref GitHubConnectionArn
FullRepositoryId: !Ref BundlesGitHubRepo
OutputArtifactFormat: CODE_ZIP
OutputArtifacts:
- Name: BundlesArtifact
Region: !Ref 'AWS::Region'
- Name: BuildStage
Actions:
- Name: Build
Expand All @@ -160,6 +188,7 @@ Resources:
- Name: BuildArtifact
InputArtifacts:
- Name: SourceArtifact
- Name: BundlesArtifact # codebuild requires this be declared
Region: !Ref 'AWS::Region'
Namespace: BuildVariables

Expand Down
2 changes: 2 additions & 0 deletions cloudformation/templates/x-parameter-values.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ Please note that descriptions, values, and available parameters may evolve over
- **GitHubConnectionArn** - ARN of the GitHub Connection that was created as a prerequisite to deploying Runway.
- **GitHubRepo** - Name of the forked Runway Github repository.
- **GitHubBranch** - Name of the branch in the GitHub repo to build from.
- **BundlesGitHubRepo** - GitHub repo name for the bundles repo
- **BundlesGitHubTriggerBranch** - Branch of the bundles repo whose merges should trigger a rebuild
- **CreateS3Bucket** - Choose whether to create S3 bucket named 'codepipeline-artifact-store-{AWS::Region}-{AWS::AccountId}' in your AWS account. Only choose `Create the S3 bucket` for the very first deployment of Runway in your AWS account. Do not change this value if updating an existing stack.
- **ViteAlternateMatomoUrl** - Internal to EA. Not needed for open-source deployments. Leave blank.
- **ViteAlternateMatomoSiteId** - Internal to EA. Not needed for open-source deployments. Leave blank.
Expand Down
10 changes: 7 additions & 3 deletions executor/executor/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,13 @@ def refresh_bundle_code(self):
subprocess.run(
["git", "-C", config.BUNDLE_DIR, "pull", "--ff-only"]
).check_returncode()
except subprocess.CalledProcessError:
self.error = error.GitPullError()
raise
except subprocess.CalledProcessError as err:
if self.local_mode:
self.error = error.GitPullError()
raise
self.logger.warning(
f"bundle refresh failed in deployed mode; assuming bundle code is already up to date: {err}"
)

def earthmover_deps(self):
"""Create the Earthmover runtime environment by installing bundle dependencies"""
Expand Down