Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 14 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ COPY control_server.py /opt/control_server.py
COPY site_runner.py /opt/site_runner.py
RUN chmod +x /opt/websyn_start.sh

EXPOSE 8101 40000-40014
EXPOSE 8101 40000-40015

# Generate OSU seed database at image build time so instance_seed/ is ready.
RUN cd /opt/WebSyn/osu && python3 -c "
from app import app, db
from seed_data import seed
with app.app_context():
db.create_all()
seed()
import shutil, os
os.makedirs('instance_seed', exist_ok=True)
shutil.copy2('instance/osu.db', 'instance_seed/osu.db')
print('OSU seed DB generated.')
"

CMD ["/opt/websyn_start.sh"]
2 changes: 1 addition & 1 deletion control_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'allrecipes', 'amazon', 'apple', 'arxiv', 'bbc_news', 'booking',
'github', 'google_flights', 'google_map', 'google_search',
'huggingface', 'wolfram_alpha', 'cambridge_dictionary',
'coursera', 'espn',
'coursera', 'espn', 'osu',
]
BASE_PORT = 40000
WEBSYN_DIR = '/opt/WebSyn'
Expand Down
17 changes: 17 additions & 0 deletions sites/osu/_health.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""Health check module for OSU mirror site."""


def health_check(app, db, College, Program):
"""Return health status dict."""
try:
with app.app_context():
college_count = College.query.count()
program_count = Program.query.count()
return {
'ok': True,
'site': 'osu',
'colleges': college_count,
'programs': program_count,
}
except Exception as e:
return {'ok': False, 'error': str(e)}
Loading