diff --git a/.github/workflows/helm-release-university.yaml b/.github/workflows/helm-release-university.yaml deleted file mode 100644 index 46978c21fc..0000000000 --- a/.github/workflows/helm-release-university.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: Release Generated Helm Chart - -on: - workflow_call: - inputs: - build-version: - type: string - description: The version of the application/image to be pushed - required: true - -jobs: - retrieve-metadata: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Get App Version - id: get-build-version - run: | - echo "VERSION=${{ inputs.build-version }}" >> "$GITHUB_OUTPUT" - - release-helm-chart: - needs: retrieve-metadata - permissions: - id-token: write # This is required for requesting the JWT - contents: read # This is required for actions/checkout - - uses: ./.github/workflows/wave-bundle-helm-release.yaml - with: - build-version: ${{ inputs.build-version }} - helm-chart-artifact: wave-bundle-helm - wave-app-name: university diff --git a/.github/workflows/publish-university.yml b/.github/workflows/publish-university.yml index ef3e4a1b50..6cc8c40546 100644 --- a/.github/workflows/publish-university.yml +++ b/.github/workflows/publish-university.yml @@ -29,8 +29,66 @@ jobs: packages_dir: university/dist password: ${{ secrets.PYPI_UNIVERSITY_TOKEN }} - bundle_generator: - name: Bundle and Publish - uses: ./.github/workflows/wave-university.yaml - with: + create-bundle: + name: Create Wave Bundle + runs-on: ubuntu-latest + + outputs: build-version: ${{ env.VERSION }} + + steps: + - uses: actions/checkout@v3 + + - 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/latest/cli/linux-amd64/h2o + + - name: Change permissions + working-directory: ./university + run: chmod +x .bin/h2o + + - name: Set version + working-directory: ./university + run: sed -i -r -e "s/\{\{VERSION\}\}/${{ env.VERSION }}/g" app.toml + + - name: Get App Version + id: get-build-version + run: | + echo "VERSION=${{ env.VERSION }}" >> "$GITHUB_OUTPUT" + + - name: Make air-gapped bundle + working-directory: ./university + run: | + .bin/h2o bundle \ + --docker-base-image 524466471676.dkr.ecr.us-east-1.amazonaws.com/q8s/launcher:v0.23.0-38 \ + --docker-use-buildkit \ + --generate-helm-charts \ + --helm-chart-version ${{ env.VERSION }} \ + --helm-chart-name university \ + --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 + with: + name: wave-bundle + path: | + ./university/*.Dockerfile + ./university/*.wave + + - uses: actions/upload-artifact@v3 + with: + name: wave-bundle-helm + path: university/helm/ + + build-and-publish: + needs: create-bundle + permissions: + id-token: write # This is required for requesting the JWT + contents: read # This is required for actions/checkout + + uses: ./.github/workflows/wave-bundle-docker-build-publish.yaml + with: + build-version: ${{ needs.create-bundle.outputs.build-version }} + bundle-artifact: wave-bundle + wave-app-name: university diff --git a/.github/workflows/wave-bundle-helm-release.yaml b/.github/workflows/wave-bundle-helm-release.yaml deleted file mode 100644 index 99155152e7..0000000000 --- a/.github/workflows/wave-bundle-helm-release.yaml +++ /dev/null @@ -1,92 +0,0 @@ -name: Release Helm Chart - -on: - workflow_call: - inputs: - build-version: - type: string - description: The version of the application - required: true - helm-version: - type: string - description: The version of the Helm Chart to be pushed. If not provided `build-version` will be used. - required: false - helm-chart-artifact: - 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: - name: Helm Release - 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: Download Wave bundle and Dockerfile - uses: actions/download-artifact@v3 - id: helm-chart-download - with: - name: ${{ inputs.helm-chart-artifact }} - path: helm/ - - - 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: "Ensure ECR Repository" - # Tires to describe the repository and if it fails, creates it - run: | - aws ecr describe-repositories \ - --repository-names charts/${{ inputs.wave-app-name }} 2>/dev/null || - aws ecr create-repository \ - --repository-name charts/${{ 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: Set up Helm - uses: azure/setup-helm@v3 - with: - token: ${{ github.token }} - - - name: Helm Login to ECR - run: | - aws ecr get-login-password --region us-east-1 \ - | helm registry login --username AWS --password-stdin \ - 524466471676.dkr.ecr.us-east-1.amazonaws.com - - - name: Locate Chart.yaml - id: locate-chart-dir - run: | - echo "PATH=$(dirname $(find ${{ steps.helm-chart-download.outputs.download-path }} -name Chart.yaml))" >> "$GITHUB_OUTPUT" - - - name: Package Helm Chart - run: | - helm package \ - ${{ steps.locate-chart-dir.outputs.PATH }} \ - --version ${{ inputs.helm-version || inputs.build-version }} \ - --app-version ${{ inputs.build-version }} \ - --dependency-update - - - name: Locate Helm package - id: locate-helm-package - run: | - echo "PATH=$(find . -name *-${{ inputs.build-version }}.tgz -type f -exec basename {} \; | tr -d '[:space:]')" >> "$GITHUB_OUTPUT" - - - name: Push Helm Chart to ECR - run: | - helm push ${{ steps.locate-helm-package.outputs.PATH }} oci://524466471676.dkr.ecr.us-east-1.amazonaws.com/charts diff --git a/.github/workflows/wave-bundle-university.yaml b/.github/workflows/wave-bundle-university.yaml deleted file mode 100644 index 111e9a204e..0000000000 --- a/.github/workflows/wave-bundle-university.yaml +++ /dev/null @@ -1,59 +0,0 @@ -name: Wave Bundle - -on: - workflow_call: - inputs: - build-version: - type: string - description: The version of the application/image to be pushed - required: true - -jobs: - airgapped: - name: Create Wave Bundle - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - 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/latest/cli/linux-amd64/h2o - - - name: Change permissions - working-directory: ./university - run: chmod +x .bin/h2o - - - name: Set version - working-directory: ./university - run: sed -i -r -e "s/\{\{VERSION\}\}/${{ inputs.build-version }}/g" app.toml - - - name: Get App Version - id: get-build-version - run: | - echo "VERSION=${{ inputs.build-version }}" >> "$GITHUB_OUTPUT" - - - name: Make air-gapped bundle - working-directory: ./university - run: | - .bin/h2o bundle \ - --docker-base-image 524466471676.dkr.ecr.us-east-1.amazonaws.com/q8s/launcher:v0.23.0-38 \ - --docker-use-buildkit \ - --generate-helm-charts \ - --helm-chart-version ${{ inputs.build-version }} \ - --helm-chart-name university \ - --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 - with: - name: wave-bundle - path: | - ./university/*.Dockerfile - ./university/*.wave - - - uses: actions/upload-artifact@v3 - with: - name: wave-bundle-helm - path: university/helm/ diff --git a/.github/workflows/wave-publish-university.yaml b/.github/workflows/wave-publish-university.yaml deleted file mode 100644 index 65c091a744..0000000000 --- a/.github/workflows/wave-publish-university.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: Publish Wave Bundle - -on: - workflow_call: - inputs: - build-version: - type: string - description: The version of the application/image to be pushed - required: true - -jobs: - retrieve-metadata: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Get App Version - id: get-build-version - run: | - echo "VERSION=${{ inputs.build-version }}" >> "$GITHUB_OUTPUT" - - build-and-publish: - needs: retrieve-metadata - permissions: - id-token: write # This is required for requesting the JWT - contents: read # This is required for actions/checkout - - uses: ./.github/workflows/wave-bundle-docker-build-publish.yaml - with: - build-version: ${{ inputs.build-version }} - bundle-artifact: wave-bundle - wave-app-name: university diff --git a/.github/workflows/wave-university.yaml b/.github/workflows/wave-university.yaml deleted file mode 100644 index 89dab03308..0000000000 --- a/.github/workflows/wave-university.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: Wave Bundle - -on: - workflow_call: - inputs: - build-version: - type: string - description: The version of the application/image to be pushed - required: true - -jobs: - bundle: - name: Create Wave Bundle - uses: ./.github/workflows/wave-bundle-university.yaml - with: - build-version: ${{ inputs.build-version }} - - publish: - needs: bundle - name: Build and Publish - uses: ./.github/workflows/wave-publish-university.yaml - with: - build-version: ${{ inputs.build-version }} - - helm-publish: - needs: bundle - name: Build and Publish Helm Chart - uses: ./.github/workflows/helm-release-university.yaml - with: - build-version: ${{ inputs.build-version }}