-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feature/browser db #29
Changes from 23 commits
c38a13b
ca7f4df
5542972
a525a1d
3f0e307
c908ad8
aaf6fec
0801e99
4e625e8
91ca4df
6a321eb
9e57fee
1406a15
a0877cf
25683e0
9124bf3
fe176f1
59ae366
f7cdf42
f16cff5
d1a0167
fd4767b
94a5966
546aecd
98d03ce
a8bf2b8
4efba42
037633c
de3c815
18519c0
5554c85
9246c61
f6babea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
authorized_keys | ||
__pycache__/ | ||
.python-version | ||
.pdm.toml | ||
.pdm-python | ||
.pdm.lock |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,17 @@ | ||||||||
FROM python:3.7 | ||||||||
|
||||||||
RUN apt-get update \ | ||||||||
&& apt-get install -y --no-install-recommends libcairo2-dev libgtk-3-bin libgtk-3-dev libglib2.0-dev libgtksourceview-3.0-dev libgirepository1.0-dev gir1.2-webkit2-4.0 pkg-config cmake \ | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
&& pip3 install -U setuptools \ | ||||||||
&& pip3 install browse-ocrd | ||||||||
|
||||||||
ENV GDK_BACKEND broadway | ||||||||
ENV BROADWAY_DISPLAY :5 | ||||||||
|
||||||||
EXPOSE 8085 | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
||||||||
COPY init.sh /init.sh | ||||||||
|
||||||||
RUN chmod +x /init.sh | ||||||||
|
||||||||
CMD ["/init.sh"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -x | ||
nohup broadwayd :5 & | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why Probably not relevant though, because when browse-ocrd and thus init.sh exits, the whole container should stop as well. (In contrast, in the subprocess mode, we explicitly |
||
browse-ocrd /data/mets.xml | ||
bertsky marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -15,6 +15,7 @@ services: | |||||||
environment: | ||||||||
MONITOR_PORT_LOG: ${MONITOR_PORT_LOG} | ||||||||
CONTROLLER: "${CONTROLLER_HOST}:${CONTROLLER_PORT_SSH}" | ||||||||
DB_CONNECTION: "mongodb://${DB_ROOT_USER:-root}:${DB_ROOT_PASSWORD:-root_password}@ocrd-database:27017" | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't want to be picky, but we already use |
||||||||
|
||||||||
ports: | ||||||||
- ${MONITOR_PORT_WEB}:5000 | ||||||||
|
@@ -37,5 +38,29 @@ services: | |||||||
# DOZZLE_USERNAME= | ||||||||
# DOZZLE_PASSWORD= | ||||||||
|
||||||||
ocrd-database: | ||||||||
image: "mongo:latest" | ||||||||
container_name: ocrd-database | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the fixed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For me it does work without There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wait. I do get an occasional failure to start mongo-express now ( |
||||||||
|
||||||||
environment: | ||||||||
MONGO_INITDB_ROOT_USERNAME: ${DB_ROOT_USER:-root} | ||||||||
MONGO_INITDB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-root_password} | ||||||||
|
||||||||
volumes: | ||||||||
- db-volume:/data/db | ||||||||
|
||||||||
|
||||||||
mongo-express: | ||||||||
image: mongo-express:latest | ||||||||
depends_on: | ||||||||
- ocrd-database | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see afdc359 |
||||||||
ports: | ||||||||
- 8081:8081 | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't the external port be controlled by an environment variable (which can be set via .env, esp. in the superrepository)? Or is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see f5db85d There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Native port 8081 is occupied on my server. Perhaps we should make this configurable as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see f5db85d |
||||||||
environment: | ||||||||
ME_CONFIG_MONGODB_ADMINUSERNAME: ${DB_ROOT_USER:-root} | ||||||||
ME_CONFIG_MONGODB_ADMINPASSWORD: ${DB_ROOT_PASSWORD:-root_password} | ||||||||
ME_CONFIG_MONGODB_SERVER: ocrd-database | ||||||||
|
||||||||
volumes: | ||||||||
db-volume: | ||||||||
shared: |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -20,6 +20,7 @@ fi | |||||
export OCRD_BROWSER__MODE=native | ||||||
export OCRD_BROWSER__WORKSPACE_DIR=/data | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does seem to work:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see cb5e065 |
||||||
export OCRD_BROWSER__PORT_RANGE="[9000,9100]" | ||||||
export OCRD_BROWSER__DB_CONNECTION_STRING=$DB_CONNECTION | ||||||
export OCRD_LOGVIEW__PORT=$MONITOR_PORT_LOG | ||||||
export OCRD_CONTROLLER__JOB_DIR=/run/lock/ocrd.jobs | ||||||
export OCRD_CONTROLLER__HOST=$CONTROLLER_HOST | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should advertise this in
make help
and readme?Also, shouldn't we make this a dependency formake test
straight away? (If the image already exists and nothing in the build context changed, then the build cache will skip rebuild.)EDIT: does not make sense – pytest under docker run precludes docker mode. So conversely, we need this as a dependency when running tests without
make test
(i.e. via native nox or pytest directly)...