Skip to content

Commit

Permalink
Merge pull request #1 from ebmdatalab/use-service-account-for-bq-access
Browse files Browse the repository at this point in the history
Use service account to access BQ
  • Loading branch information
inglesp authored Sep 14, 2023
2 parents d4afb71 + 84cb214 commit feba78d
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 42 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
bq-service-account.json

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ FROM ebmdatalab/datalab-jupyter:python3.8.1-2328e31e7391a127fe7184dcce38d581a17b
# Set up jupyter environment
ENV MAIN_PATH=/home/app/notebook

# Set path to BQ service account credentials
ENV EBMDATALAB_BQ_CREDENTIALS_PATH=/tmp/bq-service-account.json

# Install pip requirements
COPY requirements.txt /tmp/
# Hack until this is fixed https://github.com/jazzband/pip-tools/issues/823
Expand All @@ -18,3 +21,7 @@ COPY config/kernel.json /tmp/kernel_with_custom_path/kernel.json
RUN jupyter kernelspec install /tmp/kernel_with_custom_path/ --user --name="python3"

CMD cd ${MAIN_PATH} && PYTHONPATH=${MAIN_PATH} jupyter lab --config=config/jupyter_notebook_config.py

# Copy BQ service account credentials into container
# We work around the credentials not existing in CI with the glob
COPY bq-service-account.jso[n] /tmp/
69 changes: 28 additions & 41 deletions notebooks/bnf_code_to_dmd.ipynb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cycler==0.10.0 # via matplotlib
decorator==4.4.1 # via ipython, traitlets
defusedxml==0.6.0 # via nbconvert
descartes==1.1.0 # via ebmdatalab
ebmdatalab==0.0.21 # via -r requirements.in
ebmdatalab==0.0.29 # via -r requirements.in
entrypoints==0.3 # via nbconvert
fiona==1.8.13 # via geopandas
geopandas==0.6.3 # via ebmdatalab
Expand Down

0 comments on commit feba78d

Please sign in to comment.