Skip to content

ss-1502 Serve profiling image#370

Merged
j-awada merged 9 commits into
developfrom
ss-1502-serve-profiling
Sep 10, 2025
Merged

ss-1502 Serve profiling image#370
j-awada merged 9 commits into
developfrom
ss-1502-serve-profiling

Conversation

@j-awada

@j-awada j-awada commented Aug 11, 2025

Copy link
Copy Markdown
Contributor

Description

Jira: https://scilifelab.atlassian.net/browse/SS-1502

A wrapper image containing modules relevant to profiling and debugging Serve. The 2 modules to start with are django-debug-toolbar and django-silk.

Checklist

If you're unsure about any of the items below, don't hesitate to ask. We're here to help!
This is simply a reminder of what we are going to look for before merging your code.

  • This pull request is against develop branch (not applicable for hotfixes)
  • I have included a link to the issue on GitHub or JIRA (if any)
  • I have included migration files (if there are changes to the model classes)
  • I have included, reviewed and executed tests (unit and end2end) to complement my changes
  • I have updated the related documentation (if necessary)
  • I have added a reviewer for this pull request
  • I have added myself as an author for this pull request
  • In the case I have modified settings.py, then I have also updated the studio-settings-configmap.yaml file in serve-charts

@j-awada j-awada requested a review from a team August 11, 2025 09:43
@j-awada j-awada self-assigned this Aug 11, 2025
@j-awada j-awada marked this pull request as draft August 11, 2025 09:44
@j-awada j-awada marked this pull request as ready for review August 20, 2025 10:09
Comment thread Dockerfile.profiling Outdated
Comment thread studio/settings.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it expected that profiling will only be run using docker compose?:)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@churnikov I think for this PR probably yes. The option to run it locally in profiling mode. But in the future we could run it in profiling on the dev instance. What do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@churnikov I probably can remove the changes I made in the CI workflow in that case.

@hamzaimran08 hamzaimran08 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It would also be good if we could switch between between profiling and normal image using e.g docker compose profiles. Even if we don't do that it would still be good to add the changes needed to docker compose file for switching between the images to the README.

@j-awada

j-awada commented Sep 8, 2025

Copy link
Copy Markdown
Contributor Author

It would also be good if we could switch between between profiling and normal image using e.g docker compose profiles. Even if we don't do that it would still be good to add the changes needed to docker compose file for switching between the images to the README.

@hamzaimran08 Whilst using profile is a good idea, it gets complicated due to the Celery worker and other services depending on the Studio service to start. I tried this locally but can discuss further if you want or if you had another idea of implementing this. I've used profile with 2 optional services: studio and studio-profiling but there is no OR option for depends_on.

I have instead used Env variables to give users the option of switching between the 2 modes. I'll push the code shortly.

@hamzaimran08

Copy link
Copy Markdown
Collaborator

@hamzaimran08 Whilst using profile is a good idea, it gets complicated due to the Celery worker and other services depending on the Studio service to start. I tried this locally but can discuss further if you want or if you had another idea of implementing this. I've used profile with 2 optional services: studio and studio-profiling but there is no OR option for depends_on.

I have instead used Env variables to give users the option of switching between the 2 modes. I'll push the code shortly.

I agree. I think this is a good way to do it. We also have an .env.template (that gets copied to an .env file) file that can be used to set the ENV variables. I think that can be used instead of adding the variables to the command line but as long as README has instructions on how to run and switch between the profiling and normal image either way should be fine.

@j-awada j-awada merged commit a05f10c into develop Sep 10, 2025
3 checks passed
@akochari akochari deleted the ss-1502-serve-profiling branch April 24, 2026 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants