Live execution of intro_for_model_developers_EXECUTED.ipynb#528
Live execution of intro_for_model_developers_EXECUTED.ipynb#528
intro_for_model_developers_EXECUTED.ipynb#528Conversation
|
A PR preview is available: Preview URL |
|
A PR preview is available: Preview URL |
2 similar comments
|
A PR preview is available: Preview URL |
|
A PR preview is available: Preview URL |
|
A PR preview is available: Preview URL |
2 similar comments
|
A PR preview is available: Preview URL |
|
A PR preview is available: Preview URL |
New excuted copy without edits WIP quarto render to execute the notebook so it displays widgets Renaming executed file Switching to notebook front matter Hmm Tweaked workflow? Removed _freeze test files & commented out checkout in Makefile Ugh trying again Called make get-source for latest vm-library files Reverting makefile Changing API keys to secret variables New intro_for_model_developers_EXECUTED.ipynb -secrets
870153f to
e24ffaf
Compare
|
A PR preview is available: Preview URL |
|
A PR preview is available: Preview URL |
|
A PR preview is available: Preview URL |
|
A PR preview is available: Preview URL |
|
A PR preview is available: Preview URL |
|
A PR preview is available: Preview URL |
|
A PR preview is available: Preview URL |
1 similar comment
|
A PR preview is available: Preview URL |
|
A PR preview is available: Preview URL |
|
A PR preview is available: Preview URL |
1 similar comment
|
A PR preview is available: Preview URL |
3674d6a to
c6949a7
Compare
|
A PR preview is available: Preview URL |
|
Holy forking shirtballs, I figured it out. Updated Miro workflow: Proof that it works conditionally based on what files are included in the PR: #536 tl;dr Now the execution only runs on each workflow if there are Some other fun additions:
Part 2
nts
# See if site/notebooks/ has updates
- name: Filter changed files
uses: dorny/paths-filter@v2
id: filter
with:
filters: |
notebooks:
- 'site/notebooks/**'
# If yes then create the .env file for use in execution step
- name: Create .env file
if: steps.filter.outputs.notebooks == 'true'
id: create_env
run: |
echo "APP_ENV=production" >> .env
echo "PLATFORM_API_HOST=${{ secrets.VM_API_HOST }}" >> .env
echo "PLATFORM_API_KEY=${{ secrets.VM_API_KEY }}" >> .env
echo "PLATFORM_API_SECRET=${{ secrets.VM_API_SECRET }}" >> .env
echo "PLATFORM_DEV_MODEL =${{ secrets.VM_API_MODEL }}" >> .env
- name: Display .env file for debugging, remove on prod
run: cat .env
# Only execute the demo notebook if .env file creation isn't skipped
- name: Execute demo Intro for Model Developers notebook
if: ${{ steps.create_env.outcome != 'skipped' }}
uses: ./.github/actions/demo-notebook
id: execute-demo-notebook
with:
env_file: .envNice to have
|
|
A PR preview is available: Preview URL |
nrichers
left a comment
There was a problem hiding this comment.
Holy forking shirtballs, I figured it out.
Holy mackarel, you’re not kidding. What did we unleash by asking you to tackle the switch to profiles, Beck?!
The single-sourced actions are a great touch.
I can't even ... Spent about an hour poking around in this PR and I've accepted that we simply need to merge this. (Also, I don't think I have a reliable way to test if this will actually deploy to staging and prod without serious shenanigans, so let's just merge and watch for potential issues.)
|
@nrichers And staging works!!! Workflow: https://github.com/validmind/documentation/actions/runs/12021785963/job/33512891350 |
Yup, that looks GREAT! I think this makes the fully executed notebook with the complete output the preferred approach to how we surface the stuff in training — it can be the reference point against which people can check their own work. Applause! |
|
@nrichers There seems to be not QUITE success for merging into It looks like there is some additional logic comparing EDIT: Hopefully these fix it... |
Let's take a look when we meet later today? But looking at that run, the workflow likely needs to compare staging against prod, though even then a |



Internal Notes for Reviewers
ValidMind Library updates
This PR pulls in the latest changes from updated
validmind-libraryvia make get-source. I can confirm that the edits show up in the rendered files.For example: LIVE API REFERENCE PREVIEW
Live execution of intro_for_model_developers_EXECUTED.ipynb
I've used Quarto's native JupyterLab functionality to render this notebook on the fly, and it only cost me some of my sanity — what a bargin.
page-layout: fullto cover more of the negative-space left by the missing sidenav.How does this work? Well:
Global Jupyter Notebook execution settings
In
_quarto.yml, there are now some globalexecutesettings determining behaviour for what Quarto should do when it renders.ipynbfiles:documentation/site/_quarto.yml
Line 5 in 54e9175
intro_for_model_developers_EXECUTED.ipynb front matter
There is now a
rawcell at the top of this version of the notebook that determines the granular execution behaviour for rendering this file:Local output for executed notebook added to
.gitignoreIf you preview or render the files locally, this notebook will execute and we don't want the output cruft (since the workflows take care of the execution for our hosted sites):
documentation/.gitignore
Line 15 in 54e9175
site/_freeze/site/notebooks/tutorials/my_tests/Secure
api_key&api_secretNew "Repository secrets"
PLATFORM_API_KEYPLATFORM_API_SECRETcm3j9lu5208mf21ifij2tp6bk.envsecrets so that it works in both environments — see below..env.example.envfile. WHEN YOU RUN THE NEXT PREVIEW OR RENDER LOCALLY, you'll need to replace this with the Academy org's model's key and secret so that the notebook executes properly, as well as add yourself as a developer to the model, etc..env.exampleas well:documentation/.env.example
Line 3 in 54e9175
Updated GitHub workflows
Some new jobs have been added to all three of our "render docs" workflows:
Install python3 for Jupyter Notebooks: This installs the version ofpython3required for ValidMind & upgradespipfor use inCheck dependencies.Install validmind for notebook execution: This installs all thevalidmindpackages and dependencies required to run the "Intro to Model Developers" notebook with minimal warnings and errors. (There are a few weird ones, I went on quite a journey.)Check dependencies: This installspycairorequired forcheckand then runs the dependency check.The following job has been updated to include the repository
envsecrets:Render docs site:documentation/.github/workflows/validate-docs-site.yaml
Line 50 in cb61d67
n.b.
This PR won't be merged until #529 is approved and merged as they are intertwined.
Local execution of
intro_for_model_developers_EXECUTED.ipynbEDIT: We discussed this and we will add this officially to the
.gitignorein a follow-up PR so we can just leave this file untouched and not override it accidentally with local changes:.gitignoreso that the changes don't get sent up to remote:SHAPGlobalImportance.pyerrorDeveloper Fundamentals iframe
stagingandprod.View Frame Source:Added render run-time
Yeah, I know. I'm sorry. For local versions, you can use the
.gitignorehack for the specific notebook to get around it. I think this is pretty cool functional trade-off though.Edit: Variables are messed up on mobile view & breadcrumbs
This applies to titles and sidebar links in
_quarto.yml:Applied a workaround for now (just using the plain-text term).