Skip to content

Commit

Permalink
We've got some issues with our GHA/space try and start cleaning it up…
Browse files Browse the repository at this point in the history
… a bit.

Sort reqs file

Start seperating out some parts we only need in prod (given space constraints in GHA)

More minor cleanup magic

Don't auto extract long fax numbers.

Fix type issue

Bump version

Fix pip installs

Fix p2

Drop npm caching

Force clean
  • Loading branch information
holdenk committed Nov 8, 2024
1 parent 695e899 commit f45bcc0
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 55 deletions.
34 changes: 5 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,9 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3

- name: Cache NPM dependencies
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.OS }}-npm-cache
restore-keys: |
${{ runner.OS }}-npm-cache-
- name: Check npm build
run:
cd fighthealthinsurance/static/js; npm i; npm run build
cd fighthealthinsurance/static/js && npm i && npm run build && npm cache clean --force


tests-sync:
Expand All @@ -91,7 +83,7 @@ jobs:
uses: actions/setup-node@v3

- name: Install system level packages
run: sudo apt-get update && sudo apt-get install -y tesseract-ocr texlive
run: sudo apt-get update && sudo apt-get install -y tesseract-ocr texlive && sudo apt-get clean

- name: Install dependencies
run: pip install tox tox-gh-actions
Expand All @@ -101,17 +93,9 @@ jobs:
with:
version: 2.19

- name: Cache NPM dependencies
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.OS }}-npm-cache
restore-keys: |
${{ runner.OS }}-npm-cache-
- name: Build npm js (needed for the e2e tests in django)
run:
cd fighthealthinsurance/static/js; npm i; npm run build
cd fighthealthinsurance/static/js && npm i && npm run build && npm cache clean --force

- name: Cache Tox
id: tox
Expand Down Expand Up @@ -147,7 +131,7 @@ jobs:
uses: actions/setup-node@v3

- name: Install system level packages
run: sudo apt-get update && sudo apt-get install -y tesseract-ocr texlive
run: sudo apt-get update && sudo apt-get install -y tesseract-ocr texlive && sudo apt-get clean

- name: Install dependencies
run: pip install tox tox-gh-actions
Expand All @@ -164,17 +148,9 @@ jobs:
path: .tox
key: ${{ runner.os }}-${{ matrix.python }}-${{ matrix.django }}-tox-${{ hashFiles('tox.ini') }}-${{ hashFiles('requirements.txt') }}

- name: Cache NPM dependencies
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.OS }}-npm-cache
restore-keys: |
${{ runner.OS }}-npm-cache-
- name: Build npm js (needed for the e2e tests in django)
run:
cd fighthealthinsurance/static/js; npm i; npm run build
cd fighthealthinsurance/static/js && npm i && npm run build && npm cache clean --force

- name: Run tests
run: tox -e py${{ matrix.python }}-django${{ matrix.django }}-async
Expand Down
4 changes: 2 additions & 2 deletions CombinedDockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ RUN mkdir -p /etc/hylafax
COPY hylafax-settings/* /etc/hylafax

# Installed seperately because only used in prod
RUN pip install mysqlclient
COPY requirements.txt ./
COPY *requirements.txt ./
RUN $HOME/anaconda3/bin/pip install --upgrade pip
RUN $HOME/anaconda3/bin/pip install -r requirements.txt
RUN $HOME/anaconda3/bin/pip install -r deploy-requirements.txt
RUN mkdir -p ./fhi
COPY fighthealthinsurance ./fhi/fighthealthinsurance
COPY setup.py ./fhi/setup.py
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ RUN apt-get update && apt-get upgrade -y && apt-get install nginx vim emacs libm
COPY /conf/nginx.default /etc/nginx/sites-available/default
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
# install mysqlclient seperately because it's only in prod not dev.
RUN pip install mysqlclient

# copy source and install dependencies
RUN mkdir -p /opt/fighthealthinsurance
RUN chown -R www-data:www-data /opt/fighthealthinsurance
# We hope requirements has not changed so we can use the cache
COPY requirements.txt /opt/fighthealthinsurance/
COPY *requirements.txt /opt/fighthealthinsurance/
RUN pip install --upgrade pip && pip install -r /opt/fighthealthinsurance/requirements.txt
# install mysqlclient seperately because it's only in prod not dev.
RUN pip install -r /opt/fighthealthinsurance/deploy-requirements.txt
RUN mkdir -p /external_data
# We copy static early ish since it could also be cached nicely
ADD --chown=www-data:www-data static /opt/fighthealthinsurance/static
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mypy -p fighthealthinsurance
./manage.py collectstatic --no-input

pushd ./static/js; npm i; npm run build; popd
FHI_VERSION=v0.8.6d
FHI_VERSION=v0.8.7a
export FHI_VERSION
# Build ray cluster first so that the cluster can come up before the job that registers the workers
source build_ray.sh
Expand Down
4 changes: 2 additions & 2 deletions cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
spec:
affinity: {}
containers:
- image: holdenk/fhi-ray:v0.8.6d
- image: holdenk/fhi-ray:v0.8.7a
env:
- name: RAY_gcs_server_request_timeout_seconds
value: "20"
Expand Down Expand Up @@ -66,7 +66,7 @@ spec:
app.kubernetes.io/instance: raycluster
spec:
containers:
- image: holdenk/fhi-ray:v0.8.6d
- image: holdenk/fhi-ray:v0.8.7a
env:
- name: RAY_gcs_server_request_timeout_seconds
value: "20"
Expand Down
3 changes: 3 additions & 0 deletions deploy-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
py-spy
gunicorn
mysqlclient
4 changes: 2 additions & 2 deletions deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
special: web-primary-pod
spec:
containers:
- image: holdenk/fight-health-insurance:v0.8.6d
- image: holdenk/fight-health-insurance:v0.8.7a
name: totallylegitco
env:
- name: PRIMARY
Expand Down Expand Up @@ -64,7 +64,7 @@ spec:
matchLabels:
app: fight-health-insurance
containers:
- image: holdenk/fight-health-insurance:v0.8.6d
- image: holdenk/fight-health-insurance:v0.8.7a
name: totallylegitco
envFrom:
- secretRef:
Expand Down
5 changes: 3 additions & 2 deletions fighthealthinsurance/common_view_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,9 @@ def create_denial(
appeal_fax_number = appealGenerator.get_fax_number(
denial_text=denial_text, use_external=use_external_models
)
if appeal_fax_number not in denial_text:
appeal_fax_number = None
if appeal_fax_number is not None:
if appeal_fax_number not in denial_text or len(appeal_fax_number) > 30:
appeal_fax_number = None
except:
pass

Expand Down
2 changes: 1 addition & 1 deletion fighthealthinsurance/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h1>Fight Health Insurance</h1>
<br>
We'll help you write an appeal to fight your health insurance denial. While an appeal is not always the first step in the health insurance appeal process we'll guide you through the options to fight back against health insurance denials. Almost all health plans are required to offer internal and external appeals and while they often make it confusing, we can help.
<br>
<a href="{% url 'pro_version' %}">If you're a <b>health care professional</b>, signup for updates on our pro-version</a><br>
<a href="{% url 'pro_version' %}">If you're a <b>health care professional</b> (or related), signup for updates on our pro-version</a><br>
<a href="{% url 'pro_version' %}" class="section-btn btn btn-default smoothScroll" id="scanlink">
Professionals Click Here
</a>
Expand Down
20 changes: 7 additions & 13 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ django-extensions
django-filer
django-filter
django-memoize
django-minio-storage
django-pipeline
django-recaptcha==4.0.0
django-regex-field
Expand All @@ -19,17 +20,16 @@ django-stubs
django-treebeard
django_user_agents
easy_thumbnails
easy_thumbnails
flake8-django
geopy
git+https://github.com/holdenk/static-thumbnails.git
git+https://github.com/jazzband/django-cookie-consent.git#egg=django-cookie-consent
gunicorn
icd10-cm
metapub==0.5.12
mypy
mypy
packaging>=20.0
pandoc
paramiko
Pillow
pyarrow
pymupdf
Expand All @@ -40,24 +40,18 @@ python-Levenshtein
pytz
pyyaml
RapidFuzz==2.15.1 # See https://github.com/mindee/doctr/issues/1186
ray==2.38.0
ray[client]==2.38.0
requests
setuptools
sorl-thumbnail
sqlalchemy_mate==2.0.0.0 # uszipcode issue see https://github.com/MacHu-GWU/uszipcode-project/issues/79
stripe
stopit
stripe==5.5.0
totallylegit-django-rest-framework-braces # forked from django-rest-framework-braces
types-paramiko
types-requests
typing-extensions
urllib3
uszipcode
werkzeug
django-minio-storage
stopit
telnyx
pandoc
ray==2.38.0
ray[client]==2.38.0
paramiko
types-paramiko
py-spy

0 comments on commit f45bcc0

Please sign in to comment.