Skip to content

Commit

Permalink
Merge pull request #253 from davidatbu/feature/final-endpoints-in-bac…
Browse files Browse the repository at this point in the history
…kend

Feature/final endpoints in backend + emails actually sent out
  • Loading branch information
dnaaun authored Jul 12, 2020
2 parents eaf61e1 + def3dc6 commit 9a291b0
Show file tree
Hide file tree
Showing 20 changed files with 520 additions and 185 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This is in .env because all the services need it.
REDIS_HOST=redis
REDIS_PORT=6739
SERVER_NAME=www.openframing.org
1 change: 1 addition & 0 deletions docker-compose-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ services:
- REDIS_PORT
- SENDGRID_API_KEY
- SENDGRID_FROM_EMAIL
- SERVER_NAME=localhost
redis:
image: redis:6.0.5-alpine
command: "redis-server --port ${REDIS_PORT}"
Expand Down
41 changes: 20 additions & 21 deletions services/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,7 @@ RUN pip wheel \

### Stage two #####
FROM python:3.8-slim-buster

# create the app user
RUN groupadd -r app -g 999 && useradd -r -g app -u 999 app

## install dependencies
COPY --from=builder /usr/src/app/wheels /wheels
RUN pip install --no-cache /wheels/*
RUN python -m nltk.downloader stopwords wordnet

### Copied from Docker's Openjdk Dockerfile #####
#################### Copied from Docker's Openjdk Dockerfile ##########################
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -121,21 +112,12 @@ RUN set -eux; \
# basic smoke test
javac --version; \
java --version
#### OpenJDK Done ####


RUN set -eux; \
apt-get update; \
apt-get install -y gosu; \
rm -rf /var/lib/apt/lists/*; \
# verify that the binary works
gosu nobody true

######################## OpenJDK Done #############################
#
# create directory for the app user
ENV HOME=/home/app
RUN mkdir $HOME

RUN python -m nltk.downloader -d $HOME/nltk_data/ stopwords wordnet

ENV MALLET_BIN_DIRECTORY=$HOME/mallet-2.0.8/bin
# Prepare mallet installation
Expand All @@ -144,6 +126,23 @@ RUN tar -C $HOME -xf mallet-2.0.8.tar.gz; \
rm mallet-2.0.8.tar.gz; \
ls $MALLET_BIN_DIRECTORY/mallet # Check the mallet executable is there


RUN set -eux; \
apt-get update; \
apt-get install -y gosu; \
rm -rf /var/lib/apt/lists/*; \
# verify that the binary works
gosu nobody true

# create the app user
RUN groupadd -r app -g 999 && useradd -r -g app -u 999 app

## install dependencies
COPY --from=builder /usr/src/app/wheels /wheels
RUN pip install --no-cache /wheels/*; \
rm -rf /wheels
RUN python -m nltk.downloader stopwords wordnet

# Prepare project data directory, this is actually a volume
# Handled by docker-compose.yml
ENV PROJECT_DATA_DIRECTORY=$HOME/project_data_directory
Expand Down
4 changes: 2 additions & 2 deletions services/web/backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ A CSV/Excel file with the predictions.


### Status
In progress.
Done.



Expand Down Expand Up @@ -610,7 +610,7 @@ In progress.

## Download topic proportions for each example.
### Endpoint
`GET /topic_models/<topic_model_id:int>/keywords`
`GET /topic_models/<topic_model_id:int>/topics_by_doc`

### Request parameters
1. `file_type`: Optional. Can be:`csv`, `xlsx`.
Expand Down
Loading

0 comments on commit 9a291b0

Please sign in to comment.