Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
223 commits
Select commit Hold shift + click to select a range
189d256
Search across lang code too
linearcombination May 12, 2025
642d49c
Update search field placeholder to clarify
linearcombination May 12, 2025
4a4c5a2
Automatic code formatting
linearcombination May 12, 2025
6bf4701
Reuse LanguageSearch component to DRY up the code
linearcombination May 12, 2025
bad1602
Improve code for get_last_segment
linearcombination May 12, 2025
51b0cdc
Improved variable name
linearcombination May 12, 2025
0c6df1a
types wip
linearcombination May 16, 2025
7d07804
Remove use of lru_cache
linearcombination May 16, 2025
40f1266
Update doctest results
linearcombination May 17, 2025
de7adf5
Implement timed cache for batch_clone_git_repos
linearcombination May 17, 2025
8cc4032
Update project version
linearcombination May 17, 2025
73b7884
Use new license spec for project.toml
linearcombination May 17, 2025
4ced8e9
Use LanguageSearch UI component to keep things DRY
linearcombination May 17, 2025
49321b6
Show national and english language name on doc title page
linearcombination May 18, 2025
c592165
Remove superfluous phrase from generated doc title page
linearcombination May 18, 2025
2d82b13
reg resource type has name Regular
linearcombination May 18, 2025
609e8bb
Fix doctest
linearcombination May 18, 2025
ab9ec99
Add source comment
linearcombination May 18, 2025
668ada2
Remove source code comment
linearcombination May 18, 2025
15e6e6f
Fix spelling source code comment
linearcombination May 19, 2025
74c8031
Provide fix for erroneous verse markers of form 1.
linearcombination May 19, 2025
578bec9
Remove imported but unused components
linearcombination May 19, 2025
d7e6aea
Fix regex
linearcombination May 19, 2025
432f67d
Use async rather than .then chains & simplify logic
linearcombination May 19, 2025
e3c1679
Re-enable cache, but only for 30 minutes
linearcombination May 19, 2025
0760cc1
Merge pull request #261 from WycliffeAssociates/update-to-doc-and-ste…
PurpleGuitar May 20, 2025
ed200b5
Disable graphql cache
linearcombination May 20, 2025
ac62807
Merge pull request #262 from WycliffeAssociates/disable-graphql-cache
PurpleGuitar May 21, 2025
30c1de8
Change layout of passage page for PASSAGES app
linearcombination May 23, 2025
58bb6bc
Add missing __init__.py in module
linearcombination May 26, 2025
0706718
Only check USFM structure when necessary
linearcombination May 26, 2025
a24f9a8
Simplify frontend logic, improve UI, fix limit tw words bug
linearcombination May 26, 2025
e6917b6
Update project version
linearcombination May 26, 2025
2f37045
Update doctests
linearcombination May 26, 2025
f1b2c23
Merge pull request #263 from WycliffeAssociates/frontend-logic-simpli…
PurpleGuitar May 30, 2025
458e09c
Fix bible reference template bug
linearcombination Jun 14, 2025
ead7146
Use HTTP endpoint to invoke USFM parser
linearcombination Jun 14, 2025
1b667ba
Remove obselete code
linearcombination Jun 14, 2025
9f8aad4
Componentize svg icons and some UI logic
linearcombination Jun 14, 2025
60b6a4e
Automatic code formatting
linearcombination Jun 14, 2025
f20b1ba
Removal of commented out code
linearcombination Jun 14, 2025
8c2919b
Handle en_rg directory separately and specially
linearcombination Jun 14, 2025
bebc463
Small improvements to logic for clarity and small performance gain
linearcombination Jun 14, 2025
7ee4679
Add stet exhaustive verse list to passages app
linearcombination Jun 14, 2025
d959921
Add frontend test for add stet verses to passages
linearcombination Jun 16, 2025
75bf439
Make function run in Celery worker thread
linearcombination Jun 16, 2025
89cc65a
Remove obselete code
linearcombination Jun 16, 2025
17452d1
Avoid raising an exception
linearcombination Jun 16, 2025
cc9fbf6
Remove unneeded source code comment
linearcombination Jun 17, 2025
9b5007a
Add correction phase for book name
linearcombination Jun 17, 2025
73ac013
Remove obselete constant
linearcombination Jun 17, 2025
ca01082
Remove non-English rg resource requests from tests
linearcombination Jun 17, 2025
db309fb
Better loading message
linearcombination Jun 17, 2025
57c5e08
Minor whitespace formatting
linearcombination Jun 17, 2025
d9c953a
Add log message for document title(s)
linearcombination Jun 17, 2025
debda85
Ensure assets are in place after startup init
linearcombination Jun 17, 2025
4a3356d
Fix bug where en_rg_nt_survey.docx is accessed at old location
linearcombination Jun 17, 2025
d4eadac
Same as last commit in another location
linearcombination Jun 17, 2025
5d79b3e
Add helpful log message
linearcombination Jun 17, 2025
dd8996c
Remove a couple unnecessary source code comments
linearcombination Jun 17, 2025
86def34
Avoid use of magic string
linearcombination Jun 17, 2025
62f23c8
Put checkboxes for STET and NT RG passages below input fields
linearcombination Jun 17, 2025
0e6fdc1
Remove some unnecessary source code comments
linearcombination Jun 17, 2025
e9629d8
Put checkboxes flush left to other input fields
linearcombination Jun 18, 2025
9c10354
Remove unnecessary source code comments
linearcombination Jun 18, 2025
d189482
Minor automatic whitepace formatting
linearcombination Jun 18, 2025
8a13501
Remove unused import
linearcombination Jun 18, 2025
487919e
Remove unnecessary source code comments
linearcombination Jun 18, 2025
71da1eb
Add UX response for checkbox success
linearcombination Jun 18, 2025
473b5d8
Fix spelling on Reviewers'
linearcombination Jun 18, 2025
ba5cece
Push code down into component
linearcombination Jun 18, 2025
ae9aaba
Only show UX feedback for adding when clicked on
linearcombination Jun 18, 2025
376160d
Grey out text of checkbox label while request is serviced
linearcombination Jun 18, 2025
bfc03f7
Add a spinning loader before success is achieved
linearcombination Jun 18, 2025
4cdc321
Add check icon feedback for adding a single passage button
linearcombination Jun 18, 2025
e6e5fd6
Better check icon (svg)
linearcombination Jun 18, 2025
e8a96a8
Remove unused import
linearcombination Jun 18, 2025
acdc5c2
Merge pull request #266 from WycliffeAssociates/add-stet-exhaustive-v…
linearcombination Jun 19, 2025
7c13906
Add env var for dotnet API port
linearcombination Jun 23, 2025
da6cde7
Merge pull request #267 from WycliffeAssociates/add-env-var-for-dotne…
linearcombination Jun 24, 2025
f155a67
Refactor css to resolve (most) svelte css compiler warnings
linearcombination Jun 26, 2025
b8b26dd
Minor formatting
linearcombination Jun 26, 2025
8190eba
Small simplification
linearcombination Jun 26, 2025
74b664c
Fix compile error
linearcombination Jun 26, 2025
164f4bf
Wk add parser image (#268)
wkelly17 Jun 26, 2025
87f72c3
Merge pull request #269 from WycliffeAssociates/fix-svelte-css-compil…
linearcombination Jun 27, 2025
4e82b36
Add ability to download assets rather than clone
linearcombination Jun 27, 2025
3c9d3ba
Simplify function and make title cover all resources
linearcombination Jun 27, 2025
a7f214a
Remove unused package
linearcombination Jun 27, 2025
210eb1d
Update Makefile build rules for usfmparserapi docker service
linearcombination Jun 27, 2025
a8b4bee
Consistent use of regular functions over arrow functions
linearcombination Jun 30, 2025
07fa33f
Add ability to remove NT Survey passages or STET passages en masse
linearcombination Jun 30, 2025
76f71c8
Send user agent string with request
linearcombination Jun 30, 2025
8b39963
Modify add passage button look based on state
linearcombination Jul 1, 2025
dbee3bf
Get caching of downloaded zipped repos working
linearcombination Jul 2, 2025
b0bb01d
Send additional headers to try to bypass cloudflare limiting
linearcombination Jul 2, 2025
598484f
Check if zip file exists before deleting
linearcombination Jul 2, 2025
ffae940
Disable a frontend test
linearcombination Jul 3, 2025
8eefd32
Improved git clone command with headers
linearcombination Jul 7, 2025
d3d1dc5
Update requirements.txt via pip tools
linearcombination Jul 7, 2025
21c71d8
Switch back to git for asset acquisition
linearcombination Jul 8, 2025
655118b
Merge pull request #270 from WycliffeAssociates/download-or-clone
PurpleGuitar Jul 9, 2025
39e0d13
New STET input doc for Tok Pisin (tpi) language
linearcombination Jul 9, 2025
dc17497
Automatic update to later Python version for packages
linearcombination Jul 9, 2025
c3ba72b
Add STET translation strings for Tok Pisin (tpi)
linearcombination Jul 9, 2025
631530b
Add frontend test for STET Tok Pisin (tpi) input language
linearcombination Jul 9, 2025
9db72f6
Update a test name and allow prettier to autoformat
linearcombination Jul 9, 2025
2a77801
Update a few translated phrases for STET tpi
linearcombination Jul 10, 2025
fd1a8ea
Merge pull request #271 from WycliffeAssociates/bring_stet_tpi_online
PurpleGuitar Jul 10, 2025
de48a41
Accumulate then interpret parts of Document into whole
linearcombination Jul 10, 2025
4e87032
Remove unnecessary source code comments
linearcombination Jul 12, 2025
442b911
Fix ordering of books into canonical bible book order
linearcombination Jul 12, 2025
b4805e6
Better control over hr element insertion for docx
linearcombination Jul 12, 2025
09ade4d
Fix issue with docx book then lang assembly
linearcombination Jul 13, 2025
39300a4
Share a data structure
linearcombination Jul 14, 2025
8d7c7f8
Update source code comments
linearcombination Jul 14, 2025
49ff293
Remove unused imports
linearcombination Jul 14, 2025
ab93976
Allow user to choose section separators or not
linearcombination Jul 15, 2025
5086b7c
Add tests for use section visual separator option and book ordering
linearcombination Jul 15, 2025
926ec32
Automatic code formatting (prettier)
linearcombination Jul 15, 2025
58be37b
Remove use of Any type
linearcombination Jul 15, 2025
7683e77
Remove use of Json type
linearcombination Jul 15, 2025
0c73424
Code deduplication in service of easier unit testing
linearcombination Jul 15, 2025
d05661a
Merge pull request #272 from WycliffeAssociates/compose-docx-from-par…
PurpleGuitar Jul 16, 2025
938fd3c
Reuse common code
linearcombination Jul 17, 2025
df9bbef
Handle Burmese, my, irregularity
linearcombination Jul 17, 2025
23a1156
Remove unused import
linearcombination Jul 17, 2025
a19b7f3
Modify loading string
linearcombination Jul 17, 2025
1e74a51
Add timing for HTML to DOCX conversion to log output
linearcombination Jul 17, 2025
4774cf1
Remove commented out code
linearcombination Jul 22, 2025
3df93db
Improve source code comment
linearcombination Jul 22, 2025
42d505c
Refactor large function and fix issue
linearcombination Jul 22, 2025
b98237d
Refactor large function continued
linearcombination Jul 25, 2025
b75f824
Remove unneeded cmd
linearcombination Jul 25, 2025
cc79360
Update a few source code comments
linearcombination Jul 29, 2025
76f8cc7
Update doctests so that they all pass again
linearcombination Jul 29, 2025
8040bc0
Add PrinceXml as HTML to PDF converter choice for api & user
linearcombination Jul 29, 2025
ef834af
Remove unused constants
linearcombination Jul 31, 2025
f707be3
Handle validation error exception
linearcombination Jul 31, 2025
cd51792
Simplify batch_clone_git_repos function
linearcombination Jul 31, 2025
2525d5a
Update doctest result
linearcombination Jul 31, 2025
9762704
Make sure to declare variable for case of failure
linearcombination Jul 31, 2025
a718516
Gracefully handle case where data API returns null resource_type
linearcombination Jul 31, 2025
183e05e
Cache returns from our oft used but singular query to data API
linearcombination Jul 31, 2025
b15e61b
Small refactor
linearcombination Jul 31, 2025
1eb2d3b
Update source code comments
linearcombination Aug 5, 2025
2d2419e
Fix bug where multiple copies of a translation word could appear
linearcombination Aug 1, 2025
9c11e4d
Add test that ensures ordering of USFM content
linearcombination Aug 2, 2025
c2b3f88
Move shared constant to Settings
linearcombination Aug 4, 2025
fdf4d55
Move shared constant to Settings
linearcombination Aug 4, 2025
d2d71ac
Give the user a choice of 1 or 2 col layout for TN and TQ
linearcombination Aug 5, 2025
e2aa9cf
Rename function
linearcombination Aug 5, 2025
4cd041a
Update tests
linearcombination Aug 6, 2025
d7b90f7
Dynamic header in PDF document
linearcombination Aug 6, 2025
e5aa13d
Update lists of languages that need normalization of github repo URL
linearcombination Aug 6, 2025
3df801b
Move Switch UI component to lib directory
linearcombination Aug 7, 2025
f562fc0
Auto-whitespace-formatting via prettier
linearcombination Aug 8, 2025
3214092
Refactor complex function to be simpler to read
linearcombination Aug 8, 2025
71d43a3
Disable tests that rely on data that data API no longer provides
linearcombination Aug 8, 2025
4efccbf
Control indenting of TS/JS and Svelte with prettier
linearcombination Aug 8, 2025
3febd56
Fix frontend tests after UI update
linearcombination Aug 8, 2025
0a76f72
Remove old commented out code
linearcombination Aug 8, 2025
e8feba2
Handle exception that can rarely occur
linearcombination Aug 12, 2025
327a775
Handle rare case that was encountered transiently
linearcombination Aug 12, 2025
2dad217
Simplify large function by breaking it down
linearcombination Aug 12, 2025
da9753e
Move doctest tests to better location
linearcombination Aug 12, 2025
7096130
Add a couple source code comments
linearcombination Aug 12, 2025
8d5a43b
Handle fonts for more languages
linearcombination Aug 13, 2025
29615a1
Automatic white space formatting via prettier
linearcombination Aug 13, 2025
463be48
Do a better job of localizing book names
linearcombination Aug 15, 2025
53146c6
Update doctests
linearcombination Aug 15, 2025
e533bf3
Update list of languages and books with USFM defects
linearcombination Aug 15, 2025
465a00d
Remove unused import
linearcombination Aug 15, 2025
a59d03a
Automatically organize imports
linearcombination Aug 15, 2025
52e898c
Remove obselete source code comment
linearcombination Aug 15, 2025
ee88630
Add docstring
linearcombination Aug 15, 2025
d1078a1
Fix for search by lang_code in stet
linearcombination Aug 16, 2025
79a559a
Add another unit test for usfm fixes
linearcombination Aug 16, 2025
c6224d2
Comment out pytest marker for one test
linearcombination Aug 16, 2025
fca16ef
Remove some old commented out code
linearcombination Aug 18, 2025
81a23e7
Update list of language/book combos needing USFM fixing
linearcombination Aug 18, 2025
764b5dd
Add French STET input document
linearcombination Aug 18, 2025
34850bf
Update frontend tests and reformat to 2 spaces indentation
linearcombination Aug 19, 2025
8988bcb
Add test for burmese
linearcombination Aug 19, 2025
7998ee8
Merge pull request #273 from WycliffeAssociates/update-8-19-2025
PurpleGuitar Aug 26, 2025
c6853b8
Respond to changes made in data returned by data API
linearcombination Aug 27, 2025
0797c5f
Merge pull request #274 from WycliffeAssociates/fix-for-changes-in-re…
linearcombination Aug 27, 2025
fad1634
Updated French STET input doc from PO
linearcombination Aug 28, 2025
f742cc0
Correct Ephesians book name localization in DOC
linearcombination Aug 28, 2025
af928f3
Merge pull request #275 from WycliffeAssociates/updated-stet-fr-input…
linearcombination Aug 28, 2025
c11897b
Merge data API data with DOC only data
linearcombination Aug 28, 2025
9b6c99f
Merge pull request #276 from WycliffeAssociates/correctly-merge-data-…
linearcombination Aug 29, 2025
5ddaf28
Maintain user clicked language order...
linearcombination Sep 6, 2025
f048a33
Merge pull request #277 from WycliffeAssociates/maintain-language-cli…
PurpleGuitar Sep 8, 2025
02bc322
Small refactor to simplifiy
linearcombination Sep 9, 2025
02babaf
Rename function and local variable
linearcombination Sep 9, 2025
74ee7cc
Fix issue with missing space at beginning of verse span chunk
linearcombination Sep 9, 2025
b5a749b
Merge pull request #278 from WycliffeAssociates/fix-missing-space-bef…
PurpleGuitar Sep 9, 2025
2368434
Get rid of superfluous file
linearcombination Sep 18, 2025
68ae9c5
Better naming
linearcombination Sep 18, 2025
c829925
Referential transparency rather than globals
linearcombination Sep 18, 2025
803ac32
Fix visual bug with close button padding
linearcombination Sep 18, 2025
6bcf5bc
Name changes
linearcombination Sep 18, 2025
b9e1e28
Fix visual bug in fill color for svg
linearcombination Sep 18, 2025
97b001d
Fix visual UI bug - was showing wrong icon for state
linearcombination Sep 18, 2025
3382c9a
Sort passages by book, chapter, and verse
linearcombination Sep 18, 2025
468d1c8
Autoformatting via prettier
linearcombination Sep 18, 2025
8dae290
Remove unused imports
linearcombination Sep 18, 2025
05036a2
Refactor LanguageSearch component to simplify
linearcombination Sep 18, 2025
8af2ad1
Add OT RG docs and code to move it into place
linearcombination Sep 18, 2025
c7d836f
Update RG parser to handle NT and OT docs
linearcombination Sep 18, 2025
f7f0c6b
Add backend OT RG routes
linearcombination Sep 18, 2025
8d927e2
Add OT RG front end routes and UI
linearcombination Sep 18, 2025
0e824a5
Better test naming style
linearcombination Sep 18, 2025
820ebf9
Add a couple timeouts to aide e2e tests
linearcombination Sep 18, 2025
58aaef0
Autoformatting via prettier
linearcombination Sep 18, 2025
9e58d02
Add backend tests for OT RG endpoints
linearcombination Sep 20, 2025
c64037c
Rename variable
linearcombination Sep 20, 2025
fa00d10
Remove a log output statement
linearcombination Sep 20, 2025
00dcee9
Limit STET source languages in production to subset
linearcombination Sep 20, 2025
ea0aaf3
Remove test that is not needed anymore
linearcombination Sep 21, 2025
9f9f667
Change a conditional to a different style
linearcombination Sep 21, 2025
d30cce6
Add Swahili STET input doc and locale info
linearcombination Sep 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ SEND_EMAIL = false
# The port to pass to gunicorn via ./backend/gunicorn.conf.py
PORT=5005
# Control caching of resource assets to save on network traffic
ASSET_CACHING_ENABLED=false
ASSET_CACHING_ENABLED=true
# Caching window of time in which cloned or downloaded resource asset
# files on disk are considered fresh rather than reacqiring them. In hours.
ASSET_CACHING_PERIOD=168
# files on disk are considered fresh rather than reacqiring them. In minutes.
ASSET_CACHING_PERIOD=30

# Control whether GitPython package does git cloning or the git cli in
# a subpocess. git cli is more robust to errors and faster.
Expand Down Expand Up @@ -65,6 +65,11 @@ USE_LOCALIZED_BOOK_NAME=true
# in parsing.RESOURCES_WITH_USFM_DEFECTS.
CHECK_ALL_BOOKS_FOR_LANGUAGE=true

# When true the system will acquire git repos via download of its
# master.zip file. When false it will clone the repo. Both approaches
# are optimized maximally by taking advantage of curl and git options.
DOWNLOAD_ASSETS=false

# * http://localhost:3000 covers requests originating from the case
# where 'npm run dev' is invoked to run vite (to run svelte js frontend)
# outside Docker. This results in vite's development mode which runs on
Expand Down
60 changes: 55 additions & 5 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,31 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max

Build-USFMParser-Image:
name: Build USFMParser image
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: FranzDiebold/github-env-vars-action@v2
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Build USFMParser image
uses: docker/build-push-action@v3
with:
context: ./dotnet/USFMParserApi
cache-from: type=gha
cache-to: type=gha,mode=max

Test-API-Image:
name: Test API image
runs-on: ubuntu-24.04
needs: Build-API-Image
needs: [Build-API-Image, Build-USFMParser-Image]
steps:
- uses: actions/checkout@v3
- uses: FranzDiebold/github-env-vars-action@v2
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Build API image with buildx
- name: Build local API image with buildx
uses: docker/build-push-action@v3
with:
context: .
Expand All @@ -53,35 +68,54 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build local USFMParser image with buildx
uses: docker/build-push-action@v3
with:
context: ./dotnet/USFMParserApi
tags: wycliffeassociates/doc-usfmparser:local
load: true
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Test API image with docker-compose
run: |
docker compose -f docker-compose.yml -f docker-compose.api-test.yml up --exit-code-from test-runner

Test-Frontend-Image:
name: Test Frontend image
runs-on: ubuntu-24.04
needs: [Build-API-Image, Build-Frontend-Image]
needs: [Build-API-Image, Build-Frontend-Image, Build-USFMParser-Image]
steps:
- uses: actions/checkout@v3
- uses: FranzDiebold/github-env-vars-action@v2
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Build api image
- name: Build local api image
uses: docker/build-push-action@v3
with:
context: .
tags: wycliffeassociates/doc:local
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build frontend image
- name: Build local frontend image
uses: docker/build-push-action@v3
with:
context: ./frontend
tags: wycliffeassociates/doc-ui:local
load: true
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build local USFMParser image with buildx
uses: docker/build-push-action@v3
with:
context: ./dotnet/USFMParserApi
tags: wycliffeassociates/doc-usfmparser:local
load: true
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build frontend-tests image
uses: docker/build-push-action@v3
with:
Expand Down Expand Up @@ -120,6 +154,11 @@ jobs:
echo "DOC_UI_TAG_SHA=wycliffeassociates/doc-ui:$GITHUB_SHA" >> $GITHUB_ENV && \
echo "DOC_UI_TAG_BRANCH=wycliffeassociates/doc-ui:$CI_REF_NAME_SLUG" >> $GITHUB_ENV && \
echo "DOC_UI_TAG_LATEST=wycliffeassociates/doc-ui:latest" >> $GITHUB_ENV
- name: Set DOC USFM parser tags
run: |
echo "DOC_PARSER_TAG_SHA=wycliffeassociates/doc-usfmparser:$GITHUB_SHA" >> $GITHUB_ENV && \
echo "DOC_PARSER_TAG_BRANCH=wycliffeassociates/doc-usfmparser:$CI_REF_NAME_SLUG" >> $GITHUB_ENV && \
echo "DOC_PARSER_TAG_LATEST=wycliffeassociates/doc-usfmparser:latest" >> $GITHUB_ENV

- name: Set version inside UI
run: |
Expand Down Expand Up @@ -152,6 +191,17 @@ jobs:
PUBLIC_DOC_BUILD_TIMESTAMP_ARG=${{ env.PUBLIC_DOC_BUILD_TIMESTAMP }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and conditional push Parser image
uses: docker/build-push-action@v3
with:
context: ./dotnet/USFMParserApi
push: true
tags: |
${{ env.DOC_PARSER_TAG_SHA }}
${{ env.DOC_PARSER_TAG_BRANCH }}
${{ env.DOC_PARSER_TAG_LATEST }}
cache-from: type=gha
cache-to: type=gha,mode=max
Deploy-develop:
name: Develop deploy on successful develop build
needs: [Push-Images]
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ tests_output.log
/logs/
/build/
/DOC.egg-info/
/assets_download/
/dotnet/USFMParserApi/bin/
/dotnet/USFMParserApi/obj/
84 changes: 52 additions & 32 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,45 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libdeflate0 \
# For weasyprint
pango1.0-tools \
# For stet
# pandoc \
# For fc-cache
fontconfig
fontconfig \
# For princexml
fonts-khmeros \
fonts-lklug-sinhala \
fonts-tlwg-garuda-otf \
fonts-lohit-orya \
fonts-lohit-mlym \
fonts-lohit-knda \
fonts-lohit-telu \
fonts-lohit-taml \
fonts-lohit-gujr \
fonts-lohit-guru \
fonts-lohit-beng-bengali \
fonts-lohit-deva \
fonts-noto \
# fonts-noto-core \
# fonts-noto-unhinted \
fonts-noto-cjk \
fonts-dzongkha \
fonts-tibetan-machine \
fonts-baekmuk \
fonts-ipafont-mincho \
fonts-arphic-uming \
fonts-opensymbol \
fonts-liberation2 \
libaom3 \
libavif15 \
libgif7 \
libjpeg62-turbo \
liblcms2-2 \
libtiff6 \
libwebp7 \
libwebpdemux2 \
&& fc-cache -f -v

# Download and install the PrinceXML .deb file
RUN wget https://www.princexml.com/download/prince_16.1-1_debian12_amd64.deb \
&& dpkg -i prince_16.1-1_debian12_amd64.deb || apt-get install -fy

# Get and install needed fonts.
RUN cd /tmp \
Expand All @@ -50,37 +85,23 @@ RUN ebook-convert --version

WORKDIR /app

RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh \
&& chmod +x ./dotnet-install.sh

# Create a directory for .NET SDK
RUN mkdir -p /home/appuser/.dotnet

# Install .NET SDK to the created directory
RUN ./dotnet-install.sh --channel 8.0 --install-dir /usr/share/dotnet

COPY dotnet ./

# Set environment variables for .NET
ENV DOTNET_ROOT=/usr/share/dotnet
ENV PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1

# Install dependencies and build the .NET project
RUN cd USFMParserDriver && \
${DOTNET_ROOT}/dotnet restore && \
${DOTNET_ROOT}/dotnet build --configuration Release

# Make the output directory where resource asset files are cloned.
RUN mkdir -p assets_download
# Make the input directory where en_rg_nt_survey.docx is stored.
RUN mkdir -p en_rg
# Make the directory where intermediate document parts are saved.
RUN mkdir -p working_temp
# Make the output directory where generated HTML and PDFs are placed.
RUN mkdir -p document_output
# Make the directory where stet source documents are stored
RUN mkdir -p stet
# Make the directory where passage source documents are stored
RUN mkdir -p passages


COPY backend/stet/data/stet_*.docx stet/
COPY backend/passages/data/Spiritual_Terms_Evaluation_Exhaustive_Verse_List.txt passages/

COPY pyproject.toml .
COPY ./backend/requirements.txt .
Expand All @@ -101,17 +122,19 @@ COPY ./tests ./tests
COPY .env .
COPY template.docx .
COPY template_compact.docx .

# Next two lines are useful when the data (graphql) API are down so
# that we can still test
# COPY resources.json assets_download/resources.json
# RUN touch assets_download/resources.json

# We copy this into its final place using a FastAPI initialization hook. We
# can't do it in Dockerfile because of the volumes definition that we
# need which overshadows /app/assets_download directory. It is not yet
# available through the data API or at a reasonably sized clonable
# github repo.
# We copy these files into their final place using a FastAPI
# initialization hook. We can't do it in Dockerfile because of the
# volumes definition that we need which overshadows /app/assets_download
# directory and these files are not yet available through the data API
# or at a reasonably sized clonable github repo.
COPY en_rg_nt_survey.docx .
COPY en_ot_survey_rg* .

# Make sure Python can find the code to run
ENV PYTHONPATH=/app/backend:/app/tests
Expand All @@ -123,13 +146,10 @@ RUN mypy --strict --install-types --non-interactive backend/passages/**/*.py
RUN mypy --strict --install-types --non-interactive tests/**/*.py

# Change ownership of app specific directories to the non-root user
RUN chown -R appuser:appgroup /app /home/appuser/calibre-bin /usr/share/dotnet
RUN chown -R appuser:appgroup /app /home/appuser/calibre-bin

# Switch to the non-root user
USER appuser

# Expose necessary ports (if any)
EXPOSE 8000

# Command to run the application
CMD ["python", "backend/main.py"]
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,39 @@ install-cython: checkvenv
.PHONY: build
build: checkvenv down clean-mypyc-artifacts install-cython local-install-deps-dev local-install-deps-prod
export IMAGE_TAG=local && \
docker build --progress=plain -t wycliffeassociates/doc-usfmparser:$${IMAGE_TAG} ./dotnet/USFMParserApi && \
docker build --progress=plain -t wycliffeassociates/doc:$${IMAGE_TAG} . && \
docker build --progress=plain -t wycliffeassociates/doc-ui:$${IMAGE_TAG} ./frontend && \
docker build --progress=plain -t wycliffeassociates/doc-ui-tests:$${IMAGE_TAG} -f ./frontend/testsDockerfile ./frontend

.PHONY: build-no-pip-update
build-no-pip-update: checkvenv down clean-mypyc-artifacts
export IMAGE_TAG=local && \
docker build --progress=plain -t wycliffeassociates/doc-usfmparser:$${IMAGE_TAG} ./dotnet/USFMParserApi && \
docker build --progress=plain -t wycliffeassociates/doc:$${IMAGE_TAG} . && \
docker build --progress=plain -t wycliffeassociates/doc-ui:$${IMAGE_TAG} ./frontend && \
docker build --progress=plain -t wycliffeassociates/doc-ui-tests:$${IMAGE_TAG} -f ./frontend/testsDockerfile ./frontend

.PHONY: build-no-pip-update-run-tests
build-no-pip-update-run-tests: checkvenv down clean-mypyc-artifacts
export IMAGE_TAG=local && \
docker build --progress=plain -t wycliffeassociates/doc-usfmparser:$${IMAGE_TAG} ./dotnet/USFMParserApi && \
docker build --build-arg RUN_TESTS=true --progress=plain -t wycliffeassociates/doc:$${IMAGE_TAG} . && \
docker build --progress=plain -t wycliffeassociates/doc-ui:$${IMAGE_TAG} ./frontend && \
docker build --progress=plain -t wycliffeassociates/doc-ui-tests:$${IMAGE_TAG} -f ./frontend/testsDockerfile ./frontend

.PHONY: build-no-cache
build-no-cache: checkvenv down clean-mypyc-artifacts local-install-deps-prod
export IMAGE_TAG=local && \
docker build --progress=plain --no-cache --pull -t wycliffeassociates/doc-usfmparser:$${IMAGE_TAG} ./dotnet/USFMParserApi && \
docker build --progress=plain --no-cache --pull -t wycliffeassociates/doc:$${IMAGE_TAG} . && \
docker build --progress=plain --no-cache --pull -t wycliffeassociates/doc-ui:$${IMAGE_TAG} ./frontend && \
docker build --progress=plain --no-cache --pull -t wycliffeassociates/doc-ui-tests:$${IMAGE_TAG} -f ./frontend/testsDockerfile ./frontend

.PHONY: build-no-cache-no-pip-update
build-no-cache-no-pip-update: checkvenv down clean-mypyc-artifacts
export IMAGE_TAG=local && \
docker build --progress=plain --no-cache --pull -t wycliffeassociates/doc-usfmparser:$${IMAGE_TAG} ./dotnet/USFMParserApi && \
docker build --progress=plain --no-cache --pull -t wycliffeassociates/doc:$${IMAGE_TAG} . && \
docker build --progress=plain --no-cache --pull -t wycliffeassociates/doc-ui:$${IMAGE_TAG} ./frontend && \
docker build --progress=plain --no-cache --pull -t wycliffeassociates/doc-ui-tests:$${IMAGE_TAG} -f ./frontend/testsDockerfile ./frontend
Expand Down
10 changes: 8 additions & 2 deletions backend/doc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class Settings(BaseSettings):
(which have higher priority).
"""

# GITHUB_API_TOKEN: str = "FOO" # This might be used in a later version
DATA_API_URL: HttpUrl

USFM_RESOURCE_TYPES: Sequence[str] = [
Expand All @@ -42,6 +41,12 @@ class Settings(BaseSettings):
USE_LOCALIZED_BOOK_NAME: bool
CHECK_ALL_BOOKS_FOR_LANGUAGE: bool

BOOK_NAME_FMT_STR: str = "<h2 class='book-name' style='text-align: center;'>{}</h2>"
END_OF_CHAPTER_HTML: str = '<div class="end-of-chapter"></div>'
HR: str = "<hr/>"

DOWNLOAD_ASSETS: bool # If true then download assets, else clone assets

def logger(self, name: str) -> logging.Logger:
"""
Return a Logger for scope named by name, e.g., module, that can be
Expand All @@ -66,6 +71,7 @@ def api_test_url(self) -> str:

# Location where resource assets will be cloned.
RESOURCE_ASSETS_DIR: str = "assets_download"
EN_RG_DIR: str = "en_rg"

# Location where intermediate generated document parts are saved.
WORKING_DIR: str = "working_temp"
Expand All @@ -88,7 +94,7 @@ def api_test_url(self) -> str:
# Caching window of time in which asset
# files on disk are considered fresh rather than re-acquiring (in
# the case of resource asset files) or re-generating them (in the
# case of the final PDF). In hours.
# case of the final PDF). In minutes.
ASSET_CACHING_PERIOD: int

EMAIL_SEND_SUBJECT: str
Expand Down
Loading