cmu-delphi / delphi-epidata

An open API for epidemiological data.
https://cmu-delphi.github.io/delphi-epidata/
MIT License
100 stars 68 forks source link

Infra refactor: convert `acquisition` to an installable package #939

Open krivard opened 2 years ago

krivard commented 2 years ago

The current deployment system fakes a delphi.epidata.acquisition package by moving directories around. This results in a system that runs correctly, but which actively resists IDE helper utilities for import tracking and call-reference chasing, making it difficult for new developers to come onboard, and easy to make silly mistakes.

We should find a way to make acquisition a real package. This may also mean replacing github_deploy_repo as our primary deployment mechanism.

dshemetov commented 2 years ago

See this comment specifically for some more discussion. More or less worked around this with some IDE hooks by Rostyaslav #1004

dshemetov commented 2 years ago

Updated: July 2023

Some context on how repo paths get changed in Docker:


For reference, the Docker directory structure for the Python image looks like:

# pwd
/usr/src/app
# ls
delphi  repos  requirements.txt  setup.sh
# tree -L 2 delphi
delphi
├── epidata
│   ├── acquisition
│   ├── client
│   ├── ddl
│   └── server
├── flu_contest
│   ├── archefilter
│   ├── covid
│   ├── epicast
│   ├── forecasters
│   ├── hosp
│   ├── main
│   ├── uploads
│   └── utils
├── github_deploy_repo
│   ├── actions
│   ├── database.py
│   ├── ddl
│   ├── file_operations.py
│   ├── github_deploy_repo.py
│   └── web
├── nowcast
│   ├── experiments
│   ├── fusion
│   ├── nowcast_update.py
│   ├── obsolete
│   ├── sensors
│   └── util
├── operations
│   ├── adduser.py
│   ├── backup.py
│   ├── database_metrics
│   ├── disk_usage_checker.py
│   ├── emailer.py
│   ├── environment.py
│   ├── heart_monitor.py
│   ├── screenshots
│   ├── secrets.php
│   └── secrets.py
└── utils
    ├── epidate.py
    ├── epiweek.py
    ├── extractor.py
    ├── geo
    └── obsolete

30 directories, 15 files

# tree -L 3 repos
repos
└── delphi
    ├── delphi-epidata
    │   ├── Jenkinsfile
    │   ├── LICENSE
    │   ├── README.md
    │   ├── build.js
    │   ├── deploy.json
    │   ├── dev
    │   ├── devops
    │   ├── docs
    │   ├── integrations
    │   ├── labels
    │   ├── mypy.ini
    │   ├── package-lock.json
    │   ├── package.json
    │   ├── pyproject.toml
    │   ├── requirements.dev.txt
    │   ├── requirements.txt
    │   ├── scripts
    │   ├── tasks.py
    │   ├── testdata
    │   └── tests
    ├── flu-contest
    │   ├── LICENSE
    │   ├── README.md
    │   ├── deploy.json
    │   └── tests
    ├── github-deploy-repo
    │   ├── LICENSE
    │   ├── README.md
    │   ├── deploy.json
    │   └── tests
    ├── nowcast
    │   ├── LICENSE
    │   ├── README.md
    │   ├── deploy.json
    │   ├── doc
    │   └── tests
    ├── operations
    │   ├── LICENSE
    │   ├── README.md
    │   ├── deploy.json
    │   ├── dev
    │   ├── docs
    │   └── tests
    └── utils
        ├── LICENSE
        ├── README.md
        ├── deploy.json
        └── tests

23 directories, 27 files
dshemetov commented 2 years ago

@ryantibs' suggestion to rename delphi-epidata to epidata fits into this work.

melange396 commented 1 year ago

related: #1037 and potentially #1004