Added volume mount for gcloud credentials

The GCloud credentials of the host computer user are exported as a
volume into the docker container for testing.
This commit is contained in:
Victor Ng 2019-12-03 23:17:27 -05:00
Родитель cefb311fa1
Коммит d9f9084739
2 изменённых файлов: 31 добавлений и 19 удалений

Просмотреть файл

@ -1,6 +1,9 @@
.PHONY: build up tests flake8 ci tests-with-cov
all: build
all: auth build run
auth:
gcloud auth application-default login
pytest:
python setup.py develop
@ -15,4 +18,6 @@ run:
docker run -it cfr-numbermuncher:latest bin/install_bot.sh
# Spin up the docker instance to write out model weights
docker run -e GCS_OAUTH_TOKEN=`gcloud auth application-default print-access-token` -it cfr-numbermuncher:latest python -m cfretl.main
docker run -v ~/.config:/app/.config \
-e GOOGLE_CLOUD_PROJECT=moz-fx-data-derived-datasets \
-it cfr-numbermuncher:latest python -m cfretl.main

Просмотреть файл

@ -1,3 +1,5 @@
# CFR Personalization ETL Server
## Setting up your dev enviroment:
To run any of the test cases that query GCP directly, you'll need to
@ -5,37 +7,42 @@ login to GCP using your own credentials.
From the command line - issue: `gcloud auth application-default login`
Long version:
For the full details, see: https://docs.telemetry.mozilla.org/cookbooks/bigquery.html#from-client-sdks
To build and startup the container - the simplest thing to do is to
run
```
make all
```
---
## Building the container
A docker file is provided to build the container. You can issue
`make build` to create a local image.
# Testing the container
# Kinto authentication
The container is setup to use a default user with the following
settings:
Username: devuser
Password: devpass
The container is setup to use a default user with a username/password
pair of : (devuser, devpass) against the kinto dev server.
## Building the container
```
make build
```
A standard Dockerfile is provided to build the container - the
simplest thing to build the container is to issue: `make build`
## Install the devuser and setup cfr-control, cfr-experiments and cfr-models
Use `make run` to spin up a testing container.
This will install initial data into the dev instance of Remote
Settings at https://kinto.dev.mozaws.net/v1 and start writing out
weight updates. Updates are currently set as a constant of 1 second
updates to ease testing.
The `run` target will automatically set the GCloud OAuth token as an
enviroment variable in your docker container for you.
```
make run
```
The `run` target will automatically mount your GCloud authentication
credentials into the `/app` home directory in the container.