-
Notifications
You must be signed in to change notification settings - Fork 328
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
packaging: Integrate github workflows to automate the air-gapping process of wave Tour #2199
Merged
Merged
Changes from 37 commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
f94114d
packaging: Initial workflow files
sulhicader 33c3f71
packaging: changed the workflow tigger on #2163
sulhicader f0c6a4f
packaging: changed the workflow file names on #2163
sulhicader 3a00254
packaging: Added to set version in app.toml on #2163
sulhicader 5b64c3f
packaging: Added workflows from workflow-library on #2163
sulhicader c817498
packaging: Changed workflow trigger mode to push on #2163
sulhicader cd63621
packaging: Added workflow directory to each step on #2163
sulhicader 2c6f361
packaging: Added workflow directory to each step on #2163
sulhicader bc9991d
packaging: Added workflow directory to each step on #2163
sulhicader 5ee8dbf
packaging: Added workflow directory to each step on #2163
sulhicader e6b32d2
packaging: Added workflow directory to each step on #2163
sulhicader fd3610a
packaging: Added workflow directory to each step on #2163
sulhicader acad043
packaging: Added workflow directory to each step on #2163
sulhicader 51a91b6
packaging: Added workflow directory to each step on #2163
sulhicader cdc11bc
Attached new flows to publish-university
sulhicader 66dbde3
packaging: Attached new flows to publish-university on #2163
sulhicader ca86f56
packaging: Reverted some changes on #2163
sulhicader f1407f3
Merge remote-tracking branch 'origin/main' into feat/issue-2163
sulhicader dc9a1c2
packaging: Reverted some changes on #2163
sulhicader 4ad597c
packaging: Removed generated files on #2163
sulhicader 213e6b2
packaging: Added initial workflow files on #2180
sulhicader 08bdc19
packaging: Added initial workflow files on #2180
sulhicader c7552c7
packaging: Added initial workflow files on #2180
sulhicader 2748d8c
packaging: Changed the version on #2180
sulhicader 31b6fa8
Changed the version of tour
sulhicader 293a3ef
Changed the base image on #2180
sulhicader a2a07a6
Merge remote-tracking branch 'origin/main' into feat/issue-2163
sulhicader b43ef51
Handled review comments #2163
sulhicader 72a07bd
Handled review comments #2163
sulhicader 41bf0f7
Handled review comments #2163
sulhicader 1ad2d02
Finalized workflow for university #2163
sulhicader 9b5f402
Merge remote-tracking branch 'origin/main' into feat/issue-2180
sulhicader a112848
Merge remote-tracking branch 'origin/feat/issue-2163' into feat/issue…
sulhicader 988b531
Combined tour image publish to one script #2180
sulhicader bb51d36
Added final workflow for tour app #2180
sulhicader d2a5e04
Removed university related changes #2180
sulhicader cf66838
Merge branch 'main' into feat/issue-2180
sulhicader ba5944b
Merge branch 'main' into feat/issue-2180
sulhicader 6f71abb
Handled review comments
sulhicader b107aee
To trigger refactored workflow
sulhicader 2d34f67
To trigger refactored workflow
sulhicader 158e1b6
To trigger refactored workflow
sulhicader 9080025
To trigger refactored workflow
sulhicader e86e170
Refactored github action for tour app
sulhicader b97ee49
Added an step to remove tmp folder
sulhicader cbdfa2f
Added an step to remove tmp folder at beginning of build-apps
sulhicader File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
.github/workflows/wave-bundle-docker-build-publish.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
name: Build and Publish Docker image from generated Dockerfile | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
build-version: | ||
type: string | ||
description: The version of the application/image to be pushed | ||
required: true | ||
bundle-artifact: | ||
type: string | ||
description: The name of the artifact containing the generated Dockerfiles and the wave bundle | ||
required: true | ||
working-directory: | ||
type: string | ||
description: Path to the working directory, where docker build will be executed | ||
default: . | ||
wave-app-name: | ||
type: string | ||
description: The name of the wave app | ||
required: true | ||
|
||
jobs: | ||
docker: | ||
name: Build and Publish App Docker Image | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write # This is required for requesting the JWT | ||
contents: read # This is required for actions/checkout | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Download Wave bundle and Dockerfiles | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ inputs.bundle-artifact }} | ||
path: ./ | ||
|
||
- name: Rename Dockerfiles | ||
run: | | ||
mv ./*bundle.Dockerfile ./generated.bundle.Dockerfile | ||
mv ./*runtime.Dockerfile ./generated.runtime.Dockerfile | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
role-to-assume: arn:aws:iam::524466471676:role/workflows-library-wave-bundling-github-actions | ||
role-session-name: GitHub_to_AWS_via_FederatedOIDC | ||
aws-region: us-east-1 | ||
|
||
- name: "Login to Amazon ECR" | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: "Ensure ECR Repository for the bundle" | ||
# Tries to describe the repository and if it fails, creates it | ||
run: | | ||
aws ecr describe-repositories \ | ||
--repository-names h2oai/${{ inputs.wave-app-name }}-bundle 2>/dev/null || | ||
aws ecr create-repository \ | ||
--repository-name h2oai/${{ inputs.wave-app-name }}-bundle \ | ||
--image-tag-mutability IMMUTABLE \ | ||
--tag \ | ||
Key=GithubRepo,Value=github.com/h2oai/${{ inputs.wave-app-name }} \ | ||
Key=ManagedBy,Value=GitHubActions \ | ||
Key=CreatedByWorkflow,Value=${{ github.workflow_ref }} | ||
|
||
- name: "Ensure ECR Repository for the runtime" | ||
# Tries to describe the repository and if it fails, creates it | ||
run: | | ||
aws ecr describe-repositories \ | ||
--repository-names h2oai/${{ inputs.wave-app-name }} 2>/dev/null || | ||
aws ecr create-repository \ | ||
--repository-name h2oai/${{ inputs.wave-app-name }} \ | ||
--image-tag-mutability IMMUTABLE \ | ||
--tag \ | ||
Key=GithubRepo,Value=github.com/h2oai/${{ inputs.wave-app-name }} \ | ||
Key=ManagedBy,Value=GitHubActions \ | ||
Key=CreatedByWorkflow,Value=${{ github.workflow_ref }} | ||
|
||
- name: Build and Export Bundle Image | ||
uses: docker/build-push-action@v4 | ||
id: bundle-build | ||
with: | ||
push: true | ||
context: ${{ inputs.working-directory }} | ||
file: ./generated.bundle.Dockerfile | ||
platforms: linux/amd64 | ||
provenance: false | ||
tags: | | ||
524466471676.dkr.ecr.us-east-1.amazonaws.com/h2oai/${{ inputs.wave-app-name }}-bundle:${{ inputs.build-version }} | ||
|
||
- name: Build and Export Runtime Image | ||
uses: docker/build-push-action@v4 | ||
id: runtime-build | ||
with: | ||
push: true | ||
context: ${{ inputs.working-directory }} | ||
file: ./generated.runtime.Dockerfile | ||
platforms: linux/amd64 | ||
provenance: false | ||
tags: | | ||
524466471676.dkr.ecr.us-east-1.amazonaws.com/h2oai/${{ inputs.wave-app-name }}:${{ inputs.build-version }} | ||
|
||
- name: Published Images Summary | ||
run: | | ||
echo "#### Image Tags" >> $GITHUB_STEP_SUMMARY | ||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | ||
echo "docker image push 524466471676.dkr.ecr.us-east-1.amazonaws.com/h2oai/${{ inputs.wave-app-name }}-bundle:${{ inputs.build-version }}" >> $GITHUB_STEP_SUMMARY | ||
echo "docker image push 524466471676.dkr.ecr.us-east-1.amazonaws.com/h2oai/${{ inputs.wave-app-name }}:${{ inputs.build-version }}" >> $GITHUB_STEP_SUMMARY | ||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This introduces unwanted code duplication as this code can also be found in
make build-apps
target. Please refactor so that we have a singlemake build-tour-app
target that can be reused here and also inmake build-apps
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good Suggestion. Thanks @mturoci