Skip to content

Commit

Permalink
packaging: Added workflow directory to each step on #2163
Browse files Browse the repository at this point in the history
  • Loading branch information
sulhicader committed Nov 17, 2023
1 parent acad043 commit 51a91b6
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 17 deletions.
1 change: 1 addition & 0 deletions .github/workflows/helm-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ jobs:
with:
build-version: ${{ needs.retrieve-metadata.outputs.build-version }}
helm-chart-artifact: wave-bundle-helm
wave-app-name: university
24 changes: 14 additions & 10 deletions .github/workflows/wave-bundle-docker-build-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
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:
Expand Down Expand Up @@ -55,25 +59,25 @@ jobs:
# Tries to describe the repository and if it fails, creates it
run: |
aws ecr describe-repositories \
--repository-names h2oai/${{ github.event.repository.name }}-bundle 2>/dev/null ||
--repository-names h2oai/${{ inputs.wave-app-name }}-bundle 2>/dev/null ||
aws ecr create-repository \
--repository-name h2oai/${{ github.event.repository.name }}-bundle \
--repository-name h2oai/${{ inputs.wave-app-name }}-bundle \
--image-tag-mutability IMMUTABLE \
--tag \
Key=GithubRepo,Value=github.com/h2oai/${{ github.event.repository.name }} \
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/${{ github.event.repository.name }} 2>/dev/null ||
--repository-names h2oai/${{ inputs.wave-app-name }} 2>/dev/null ||
aws ecr create-repository \
--repository-name h2oai/${{ github.event.repository.name }} \
--repository-name h2oai/${{ inputs.wave-app-name }} \
--image-tag-mutability IMMUTABLE \
--tag \
Key=GithubRepo,Value=github.com/h2oai/${{ github.event.repository.name }} \
Key=GithubRepo,Value=github.com/h2oai/${{ inputs.wave-app-name }} \
Key=ManagedBy,Value=GitHubActions \
Key=CreatedByWorkflow,Value=${{ github.workflow_ref }}
Expand All @@ -87,7 +91,7 @@ jobs:
platforms: linux/amd64
provenance: false
tags: |
524466471676.dkr.ecr.us-east-1.amazonaws.com/h2oai/${{ github.event.repository.name }}-bundle:${{ inputs.build-version }}
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
Expand All @@ -99,12 +103,12 @@ jobs:
platforms: linux/amd64
provenance: false
tags: |
524466471676.dkr.ecr.us-east-1.amazonaws.com/h2oai/${{ github.event.repository.name }}:${{ inputs.build-version }}
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/${{ github.event.repository.name }}-bundle:${{ inputs.build-version }}" >> $GITHUB_STEP_SUMMARY
echo "docker image push 524466471676.dkr.ecr.us-east-1.amazonaws.com/h2oai/${{ github.event.repository.name }}:${{ inputs.build-version }}" >> $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
10 changes: 7 additions & 3 deletions .github/workflows/wave-bundle-helm-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
type: string
description: The name of the artifact containing the generated Helm chart
required: true
wave-app-name:
type: string
description: The name of the wave app
required: true

jobs:
helm:
Expand Down Expand Up @@ -45,12 +49,12 @@ jobs:
# Tires to describe the repository and if it fails, creates it
run: |
aws ecr describe-repositories \
--repository-names charts/${{ github.event.repository.name }} 2>/dev/null ||
--repository-names charts/${{ inputs.wave-app-name }} 2>/dev/null ||
aws ecr create-repository \
--repository-name charts/${{ github.event.repository.name }} \
--repository-name charts/${{ inputs.wave-app-name }} \
--image-tag-mutability IMMUTABLE \
--tag \
Key=GithubRepo,Value=github.com/h2oai/${{ github.event.repository.name }} \
Key=GithubRepo,Value=github.com/h2oai/${{ inputs.wave-app-name }} \
Key=ManagedBy,Value=GitHubActions \
Key=CreatedByWorkflow,Value=${{ github.workflow_ref }}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/wave-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- name: Download H2O CLI
working-directory: ./university
run: mkdir -p .bin && curl -o .bin/h2o https://h2oai-cloud-release.s3.amazonaws.com/releases/ai/h2o/h2o-cloud/v0.28.2/cli/linux-amd64/h2o
run: mkdir -p .bin && curl -o .bin/h2o https://h2oai-cloud-release.s3.amazonaws.com/releases/ai/h2o/h2o-cloud/latest/cli/linux-amd64/h2o

- name: Change permissions
working-directory: ./university
Expand All @@ -40,13 +40,12 @@ jobs:
run: |
.bin/h2o bundle \
--docker-base-image 524466471676.dkr.ecr.us-east-1.amazonaws.com/q8s/launcher:v0.23.0-38 \
--docker-include static \
--docker-use-buildkit \
--generate-helm-charts \
--helm-chart-version 0.0.1 \
--helm-chart-name university \
--helm-app-bundle-image-repo 524466471676.dkr.ecr.us-east-1.amazonaws.com/h2oai/${{ github.event.repository.name }}-bundle \
--helm-app-runtime-image-repo 524466471676.dkr.ecr.us-east-1.amazonaws.com/h2oai/${{ github.event.repository.name }} \
--helm-app-bundle-image-repo 524466471676.dkr.ecr.us-east-1.amazonaws.com/h2oai/university-bundle \
--helm-app-runtime-image-repo 524466471676.dkr.ecr.us-east-1.amazonaws.com/h2oai/university \
--generate-dockerfile
- uses: actions/upload-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/wave-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ jobs:
with:
build-version: ${{ needs.retrieve-metadata.outputs.build-version }}
bundle-artifact: wave-bundle
wave-app-name: university

0 comments on commit 51a91b6

Please sign in to comment.