Skip to content
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

Profiling workflow on workflow_dispatch #1012

Merged
merged 20 commits into from
Sep 7, 2023

Conversation

willGraham01
Copy link
Collaborator

@willGraham01 willGraham01 commented Jun 29, 2023

Short Description

Provides the "skeleton" for implementation of profile tracking of runs across the repository history (#686).

Adds the run_profiling.yml workflow which profiles the scale_run.py script and exports the resulting .pyisession file to the TLOmodel-profiling repository - repo is under the UCL organisation so everyone should be able to see it, but I can fix that if this isn't the case. Workflow runs on self-hosted runners and uses a tox environment to run the profiling script.

Preview the profiling site here

Full Changes

  • Adds .github/workflows/run_profiling.yml workflow.

    • This workflow can be requested on dispatch
    • This workflow creates results in a tree structure: year/month/day/HHMM/{files.out} on the TLOmodel-profiling repository. Deployment targets the results branch (so that in future we can trigger rendering on pushes to this branch).
  • src/scripts/profiling directory:

    • scale_run.py has the "main" refactored so that it can be imported from the profiling script
    • _paths.py file to fix some important paths to avoid filesystem errors
    • _parameters.py file to reliably the track the parameters that should be passed to the models that we are profiling. NOTE: For the purposes of testing new features, the profiling only runs a month-long simulation. This can be edited once we're happy with the workflow and how the outputs are presented/moved to the output repo.
    • run_profiling.py; new script that can be run from the command-line. Profiles the scale_run model and writes the outputs to either/both HTML and JSON.
  • vscode's linter has also zealously run over a couple of other files like shared.py, which is bloating the diff.

@willGraham01 willGraham01 marked this pull request as ready for review July 14, 2023 09:02
Copy link
Collaborator

@tamuri tamuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great - no specific comments from me. I notice you're using doxygen in the profiling repo. I'd prefer to use sphinx to keep things consistent.

@willGraham01
Copy link
Collaborator Author

I notice you're using doxygen in the profiling repo. I'd prefer to use sphinx to keep things consistent.

No problem - I've swapped it to sphinx to be consistent.

@willGraham01
Copy link
Collaborator Author

@tamuri This OK to be merged in? (I don't have merge authority to master, but if there's a team I can join let me know)

@tamuri
Copy link
Collaborator

tamuri commented Sep 7, 2023

Yes, fine to merge - I've given you permissions.

@willGraham01 willGraham01 merged commit 51f61a7 into master Sep 7, 2023
@willGraham01 willGraham01 deleted the wgraham/pyinstrument-profiling-ci branch September 7, 2023 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants