Skip to content

Commit

Permalink
Pin hail-notebook dependencies to remove psycopg2 issue (#125)
Browse files Browse the repository at this point in the history
* Install psycopg2-binary earlier in the image build

Try to trick `hgvs>=1.4->ga4gh.vrs[extras]==0.8.4->gnomad` into thinking psycopg2 is already installed

* Install manually from frozen pip

* Update README

---------

Co-authored-by: Michael Franklin <illusional@users.noreply.github.com>
  • Loading branch information
illusional and illusional authored Dec 29, 2023
1 parent 2ad8589 commit d33363f
Show file tree
Hide file tree
Showing 4 changed files with 593 additions and 10 deletions.
14 changes: 4 additions & 10 deletions images/hail-gcp-notebook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ FROM gcr.io/deeplearning-platform-release/base-cpu:latest

ARG VERSION=${VERSION:-0.2.102}

COPY requirements.txt requirements.txt

# hadolint ignore=DL3008,DL3013,DL4006
RUN apt-get update && \
apt-get install -y --no-install-recommends \
Expand All @@ -14,16 +16,8 @@ RUN apt-get update && \
python3-pip && \
rm -rf /var/lib/apt/lists/* && \
conda create -n python310 python=3.10 ipykernel && \
conda run -n python310 pip3 install --no-cache-dir \
analysis-runner \
bokeh \
"cloudpathlib[all]" \
cpg-utils \
gnomad \
hail==${VERSION} \
pyarrow \
metamist \
selenium==3.8.0 && \
conda run -n python310 pip3 install --no-cache-dir --no-deps -r requirements.txt && \
conda run -n python310 pip3 install --no-cache-dir hail==${VERSION} && \
curl -sSL https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 | tar xjf - && \
mv phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin && \
rm -r phantomjs-2.1.1-linux-x86_64 && \
Expand Down
13 changes: 13 additions & 0 deletions images/hail-gcp-notebook/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Hail GCP Notebook


HGVS has this akward psycopg2 dependency which we won't use in the image, and the binary equivalent (`psycopg2-binary`) is already installed.

The `requirements.in` specifies the high level requirements we want to install - `pip-compile` resolves this into a complete list (effectively a `pip freeze`), we remove `psycopg2` specifically, and use that to install with `--no-deps`.

```bash
pip install pip-tools

# update / freeze deps
pip-compile | grep -v "psycopg2==" > requirements.txt
```
8 changes: 8 additions & 0 deletions images/hail-gcp-notebook/requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
analysis-runner
bokeh
cloudpathlib[all]
cpg-utils
gnomad
pyarrow
metamist
selenium==3.8.0
Loading

0 comments on commit d33363f

Please sign in to comment.