Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions .github/codefresh.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/main.workflow
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
workflow "Build and Test DeepBedMap" {
resolves = ["Run Tests"]
on = "push"
}

action "Build DeepBedMap App" {
uses = "actions/docker/cli@86ff551d26008267bb89ac11198ba7f1d807b699"
args = "build --file Dockerfile --tag weiji14/deepbedmap --target app ."
}

action "Run Tests" {
uses = "actions/docker/cli@86ff551d26008267bb89ac11198ba7f1d807b699"
args = "run weiji14/deepbedmap python -m pytest --verbose --disable-warnings --nbval test_ipynb.ipynb"
needs = ["Build DeepBedMap App"]
}
47 changes: 29 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM buildpack-deps:bionic@sha256:59661846ab0c581272f4b4688702617e6cc83ef1a9ae1cf918978126babbc858
FROM buildpack-deps:bionic@sha256:59661846ab0c581272f4b4688702617e6cc83ef1a9ae1cf918978126babbc858 AS base
LABEL maintainer "https://github.com/weiji14"
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

# Initiate docker container with user 'jovyan'
ENV NB_USER jovyan
ENV NB_UID 1000
ARG NB_USER=jovyan
ARG NB_UID=1000
ENV NB_USER ${NB_USER}
ENV NB_UID ${NB_UID}
ENV HOME /home/${NB_USER}

RUN adduser --disabled-password \
Expand All @@ -14,21 +16,19 @@ RUN adduser --disabled-password \
${NB_USER}

# Setup conda
ENV CONDA_DIR /opt/conda
ENV CONDA_DIR ${HOME}/.conda
ENV NB_PYTHON_PREFIX ${CONDA_DIR}
ENV MINICONDA_VERSION 4.6.14
ENV PATH ${CONDA_DIR}/bin:$HOME/.local/bin:${PATH}
ENV MINICONDA_VERSION 4.7.10

RUN cd /tmp && \
wget --quiet https://repo.continuum.io/miniconda/Miniconda3-${MINICONDA_VERSION}-Linux-x86_64.sh && \
echo "718259965f234088d785cad1fbd7de03 *Miniconda3-${MINICONDA_VERSION}-Linux-x86_64.sh" | md5sum -c - && \
echo "1c945f2b3335c7b2b15130b1b2dc5cf4 *Miniconda3-${MINICONDA_VERSION}-Linux-x86_64.sh" | md5sum -c - && \
/bin/bash Miniconda3-${MINICONDA_VERSION}-Linux-x86_64.sh -f -b -p $CONDA_DIR && \
rm Miniconda3-${MINICONDA_VERSION}-Linux-x86_64.sh && \
$CONDA_DIR/bin/conda config --system --prepend channels conda-forge && \
$CONDA_DIR/bin/conda config --system --set auto_update_conda false && \
$CONDA_DIR/bin/conda config --system --set show_channel_urls true && \
conda clean --all --yes && \
rm -rf /home/${NB_USER}/.cache/yarn && \
$CONDA_DIR/bin/conda clean --all --quiet --yes && \
$CONDA_DIR/bin/conda init --verbose

# Setup $HOME directory with correct permissions
Expand All @@ -37,26 +37,37 @@ RUN chown -R ${NB_UID} ${HOME}
USER ${NB_USER}
WORKDIR ${HOME}

# Change to bash shell
SHELL ["/bin/bash", "-c"]
# Change to interactive bash shell, so that `conda activate base` works
SHELL ["/bin/bash", "-ic"]

# Install dependencies in environment.yml file using conda
COPY environment.yml ${HOME}
RUN conda env create -n deepbedmap -f environment.yml && \
RUN conda env update -n base -f environment.yml && \
conda clean --all --yes && \
conda list -n deepbedmap
conda list -n base

# Install dependencies in Pipfile.lock using pipenv
COPY Pipfile* ${HOME}/
RUN source activate deepbedmap && \
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib && \
pipenv install --python $CONDA_PREFIX/bin/python --dev --deploy && \
rm --recursive ~/.cache/pipenv && \
RUN conda activate base && \
export LD_LIBRARY_PATH=${CONDA_PREFIX}/lib && \
pipenv install --python ${CONDA_PREFIX}/bin/python --dev --deploy && \
rm --recursive ${HOME}/.cache/pip* && \
pipenv graph

# Setup DeepBedMap virtual environment properly
RUN conda activate base && \
pipenv run python -m ipykernel install --user --name deepbedmap && \
pipenv run jupyter kernelspec list --json

# Copy remaining files to $HOME
COPY --chown=1000:1000 . ${HOME}


FROM base AS app

# Run Jupyter Lab via pipenv in conda environment
EXPOSE 8888
CMD source activate deepbedmap && pipenv run jupyter lab --ip 0.0.0.0
RUN echo -e '#!/bin/bash -i\nset -e\nconda activate\npipenv run "$@"' > .entrypoint.sh && \
chmod +x .entrypoint.sh
ENTRYPOINT ["./.entrypoint.sh"]
CMD ["jupyter", "lab", "--ip", "0.0.0.0"]
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Also a convenient [flat file](https://en.wikipedia.org/wiki/Flat-file_database)
![GitHub top language](https://img.shields.io/github/languages/top/weiji14/deepbedmap.svg)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![Comet.ML: experiments](https://img.shields.io/badge/Comet.ml-experiments-orange.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAhpJREFUOI2Nk01IVGEUhp/zzfW3sUgllUIEzVApS2JyIwStylYmlC3EWvWzcNGyhdAqiGpZy4ja2UYMrBgoatnCTCNRJBxBpNE0bcbx3rlviyycScF3d+B93nMO33eMPEkiRLEs9BRgdYDzUSKCDTl4bWY5/pwqlJoNBkllmjZevWVjYgrzA37V13LgwjnYUzwH9JlZPL8xodQlSWsPHynJES3VnFTiYLvelcQ0QptGiEl+Vpvqz5kglBoMplZvXsP/8J5I+X5WffiWFMpECANHai5Bx2ScaGPdX/asmY14kgAG088eE0y9IdJYSSif+ek03uJP/KQjRJR3tG+FAZ5IqrZAaowQTK5c2gv7GjEzFhPfsdPXqbnchzmPTHKJsqNN/60NdHtBSK99jkNlGoumMGUoPXaFqhu3/7kKa6q2gwHOuyJHbbY0pOjiLbyWNojOUtHVuxOQr1oHECy8xJ+5T6S1haLOu7gSt9sAXChmS07dofDEAwoarpJd/YorrdwtP+s2Ap6yNIqLHiKYeYEyK6yP3gPC3QQM2+Yzjq5/HGj1Ko4TqahHmR+4gkKIHgZvx2kWgGpnZqQDuovrO7HiMswV4pbjkJ2H9Bikxzf92fyAvpy7yAR/vrKmB6TUuLQ8LCWfS6kxKTUh+Qvaov78NAAkNUv6IklaiUtrn6RsaiuYkHRmK2PbhADE/ICeAo86wAEJYIhtzvk3y+cYpafNe/QAAAAASUVORK5CYII=)](https://www.comet.ml/weiji14/deepbedmap/)
[![Codefresh build status](https://g.codefresh.io/api/badges/pipeline/weiji14_marketplace/weiji14%2Fdeepbedmap%2Fdeepbedmap?type=cf-1)](https://g.codefresh.io/public/accounts/weiji14_marketplace/pipelines/weiji14/deepbedmap/deepbedmap)
[![Github Actions Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fweiji14%2Fdeepbedmap%2Fbadge&style=flat)](https://github.com/weiji14/deepbedmap/actions)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=weiji14/deepbedmap)](https://dependabot.com)

![DeepBedMap DEM over entire Antarctic continent, EPSG:3031 projection](https://user-images.githubusercontent.com/23487320/60510321-6e0cb280-9ccf-11e9-8096-d2a32eb28e6c.png)
Expand Down Expand Up @@ -54,9 +54,9 @@ Also a convenient [flat file](https://en.wikipedia.org/wiki/Flat-file_database)

## Quickstart

Launch Binder (Interactive jupyter notebook/lab environment in the cloud).
Launch in [Pangeo Binder](https://pangeo-binder.readthedocs.io) (Interactive jupyter notebook/lab environment in the cloud).

[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/weiji14/deepbedmap/master?urlpath=lab)
[![Binder](https://binder.pangeo.io/badge_logo.svg)](https://binder.pangeo.io/v2/gh/weiji14/deepbedmap/master)

## Installation

Expand All @@ -66,7 +66,7 @@ Start by cloning this [repo-url](/../../)

git clone <repo-url>

Then I recommend [using conda](https://pdal.io/download.html#conda) to install the non-python binaries (e.g. GMT, CUDA, etc).
Then I recommend [using conda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html) to install the non-python binaries (e.g. GMT, CUDA, etc).
The conda virtual environment will also be created with Python and [pipenv](https://pipenv.readthedocs.io) installed.

cd deepbedmap
Expand Down
6 changes: 3 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ channels:
- nodefaults
dependencies:
- hcc::cuda_driver=410.73[md5=941787b750b372f4a240287634589d24]
- defaults::cudatoolkit=10.0[md5=4388ad6015992501b042eea5197eb447]
- conda-forge/label/dev::gmt=6.0.0rc1[md5=983ab0490b3ea8789136267cd7e7ed02]
- pip=18.1[md5=d68c7e5109ba0bf4b1cfe60f0f47870a]
- anaconda::cudatoolkit=10.0[md5=4388ad6015992501b042eea5197eb447]
- conda-forge/label/dev::gmt=6.0.0rc3[md5=5dd95d211fff2434e792dac514063721]
- conda-forge::pip=19.2.1[md5=95e1564d40edda4b98171de82ceba8ab]
- conda-forge::python=3.6.7[md5=787937284685efaaa233453b49a9e719]
- conda-forge::libspatialindex=1.9.0[md5=ef8f25a228de3a0dc716566b8d3de593]
- pip:
Expand Down