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

Enable Ersilia to serve multiple models simultaneously #1201

Merged
merged 13 commits into from
Jul 26, 2024

Conversation

DhanshreeA
Copy link
Member

@DhanshreeA DhanshreeA commented Jul 17, 2024

Thank you for taking your time to contribute to Ersilia, just a few checks before we proceed

  • Have you followed the guidelines in our Contribution Guide
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Description

Replace this line with a short description here...

Changes to be made

Replace this line with how do you intend to go about getting this done...

Status

Replace this line with what you have done so far...

To do

If this is a work in progress, Replace this line with your next steps

Is this pull request related to any open issue? If yes, replace issueID below with the issue ID

Related to #

Copy link
Member

@miquelduranfrigola miquelduranfrigola 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 good to me.

@miquelduranfrigola
Copy link
Member

Hi @DhanshreeA the Run PyTest test failed. I have not merged.

…o the parent process' id which ran the given ersilia command, this will generally be a shell process inside a terminal, but it can also be a process from a bash script
…ple run, otherwise ersilia run command does not find a served model bec of running in a different process and therefore in a different session
@miquelduranfrigola
Copy link
Member

Feel free to merge anytime

Copy link
Member

@miquelduranfrigola miquelduranfrigola left a comment

Choose a reason for hiding this comment

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

Is there a reason why we should experience permission errors? I believe this has happened before? One option would be to grant write permissions to any user when we create those folders. However, I am OK with the current solution.

@miquelduranfrigola
Copy link
Member

Hi @DhanshreeA it doesn't seem to work now based on the checks above

@DhanshreeA
Copy link
Member Author

DhanshreeA commented Jul 26, 2024

Hi @DhanshreeA it doesn't seem to work now based on the checks above

Hey @miquelduranfrigola - I've just pushed a fix for it, merging it as soon as the pipeline passes.

@DhanshreeA DhanshreeA merged commit 552b053 into master Jul 26, 2024
20 checks passed
@DhanshreeA DhanshreeA deleted the simultaneous-sessions branch July 26, 2024 14:30
DhanshreeA added a commit that referenced this pull request Aug 19, 2024
* Enable Ersilia to serve multiple models simultaneously (#1201)

* WIP Add session management utils

* Create a session at ersilia cli initialization

* Remove unused code

* start an ersilia session in a dedicated sessions dir that is mapped to the parent process' id which ran the given ersilia command, this will generally be a shell process inside a terminal, but it can also be a process from a bash script

* declare session specific defaults

* Run all ersilia commands within a single process during standard example run, otherwise ersilia run command does not find a served model bec of running in a different process and therefore in a different session

* Move the currently served model's pid to its dedicated session directory

* WIP Logging

* Redirect tmp logs to model's session logs

* catch permission error

* Redirect tmp logs to model's session logs

* don't use ersilia exception management because we don't exactly want the ersilia process to exit

* copy relevant files

* read from 3rd column, logging statements bash output file

* run_bash path edit, conda.sh current failed fix

* add new size methods, clean directory size method

* add additional logging of file types and count

* delete dead function

* fix run path

* uncomment testing

* fix bash output file opening (arg1)

* change var names for clarity and add debug prints

* addtional logging statements + updated read_csv method

* fixed updated_read_csv

* Delete comments and dead code

* clean up read_csv

* fix comparison method

* add prints

* model size calculation update

* delete comments, update state variables

* add time stamp

* add debugging print for thresholds

* update threshold debugging statements

* implement MRAE + Spearman's

* bash output file path log

* fix divide by 0 mrae calculation

* Update threshold

* bash script logging statements

* bold message debug

* generalize read_csv for different column numbers

* uncomment

* specify output

* include scipy dependecy in pyproject.toml

* delete dead function + comment

* delete unused var

* fairyfloss bckgrnd

* clarity code mrae calculation

* adjust control flow example method

* update metric calculations, delete comments

* Update comment wording

* remove prints and add log statements

* end test command statement

* fix log format + delete echo and prints

---------

Co-authored-by: Dhanshree Arora <DhanshreeA@users.noreply.github.com>
DhanshreeA added a commit that referenced this pull request Aug 20, 2024
* Enable Ersilia to serve multiple models simultaneously (#1201)

* WIP Add session management utils

* Create a session at ersilia cli initialization

* Remove unused code

* start an ersilia session in a dedicated sessions dir that is mapped to the parent process' id which ran the given ersilia command, this will generally be a shell process inside a terminal, but it can also be a process from a bash script

* declare session specific defaults

* Run all ersilia commands within a single process during standard example run, otherwise ersilia run command does not find a served model bec of running in a different process and therefore in a different session

* Move the currently served model's pid to its dedicated session directory

* WIP Logging

* Redirect tmp logs to model's session logs

* catch permission error

* Redirect tmp logs to model's session logs

* don't use ersilia exception management because we don't exactly want the ersilia process to exit

* Bump actions/upload-artifact from 4.3.3 to 4.3.4

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.3 to 4.3.4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@6546280...0b2256b)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Dhanshree Arora <DhanshreeA@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
DhanshreeA added a commit that referenced this pull request Aug 20, 2024
* Enable Ersilia to serve multiple models simultaneously (#1201)

* WIP Add session management utils

* Create a session at ersilia cli initialization

* Remove unused code

* start an ersilia session in a dedicated sessions dir that is mapped to the parent process' id which ran the given ersilia command, this will generally be a shell process inside a terminal, but it can also be a process from a bash script

* declare session specific defaults

* Run all ersilia commands within a single process during standard example run, otherwise ersilia run command does not find a served model bec of running in a different process and therefore in a different session

* Move the currently served model's pid to its dedicated session directory

* WIP Logging

* Redirect tmp logs to model's session logs

* catch permission error

* Redirect tmp logs to model's session logs

* don't use ersilia exception management because we don't exactly want the ersilia process to exit

* Bump GrantBirki/comment from 2.0.10 to 2.1.0

Bumps [GrantBirki/comment](https://github.com/grantbirki/comment) from 2.0.10 to 2.1.0.
- [Release notes](https://github.com/grantbirki/comment/releases)
- [Commits](GrantBirki/comment@1e63d57...f524ee3)

---
updated-dependencies:
- dependency-name: GrantBirki/comment
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Dhanshree Arora <DhanshreeA@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
DhanshreeA added a commit that referenced this pull request Aug 20, 2024
* Enable Ersilia to serve multiple models simultaneously (#1201)

* WIP Add session management utils

* Create a session at ersilia cli initialization

* Remove unused code

* start an ersilia session in a dedicated sessions dir that is mapped to the parent process' id which ran the given ersilia command, this will generally be a shell process inside a terminal, but it can also be a process from a bash script

* declare session specific defaults

* Run all ersilia commands within a single process during standard example run, otherwise ersilia run command does not find a served model bec of running in a different process and therefore in a different session

* Move the currently served model's pid to its dedicated session directory

* WIP Logging

* Redirect tmp logs to model's session logs

* catch permission error

* Redirect tmp logs to model's session logs

* don't use ersilia exception management because we don't exactly want the ersilia process to exit

* Bump actions/setup-python from 5.1.0 to 5.1.1

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.1.0 to 5.1.1.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@82c7e63...39cd149)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Dhanshree Arora <DhanshreeA@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
DhanshreeA added a commit that referenced this pull request Aug 29, 2024
* Enable Ersilia to serve multiple models simultaneously (#1201)

* WIP Add session management utils

* Create a session at ersilia cli initialization

* Remove unused code

* start an ersilia session in a dedicated sessions dir that is mapped to the parent process' id which ran the given ersilia command, this will generally be a shell process inside a terminal, but it can also be a process from a bash script

* declare session specific defaults

* Run all ersilia commands within a single process during standard example run, otherwise ersilia run command does not find a served model bec of running in a different process and therefore in a different session

* Move the currently served model's pid to its dedicated session directory

* WIP Logging

* Redirect tmp logs to model's session logs

* catch permission error

* Redirect tmp logs to model's session logs

* don't use ersilia exception management because we don't exactly want the ersilia process to exit

* copy relevant files

* read from 3rd column, logging statements bash output file

* run_bash path edit, conda.sh current failed fix

* add new size methods, clean directory size method

* add additional logging of file types and count

* delete dead function

* fix run path

* uncomment testing

* fix bash output file opening (arg1)

* change var names for clarity and add debug prints

* addtional logging statements + updated read_csv method

* fixed updated_read_csv

* Delete comments and dead code

* clean up read_csv

* fix comparison method

* add prints

* model size calculation update

* delete comments, update state variables

* add time stamp

* add debugging print for thresholds

* update threshold debugging statements

* implement MRAE + Spearman's

* bash output file path log

* fix divide by 0 mrae calculation

* Update threshold

* bash script logging statements

* bold message debug

* generalize read_csv for different column numbers

* uncomment

* specify output

* include scipy dependecy in pyproject.toml

* delete dead function + comment

* delete unused var

* fairyfloss bckgrnd

* clarity code mrae calculation

* adjust control flow example method

* update metric calculations, delete comments

* Update comment wording

* remove prints and add log statements

* end test command statement

* fix log format + delete echo and prints

* implement rmse + adjust logging/console messages

* Update logging and implement rmse

* testing

* rebase and comment

* remove duplicates and resolve merging

* comment

* console display

---------

Co-authored-by: Dhanshree Arora <DhanshreeA@users.noreply.github.com>
DhanshreeA added a commit that referenced this pull request Aug 29, 2024
* Enable Ersilia to serve multiple models simultaneously (#1201)

* WIP Add session management utils

* Create a session at ersilia cli initialization

* Remove unused code

* start an ersilia session in a dedicated sessions dir that is mapped to the parent process' id which ran the given ersilia command, this will generally be a shell process inside a terminal, but it can also be a process from a bash script

* declare session specific defaults

* Run all ersilia commands within a single process during standard example run, otherwise ersilia run command does not find a served model bec of running in a different process and therefore in a different session

* Move the currently served model's pid to its dedicated session directory

* WIP Logging

* Redirect tmp logs to model's session logs

* catch permission error

* Redirect tmp logs to model's session logs

* don't use ersilia exception management because we don't exactly want the ersilia process to exit

* copy relevant files

* read from 3rd column, logging statements bash output file

* run_bash path edit, conda.sh current failed fix

* add new size methods, clean directory size method

* add additional logging of file types and count

* delete dead function

* fix run path

* uncomment testing

* fix bash output file opening (arg1)

* change var names for clarity and add debug prints

* addtional logging statements + updated read_csv method

* fixed updated_read_csv

* Delete comments and dead code

* clean up read_csv

* fix comparison method

* add prints

* model size calculation update

* delete comments, update state variables

* add time stamp

* add debugging print for thresholds

* update threshold debugging statements

* implement MRAE + Spearman's

* bash output file path log

* fix divide by 0 mrae calculation

* Update threshold

* bash script logging statements

* bold message debug

* generalize read_csv for different column numbers

* uncomment

* specify output

* include scipy dependecy in pyproject.toml

* delete dead function + comment

* delete unused var

* fairyfloss bckgrnd

* clarity code mrae calculation

* adjust control flow example method

* update metric calculations, delete comments

* Update comment wording

* remove prints and add log statements

* end test command statement

* fix log format + delete echo and prints

* implement rmse + adjust logging/console messages

* Update logging and implement rmse

* testing

* rebase and comment

* remove duplicates and resolve merging

* comment

* console display

---------

Co-authored-by: Dhanshree Arora <DhanshreeA@users.noreply.github.com>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants