-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add runner, update model logic and API endpoints
- runner - python script to poll backend for jobs, download a job, run analysis, upload results - packaged as a miniconda docker image - docker-compose.yml to run multiple replicas of the image - backend - remove no longer needed api endpoints and logic - update logic of remaining endpoints - add new admin endpoints - `/api/admin/enable_user` - `/api/admin/disable_user` - add new runner endpoints - `/api/runner/request_job` - `/api/runner/input_file` - `/api/runner/result` - frontend - update text and fields - remove old sample options, add new ones - admins can enable/disable users
- Loading branch information
Showing
43 changed files
with
2,817 additions
and
7,682 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
__version__ = "0.0.1" | ||
|
||
from predicTCR_server.app import create_app | ||
|
||
__version__ = "0.0.1" | ||
|
||
__all__ = [create_app] |
This file contains 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 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,24 @@ | ||
from __future__ import annotations | ||
|
||
import smtplib | ||
from email.message import EmailMessage | ||
from predicTCR_server.settings import predicTCR_url | ||
|
||
|
||
def _wrap_email_message(email: str, message: str) -> str: | ||
return f"Dear {email},\n\n{message}\n\nBest wishes,\n\npredicTCR Team.\nhttps://{predicTCR_url}" | ||
|
||
|
||
def _send_email_message(email_message: EmailMessage) -> None: | ||
postfix_server_address = "email:587" | ||
with smtplib.SMTP(postfix_server_address) as s: | ||
s.send_message(email_message) | ||
|
||
|
||
def send_email(email: str, subject: str, message: str) -> None: | ||
msg = EmailMessage() | ||
msg["From"] = f"no-reply@{predicTCR_url}" | ||
msg["To"] = email | ||
msg.set_content(_wrap_email_message(email, message)) | ||
msg["Subject"] = subject | ||
_send_email_message(msg) |
Oops, something went wrong.