2eae65fc99 | ||
---|---|---|
searchapp | ||
.gitignore | ||
README.md |
README.md
mlhackweek2021
Search WebApp
The intent is to collect search data and train a ranking model. The application can be run from the project, build and run a docker image or deploy to Google App Engine
Docker
cd ./searchapp/mysite
- Create a file named
.env
and addexport DJANGO_SECRET_KEY=<key>
cd ..
- From
searchapp/
Rundocker build -t mysite .
(Yes I used the default project name, naming is hard). - Run the following command, replacing with the external port you wish to use.
docker run -it -p <port>:8020 -e DJANGO_SUPERUSER_USERNAME=admin -e DJANGO_SUPERUSER_PASSWORD=admin -e DJANGO_SUPERUSER_EMAIL=gleonard@mozilla.com mysite
- Go to
http://127.0.0.1:<port>/
to use the app. - Once a search is performed and a result selected, the ping will be listed in the debug view (https://debug-ping-preview.firebaseapp.com/)
Non Docker
To run the application:
cd ./searchapp/mysite
- Create a file named
.env
and addexport DJANGO_SECRET_KEY=<key>
- Run
virtualenv venv && venv/bin/pip install -r requirements.txt
to create the venv. - Run
source venv/bin/activate
- Run
python manage.py makemigrations
- Run
python manage.py migrate
- Currently the application's Glean metrics are not stored in BigQuery (will be added once we settle on the required metrics).
For now the custom ping(s) can be view by setting the following environment variables:export GLEAN_LOG_PINGS=true
export GLEAN_DEBUG_VIEW_TAG=mlhackweek-search
or any other tag you want to use to filter pings.
- Run
python manage.py runserver
- Go to http://127.0.0.1:8000/ to use the app.
- Once a search is performed and a result selected, the ping will be listed in the debug view (https://debug-ping-preview.firebaseapp.com/)
Deploy to Google App Engine
cd ./searchapp/mysite
- Run
gcloud init
and set the project to srg-team-sandbox - Run
gcloud auth login
- Run
gcloud app deploy
- Go to https://console.cloud.google.com/appengine/services?project=srg-team-sandbox&folder=&organizationId= to verify deploy
- Go to https://hackweeksearch-dot-srg-team-sandbox.uc.r.appspot.com/ to use the application