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

Serval App #132

Closed
johnml1135 opened this issue Sep 14, 2023 · 9 comments · Fixed by #192
Closed

Serval App #132

johnml1135 opened this issue Sep 14, 2023 · 9 comments · Fixed by #192
Assignees
Labels
enhancement New feature or request

Comments

@johnml1135
Copy link
Collaborator

Create a simple python application that can build NMT jobs and return pretranslations. This app may be extended to be a bit more, but will always be a prototype/sample app.

Functional Requirements for MVP:

  • Users receive a passcode from our team to be able to use the service
  • Users are given a fair amount of instruction as to what is going on
  • Users (without authentication beyond the passcode), enter:
    • An email address to send (1) confirmation of job started (2) an error if it errors out somehow and (3) the resultant translations
    • 2 paratext projects for training, one source and one target
    • 1 or 2 paratext projects for translating (source needed, target optional)
    • Language codes for the source and target languages
    • Press a button to start and then tell them to check their email

Other Requirements for MVP:

Challenges post MVP:

@johnml1135 johnml1135 added the enhancement New feature or request label Sep 14, 2023
@johnml1135 johnml1135 added this to the 1.2 Paratext Plugin MVP milestone Sep 14, 2023
@johnml1135 johnml1135 assigned isaac091 and Enkidu93 and unassigned isaac091 Sep 14, 2023
@Enkidu93
Copy link
Collaborator

This looks very doable and right up my alley. (I miss python 😛). I imagine this would be best started in a fresh repo (???).

@johnml1135
Copy link
Collaborator Author

@ddaspit - a subfolder in Serval? It could be it's own repo then if it had it's own CI, etc., it could work easier.

@ddaspit
Copy link
Contributor

ddaspit commented Sep 22, 2023

From a development perspective, the main benefit of using the Serval repo is that API changes and the corresponding changes to the web app could be made in the same PR. It would be easier to keep Serval and the web app in sync. If the web app is built on a different tech stack (Python, streamlit, etc.), it can be tricky combine the build systems. I usually separate codebases if they are built on different languages and tech stacks. Machine is split into 3 repos: Machine.NET, Machine.py, and Machine.js. What about deployment? @johnml1135, how would separate repos affect deployment? I assume that the Serval web app would be deployed in our Kubernetes cluster.

@johnml1135
Copy link
Collaborator Author

johnml1135 commented Sep 22, 2023

The biggest concern would be separating the CI with both - but it actually can be done: https://stackoverflow.com/questions/63822219/how-to-run-github-actions-workflow-only-if-the-pushed-files-are-in-a-specific-fo. Therefore, I recommend the mono-repo - add python to the serval repo.

We can use streamlit for hosting the app - it should be free, because we will be publicly hosting the app:
image

It appears that it can be auto-deployed from a GitHub repo: https://docs.streamlit.io/streamlit-community-cloud/deploy-your-app

@Enkidu93
Copy link
Collaborator

The biggest concern would be separating the CI with both - but it actually can be done: https://stackoverflow.com/questions/63822219/how-to-run-github-actions-workflow-only-if-the-pushed-files-are-in-a-specific-fo. Therefore, I recommend the mono-repo - add python to the serval repo.

We can use streamlit for hosting the app - it should be free, because we will be publicly hosting the app: image

It appears that it can be auto-deployed from a GitHub repo: https://docs.streamlit.io/streamlit-community-cloud/deploy-your-app

Sounds good 👍 . And yes, the CI shouldn't be an issue.

@ddaspit
Copy link
Contributor

ddaspit commented Sep 25, 2023

I'm fine with a monorepo approach.

@Enkidu93
Copy link
Collaborator

Enkidu93 commented Oct 4, 2023

@johnml1135 @ddaspit See here my initial work - an absolute MVP.

The UI:
image

It sends emails to the address associated with the build when the build starts, faults or is canceled, and when it is finished - at which point it attaches a text file with the pretranslations that looks something like the following:

...

source.txt:verse_001_001	The book of the birth of Jesus Christ , the son of David , the son of Abraham .
source.txt:verse_001_002	Abraham was the father of Isaac, Isaac the father of Jacob, and Jacob the father of Judas and his brothers.
source.txt:verse_001_003	Judah begat Pharaoh and Sarah in Tamar; and Pharaoh begat Shoram; and Shoram begat Ram;
source.txt:verse_001_004	and Miriam the father of Minadab, and Minadab the father of Nahason, and Nahason the father of Salmon,
source.txt:verse_001_005	and Salmon begot Boaz of Ahab; and Boaz begot David of Judah; and David begot Jesse;
source.txt:verse_001_006	And in the same year was born David the king .

...

I'm sure I'll be jumping ship for a bit to help push things out for this weekend, but if you have thoughts, let me know.

@johnml1135
Copy link
Collaborator Author

Great - is it hosted on streamlit yet?

@johnml1135
Copy link
Collaborator Author

Instead of the passcode, use Serval Auth0 creds - and hard-code the production URL and Auth0 Token URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

4 participants