-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add deploy-kernel action and Dockerfile validation #22
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
Open
rryoung98
wants to merge
16
commits into
main
Choose a base branch
from
feature/custom-kernel-deployment
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
239cec7
feat: add Dockerfile validation for custom kernels
rryoung98 7debe7e
feat: add kernel catalog validation to course validator
rryoung98 4ea7c7f
feat: add deploy-kernel composite action
rryoung98 85491fa
feat: add deployment workflow and example Dockerfile for custom kernels
220a982
feat: add unit tests for Dockerfile validation and deployment functio…
2f0185e
feat: update kernel name and ID to qbraid_python in test cases
9e1b67a
fix: make kernel deploy action idempotent and DRY
rryoung98 3b14d31
fix: fail fast on terminal kernel deploy poll errors
rryoung98 8845a52
fix: unblock deploy-kernel wrapper CI checks
rryoung98 d8949f1
chore: fix isort formatting in deploy-kernel wrapper test
rryoung98 6c1d9a5
fix: address upload action review comments
rryoung98 d52396c
style: sort course validator imports
rryoung98 4c98310
fix: secure custom kernel deploy action inputs and outputs
rryoung98 548d4cb
style: align deploy action python formatting checks
rryoung98 1306f55
style: format deploy action test suite
rryoung98 45ceb5a
Update src/scripts/validate_dockerfile.py
rryoung98 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 hidden or 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 hidden or 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,87 @@ | ||
| name: 'Deploy Custom Kernel to qBraid' | ||
| description: 'Validates and deploys a custom Jupyter kernel image to qBraid qBook' | ||
| author: 'qBraid' | ||
|
|
||
| branding: | ||
| icon: 'cpu' | ||
| color: 'purple' | ||
|
|
||
| inputs: | ||
| api-key: | ||
| description: 'qBraid API key for authentication' | ||
| required: true | ||
| dockerfile-path: | ||
| description: 'Path to the kernel Dockerfile' | ||
| required: false | ||
| default: 'Dockerfile.kernel' | ||
| kernel-name: | ||
| description: 'Unique kernel name (lowercase alphanumeric + underscore, 3-64 chars)' | ||
| required: true | ||
| language: | ||
| description: 'Kernel language (python, cpp, julia, r, rust, go, javascript)' | ||
| required: true | ||
| display-name: | ||
| description: 'Human-readable display name for the kernel' | ||
| required: true | ||
| context-dir: | ||
| description: 'Directory containing additional build context files (requirements.txt, kernel.json, etc.)' | ||
| required: false | ||
| default: '.' | ||
| api-base-url: | ||
| description: 'qBraid API base URL' | ||
| required: false | ||
| default: 'https://api-v2.qbraid.com/api/v1' | ||
| timeout-seconds: | ||
| description: 'Maximum time to wait for deployment to finish' | ||
| required: false | ||
| default: '1800' | ||
|
|
||
| outputs: | ||
| kernel-name: | ||
| description: 'The deployed kernel name' | ||
| value: ${{ steps.deploy-kernel.outputs.kernel-name }} | ||
| image-uri: | ||
| description: 'The Artifact Registry image URI' | ||
| value: ${{ steps.deploy-kernel.outputs.image-uri }} | ||
| status: | ||
| description: 'Deployment status (active, failed, timeout)' | ||
| value: ${{ steps.deploy-kernel.outputs.status }} | ||
| build-id: | ||
| description: 'Cloud Build ID' | ||
| value: ${{ steps.deploy-kernel.outputs.build-id }} | ||
|
|
||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Install dependencies | ||
| shell: bash | ||
| run: | | ||
| python -m pip install -q -r "${{ github.action_path }}/requirements.txt" | ||
|
|
||
| - name: Validate Dockerfile | ||
| shell: bash | ||
| run: | | ||
| python ${{ github.action_path }}/src/scripts/validate_dockerfile.py \ | ||
| "${{ inputs.dockerfile-path }}" | ||
|
|
||
| - name: Deploy kernel | ||
| id: deploy-kernel | ||
| shell: bash | ||
| env: | ||
| QBRAID_API_KEY: ${{ inputs.api-key }} | ||
| QBRAID_DEPLOY_TIMEOUT_SECONDS: ${{ inputs.timeout-seconds }} | ||
| run: | | ||
| echo "::add-mask::$QBRAID_API_KEY" | ||
| python ${{ github.action_path }}/src/scripts/deploy_kernel.py \ | ||
| --dockerfile-path "${{ inputs.dockerfile-path }}" \ | ||
| --kernel-name "${{ inputs.kernel-name }}" \ | ||
| --language "${{ inputs.language }}" \ | ||
| --display-name "${{ inputs.display-name }}" \ | ||
| --context-dir "${{ inputs.context-dir }}" \ | ||
| --api-base-url "${{ inputs.api-base-url }}" \ | ||
| --timeout-seconds "${{ inputs.timeout-seconds }}" | ||
This file contains hidden or 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 @@ | ||
| requests>=2.31.0 |
Oops, something went wrong.
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.
The composite action exports
QBRAID_DEPLOY_TIMEOUT_SECONDS, butdeploy_kernel.pydoesn't read this environment variable (timeout is passed via--timeout-seconds). This extra env var can confuse users—either remove it or wire the script to honor it when the CLI arg isn't provided.