google-github-actions / run-vertexai-notebook

A GitHub Action for running a Google Cloud Vertex AI notebook.
https://cloud.google.com/vertex-ai
Apache License 2.0
20 stars 9 forks source link

No kernel name value in Vertex AI #24

Closed ijakas-syn closed 1 year ago

ijakas-syn commented 1 year ago

TL;DR

I still have the same problem when it comes to running the notebook on Vertex. The last commit should have changed it but there is still no value for the kernel name.

Expected behavior

Arguments: --input-notebook=bucket/somedir_sample_notebook.ipynb; --output-notebook=bucket/somedir_sample_notebook.ipynb; --kernel-name=python3;

Observed behavior

Arguments: --input-notebook=bucket/somedir_sample_notebook.ipynb; --output-notebook=bucket/somedir_sample_notebook.ipynb; --kernel-name=

Action YAML

name: Execute notebooks found in a pull request and create links to their output files

on:
  pull_request:
    types: [ labeled ]
    branches:
    - main

permissions:
  pull-requests: 'write'
  issues: 'write'
  contents: write
  id-token: 'write'

env:
  GCS_SOURCE: bucket/src       # TODO: Update to a bucket with proper ACLs
  GCS_OUTPUT: bucket/end       # TODO: Update to a bucket with proper ACLs

jobs:

  # JOB to run change detection and build the allowlist
  changes:
    if: ${{ github.event.label.name == 'notebook-review' }}
    runs-on: ubuntu-latest
    # Set job outputs to values from filter step
    outputs:
      notebooks: ${{ steps.filter.outputs.notebooks }}
      notebooks_files: ${{ steps.filter.outputs.notebooks_files }}
    steps:
    # For pull requests it's not necessary to checkout the code
    - uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721
      id: filter
      with:
        list-files: shell
        filters: |
          notebooks:
            - 'somedir/**.ipynb'
  # JOB to initiate the notebook review process
  notebook-review:
    name: 'Notebook Review'
    needs: changes
    if: ${{ needs.changes.outputs.notebooks == 'true' }}
    runs-on: ubuntu-latest

    steps:
    - id: 'checkout'
      uses: 'actions/checkout@v3'
    # Configure Workload Identity Federation and generate an access token.
    # - id: 'auth'
    #   name: 'Authenticate to Google Cloud'
    #   uses: 'google-github-actions/auth@b258a9f230b36c9fa86dfaa43d1906bd76399edb'
    #   with:
    #     workload_identity_provider: 'projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider'
    #     service_account: 'my-service-account@my-project.iam.gserviceaccount.com'

    # Alternative option - authentication via credentials json
    - id: 'auth'
      name: 'Authenticate to Google Cloud'
      uses: 'google-github-actions/auth@b258a9f230b36c9fa86dfaa43d1906bd76399edb'
      with:
        credentials_json: '${{ secrets.GCP_CREDENTIALS }}'

    - id: notebook-review
      uses: 'google-github-actions/run-vertexai-notebook@v0'
      with:
        gcs_source_bucket: '${{ env.GCS_SOURCE }}'
        gcs_output_bucket: '${{ env.GCS_OUTPUT }}'
        allowlist: '${{ needs.changes.outputs.notebooks_files }}'

Log output

raise ValueError("No kernel name found in notebook and no override provided.")

Additional information

Sorry for raising such a similar issue to the last one, I left a comment on it but I don't know if you have seen it since the issue is closed. Don't want to bother you, I have an idea for a simple MLOps project utilizing Vertex AI and this would be a great way to both deploy the pipelines from the notebook and have version control so I am excited to try it out.

ijakas-syn commented 1 year ago

@bradegler Do you have any ideas what could be causing this? The action looks fine and I can't seem to figure out why it isn't working.

bradegler commented 1 year ago

@ijakas-syn - my apologies, I didn't see the comment in the previous issue. Can you test directly against the SHA of the commit? My suspicion is that the v0 tag is your issue. If this works I'll get a new release cut for you.

- id: notebook-review
      uses: 'google-github-actions/run-vertexai-notebook@2bf5927d84b327136b45692e7b21c85a3204e06e'
      with:
        gcs_source_bucket: '${{ env.GCS_SOURCE }}'
        gcs_output_bucket: '${{ env.GCS_OUTPUT }}'
        allowlist: '${{ needs.changes.outputs.notebooks_files }}

That is a good use case for this action. I'm excited to hear if you get it working and please continue to reach out as you have issue - happy to help.

ijakas-syn commented 1 year ago

Thanks for the response, it works perfectly when I test directly against the SHA of the commit. Maybe you can just change the input name of the kernel variable in the README to kernel_name before for the new release.