Skip to content

Commit

Permalink
Merge pull request #958 from hdoupe/archive-tb
Browse files Browse the repository at this point in the history
Archive Tax-Brain webapp
  • Loading branch information
hdoupe authored Jun 14, 2019
2 parents 1a917b2 + 8ab2780 commit 5edffcd
Show file tree
Hide file tree
Showing 18 changed files with 502 additions and 119 deletions.
18 changes: 15 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,27 @@ FROM heroku/miniconda:3

# Grab requirements.txt.
ADD ./requirements.txt /requirements.txt
ADD ./conda-requirements.txt /conda-requirements.txt

# python version
RUN python --version

# Install dependencies
RUN conda update conda
RUN conda install -c pslmodels -c anaconda --file conda-requirements.txt --yes
RUN pip install -qr requirements.txt
# Pin significant conda packages to version from 1.7.7 release.
RUN conda install --yes \
"numpy==1.14.2" \
"pandas==0.23.4" \
"bokeh==1.0.2" \
"numba==0.41.0" \
"scipy==1.1.0" \
"pyparsing==2.3.0" \
"matplotlib==3.0.1" \
"pillow==5.3.0"
COPY distributed/taxcalc-0.24.0-py36_0.tar.bz2 /home/taxcalc-0.24.0-py36_0.tar.bz2
COPY distributed/btax-0.2.8-py36_0.tar.bz2 /home/btax-0.2.8-py36_0.tar.bz2
RUN conda install --yes /home/taxcalc-0.24.0-py36_0.tar.bz2
RUN conda install --yes /home/btax-0.2.8-py36_0.tar.bz2
RUN pip install -r requirements.txt

# Add our code
ADD ./webapp /opt/webapp/
Expand Down
24 changes: 21 additions & 3 deletions distributed/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,21 @@ RUN conda update conda
RUN conda config --add channels pslmodels
RUN conda config --append channels conda-forge

RUN conda install python=3.6 numpy>=1.12.1 pandas>=0.23.0 taxcalc=0.24.0 \
btax=0.2.8 matplotlib>=3.0.1 numba six bokeh>=0.12.7 mock xlrd \
sphinx nomkl
# RUN conda install -c ospc -c anaconda --file conda-requirements.txt --yes
RUN conda install --yes \
"numpy==1.14.2" \
"pandas==0.23.4" \
"bokeh==1.0.2" \
"numba==0.41.0" \
"scipy==1.1.0" \
"pyparsing==2.3.0" \
"matplotlib==3.0.1" \
"pillow==5.3.0"
COPY taxcalc-0.24.0-py36_0.tar.bz2 /home/taxcalc-0.24.0-py36_0.tar.bz2
COPY btax-0.2.8-py36_0.tar.bz2 /home/btax-0.2.8-py36_0.tar.bz2
RUN ls /
RUN conda install --yes /home/taxcalc-0.24.0-py36_0.tar.bz2
RUN conda install --yes /home/btax-0.2.8-py36_0.tar.bz2

RUN pip install -r requirements.txt

Expand All @@ -31,3 +43,9 @@ RUN if [ -z ${PUF_TOKEN+x} ]; \
write-latest-taxpuf && \
gunzip -k puf.csv.gz; \
fi

WORKDIR /home/distributed

RUN pip install -r requirements.txt

WORKDIR /home/distributed/api
87 changes: 0 additions & 87 deletions distributed/api/run_ogusa.py

This file was deleted.

Binary file added distributed/btax-0.2.8-py36_0.tar.bz2
Binary file not shown.
4 changes: 2 additions & 2 deletions distributed/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
version: '3'
services:
flask:
image: "${REPO}/flask:${TAG}"
image: "flask:${TAG}"
ports:
- 5050:5050
depends_on:
- redis
- celery
celery:
image: "${REPO}/celery:${TAG}"
image: "celery:${TAG}"
depends_on:
- redis
redis:
Expand Down
Binary file added distributed/taxcalc-0.24.0-py36_0.tar.bz2
Binary file not shown.
2 changes: 1 addition & 1 deletion python_env_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ conda create -n pb_env python=3.6 --yes
echo 'successfully created env: pb_env'

echo 'activating env: pb_env'
source activate pb_env
conda activate pb_env

echo 'installing conda packages'
conda install -c pslmodels -c defaults --file conda-requirements.txt --yes
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ Django==1.9
argparse==1.2.1
dj-database-url==0.3.0
dj-static==0.0.6
django-toolbelt==0.0.1
waitress
static3==0.5.1
-e git+https://github.com/funkybob/django-flatblocks.git#egg=django-flatblocks
sendgrid-django
psycopg2>=2.5.4
django-user-accounts
django-uuidfield==0.5.0
newrelic
Expand All @@ -29,3 +27,4 @@ toolz
whitenoise
msgpack
psycopg2-binary
gunicorn
31 changes: 30 additions & 1 deletion templates/dynamic/behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ <h2>Tax-Calculator Code Build</h2>
</ul>
<div class="sidebar-button">
<a href="#" ></a>
<input id="tax-submit" class="btn btn-secondary btn-block btn-animate" type="submit" value="Start Dynamic Simulation!">
<a class="btn btn-secondary btn-block btn-animate" disabled>Start Dynamic Simulation</a>
</div>
</div> <!-- sidebar -->
</div>
Expand Down Expand Up @@ -178,4 +178,33 @@ <h1>Partial Equilibrium Simulation</h1>
</form> <!-- form -->
<div class="push"></div>
</div> <!-- /wrapper -->
<div class="modal fade" id="redirect-modal" tabindex="-1" role="dialog" aria-labelledby="redirect-modal-label">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="redirect-modal-label">Your sim is now archived.</h4>
</div>
<div class="modal-body">
<p>You may view results and inputs but not edit parameters or re-run the simulation.</p>
<p>The Tax-Brain webapp is now hosted at <a href="https://compmodels.org/PSLmodels/Tax-Brain/">compmodels.org/PSLmodels/Tax-Brain/</a></p>
</div>
<div class="modal-footer">
<a type="button" class="btn btn-default" data-dismiss="modal">Close</a>
</div>
</div>
</div>
</div>

{% endblock %}

{% block bottom_scripts %}
<script>
$(document).ready(function() {
$("#redirect-modal").modal("show");
$("input.form-control").each(function() {
$(this).attr("disabled", true);
});
})
</script>
{% endblock %}
32 changes: 31 additions & 1 deletion templates/dynamic/elasticity.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ <h2>Tax-Calculator Code Build</h2>
</ul>
<div class="sidebar-button">
<a href="#" ></a>
<input id="tax-submit" class="btn btn-secondary btn-block btn-animate" type="submit" value="Start Dynamic Simulation!">
<a class="btn btn-secondary btn-block btn-animate" disabled>Start Dynamic Simulation</a>
</div>
</div> <!-- sidebar -->
</div>
Expand Down Expand Up @@ -173,4 +173,34 @@ <h1>Macroeconomic Elasticity Simulation</h1>
</form> <!-- form -->
<div class="push"></div>
</div> <!-- /wrapper -->
<div class="modal fade" id="redirect-modal" tabindex="-1" role="dialog" aria-labelledby="redirect-modal-label">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="redirect-modal-label">Your sim is now archived.</h4>
</div>
<div class="modal-body">
<p>You may view results and inputs but not edit parameters or re-run the simulation.</p>
<p>The Tax-Brain webapp is now hosted at <a href="https://compmodels.org/PSLmodels/Tax-Brain/">compmodels.org/PSLmodels/Tax-Brain/</a></p>
</div>
<div class="modal-footer">
<a type="button" class="btn btn-default" data-dismiss="modal">Close</a>
</div>
</div>
</div>
</div>


{% endblock %}

{% block bottom_scripts %}
<script>
$(document).ready(function() {
$("#redirect-modal").modal("show");
$("input.form-control").each(function() {
$(this).attr("disabled", true);
});
})
</script>
{% endblock %}
24 changes: 24 additions & 0 deletions templates/dynamic/elasticity_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,31 @@ <h1>Elasticity Results</h1>
}
</script>
<div class="push"></div>
<div class="modal fade" id="redirect-modal" tabindex="-1" role="dialog" aria-labelledby="redirect-modal-label">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="redirect-modal-label">Your sim is now archived.</h4>
</div>
<div class="modal-body">
<p>You may view results and inputs but not edit parameters or re-run the simulation.</p>
<p>The Tax-Brain webapp is now hosted at <a href="https://compmodels.org/PSLmodels/Tax-Brain/">compmodels.org/PSLmodels/Tax-Brain/</a></p>
</div>
<div class="modal-footer">
<a type="button" class="btn btn-default" data-dismiss="modal">Close</a>
</div>
</div>
</div>
</div>

</div> <!-- /wrapper -->
<script>
$(document).ready(function() {
$("#redirect-modal").modal("show");
});
</script>

<div id="results-table"></div>
{% endblock %}

Loading

0 comments on commit 5edffcd

Please sign in to comment.