Skip to content

Commit d4cf420

Browse files
committed
Merge branch 'feature/share-cleanupgrade-2025' into mob/2025-03-05
2 parents b0e8bbd + 3b35af3 commit d4cf420

File tree

14 files changed

+113
-277
lines changed

14 files changed

+113
-277
lines changed

bin/share

Lines changed: 0 additions & 7 deletions
This file was deleted.

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ services:
218218

219219
indexer:
220220
image: quay.io/centerforopenscience/share:develop
221-
command: sharectl search daemon
221+
command: python manage.py shtrove_indexer_run
222222
depends_on:
223223
- postgres
224224
- rabbitmq

how-to/run-locally.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,15 @@ a shell running within SHARE's environment in docker:
4646
docker-compose run --rm --no-deps worker bash
4747
```
4848
this will open a bash prompt within a temporary `worker` container -- from here we can
49-
run commands within SHARE's environment, including django's `manage.py` and SHARE's own
50-
`sharectl` utility (defined in `share/bin/`)
49+
run commands within SHARE's environment, including django's `manage.py`
5150

5251
from within that worker shell, use django's `migrate` command to set up tables in postgres:
5352
```
5453
python manage.py migrate
5554
```
5655
...and use `sharectl` to set up indexes in elasticsearch:
5756
```
58-
sharectl search setup --initial
57+
python manage.py shtrove_search_setup --initial
5958
```
6059

6160
### 3. start 'em up
@@ -93,7 +92,7 @@ docker-compose up -d worker
9392
9493
### start a shell in a container
9594
there are several ways to open a shell with SHARE's environment (which has
96-
django's `manage.py` and SHARE's own `sharectl` utility, defined in `share/bin/`)
95+
django's `manage.py` and management commands defined in `management/commands/`
9796
9897
if `worker` is already up, can open a shell within that container:
9998
```

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ gevent==22.10.2 # MIT
2525
psycogreen==1.0.2 # BSD
2626

2727
# to be removed in future work:
28-
docopt==0.6.2 # MIT
2928
elasticsearch5==5.5.6 # Apache 2.0
3029
PyJWE==1.0.0 # Apache 2.0
3130

setup.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
'share.harvesters'
1111
],
1212
entry_points={
13-
'console_scripts': [
14-
'sharectl = share.bin.__main__:main',
15-
],
1613
'share.transformers': [
1714
'ca.lwbin = share.transformers.ca_lwbin:LWBINTransformer',
1815
'com.biomedcentral = share.transformers.com_biomedcentral:BioMedCentralTransformer',

share/bin/__init__.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

share/bin/__main__.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

share/bin/search.py

Lines changed: 0 additions & 68 deletions
This file was deleted.

share/bin/util.py

Lines changed: 0 additions & 85 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from django.core.management.base import BaseCommand
2+
from share.search.daemon import IndexerDaemonControl
3+
from project.celery import app as celery_app
4+
5+
6+
class Command(BaseCommand):
7+
help = "Start the search indexing daemon"
8+
9+
def handle(self, *args, **options):
10+
daemon_control = IndexerDaemonControl(celery_app)
11+
daemon_control.start_all_daemonthreads()
12+
try:
13+
daemon_control.stop_event.wait()
14+
except KeyboardInterrupt:
15+
pass
16+
finally:
17+
daemon_control.stop_daemonthreads(wait=True)

0 commit comments

Comments
 (0)