<commit_before>FROM nanshe/nanshe_notebook:latest
MAINTAINER <NAME> <<EMAIL>>

ADD nanshe_workflow /nanshe_workflow
RUN rm -rf /nanshe_workflow/.git
ADD .git/modules/nanshe_workflow /nanshe_workflow/.git
RUN export INSTALL_CONDA_PATH="/opt/conda${PYTHON_VERSION}" && \
    . "${INSTALL_CONDA_PATH}/etc/profile.d/conda.sh" && \
    conda activate base && \
    sed -i.bak "s/..\/..\/..\/nanshe_workflow/../g" /nanshe_workflow/.git/config && \
    rm -f /nanshe_workflow/.git/config.bak && \
    sed -i.bak "/.*worktree = .*/d" /nanshe_workflow/.git/config && \
    rm -f /nanshe_workflow/.git/config.bak && \
    cd /nanshe_workflow && git update-index -q --refresh && cd / && \
    conda deactivate

ADD entrypoint.sh /usr/share/docker/entrypoint_2.sh
ADD install_workflows.sh /usr/share/docker/install_workflows.sh

RUN for PYTHON_VERSION in 2 3; do \
        export INSTALL_CONDA_PATH="/opt/conda${PYTHON_VERSION}" && \
        . "${INSTALL_CONDA_PATH}/etc/profile.d/conda.sh" && \
        conda activate base && \
        cd /nanshe_workflow && git update-index -q --refresh && cd / && \
        (mv /nanshe_workflow/.git/shallow /nanshe_workflow/.git/shallow-not || true) && \
        conda${PYTHON_VERSION} build /nanshe_workflow/nanshe_workflow.recipe && \
        (mv /nanshe_workflow/.git/shallow-not /nanshe_workflow/.git/shallow || true) && \
        conda${PYTHON_VERSION} install -qy --use-local nanshe_workflow && \
        conda${PYTHON_VERSION} update -qy --use-local --all && \
        conda${PYTHON_VERSION} remove -qy nanshe_workflow && \
        conda${PYTHON_VERSION} update -qy --use-local --all && \
        pip${PYTHON_VERSION} install -e /nanshe_workflow && \
        python${PYTHON_VERSION} -m jupyter trust /nanshe_workflow/nanshe_ipython.ipynb && \
        python${PYTHON_VERSION} -m notebook.nbextensions enable --sys-prefix --py widgetsnbextension && \
        python${PYTHON_VERSION} -m jupyter contrib nbextension install --sys-prefix && \
        python${PYTHON_VERSION} -m jupyter nbextension enable --sys-prefix execute_time/ExecuteTime && \
        python${PYTHON_VERSION} -c "from notebook.services.config import ConfigManager as C; C().update('notebook', {'ExecuteTime': {'clear_timings_on_clear_output': True}})" && \
        rm -rf /opt/conda${PYTHON_VERSION}/conda-bld/work/* && \
        conda${PYTHON_VERSION} clean -tipsy && \
        conda deactivate && \
        rm -rf ~/.conda && \
        rm -rf ~/.cache ; \
    done

ENV OPENBLAS_NUM_THREADS=1

RUN rm -f /tmp/test.sh && \
    touch /tmp/test.sh && \
    chmod +x /tmp/test.sh && \
    echo -e '#!/bin/bash' >> /tmp/test.sh && \
    echo -e "" >> /tmp/test.sh && \
    echo -e "set -e" >> /tmp/test.sh && \
    echo -e "" >> /tmp/test.sh && \
    echo -e "export CORES=2" >> /tmp/test.sh && \
    echo -e "" >> /tmp/test.sh && \
    echo -e "for PYTHON_VERSION in 2 3; do" >> /tmp/test.sh && \<commit_msg>Drop unneeded Jupyter extension install steps<commit_after>FROM nanshe/nanshe_notebook:latest
MAINTAINER <NAME> <<EMAIL>>

ADD nanshe_workflow /nanshe_workflow
RUN rm -rf /nanshe_workflow/.git
ADD .git/modules/nanshe_workflow /nanshe_workflow/.git
RUN export INSTALL_CONDA_PATH="/opt/conda${PYTHON_VERSION}" && \
    . "${INSTALL_CONDA_PATH}/etc/profile.d/conda.sh" && \
    conda activate base && \
    sed -i.bak "s/..\/..\/..\/nanshe_workflow/../g" /nanshe_workflow/.git/config && \
    rm -f /nanshe_workflow/.git/config.bak && \
    sed -i.bak "/.*worktree = .*/d" /nanshe_workflow/.git/config && \
    rm -f /nanshe_workflow/.git/config.bak && \
    cd /nanshe_workflow && git update-index -q --refresh && cd / && \
    conda deactivate

ADD entrypoint.sh /usr/share/docker/entrypoint_2.sh
ADD install_workflows.sh /usr/share/docker/install_workflows.sh

RUN for PYTHON_VERSION in 2 3; do \
        export INSTALL_CONDA_PATH="/opt/conda${PYTHON_VERSION}" && \
        . "${INSTALL_CONDA_PATH}/etc/profile.d/conda.sh" && \
        conda activate base && \
        cd /nanshe_workflow && git update-index -q --refresh && cd / && \
        (mv /nanshe_workflow/.git/shallow /nanshe_workflow/.git/shallow-not || true) && \
        conda${PYTHON_VERSION} build /nanshe_workflow/nanshe_workflow.recipe && \
        (mv /nanshe_workflow/.git/shallow-not /nanshe_workflow/.git/shallow || true) && \
        conda${PYTHON_VERSION} install -qy --use-local nanshe_workflow && \
        conda${PYTHON_VERSION} update -qy --use-local --all && \
        conda${PYTHON_VERSION} remove -qy nanshe_workflow && \
        conda${PYTHON_VERSION} update -qy --use-local --all && \
        pip${PYTHON_VERSION} install -e /nanshe_workflow && \
        python${PYTHON_VERSION} -m jupyter trust /nanshe_workflow/nanshe_ipython.ipynb && \
        python${PYTHON_VERSION} -m jupyter nbextension enable --sys-prefix execute_time/ExecuteTime && \
        python${PYTHON_VERSION} -c "from notebook.services.config import ConfigManager as C; C().update('notebook', {'ExecuteTime': {'clear_timings_on_clear_output': True}})" && \
        rm -rf /opt/conda${PYTHON_VERSION}/conda-bld/work/* && \
        conda${PYTHON_VERSION} clean -tipsy && \
        conda deactivate && \
        rm -rf ~/.conda && \
        rm -rf ~/.cache ; \
    done

ENV OPENBLAS_NUM_THREADS=1

RUN rm -f /tmp/test.sh && \
    touch /tmp/test.sh && \
    chmod +x /tmp/test.sh && \
    echo -e '#!/bin/bash' >> /tmp/test.sh && \
    echo -e "" >> /tmp/test.sh && \
    echo -e "set -e" >> /tmp/test.sh && \
    echo -e "" >> /tmp/test.sh && \
    echo -e "export CORES=2" >> /tmp/test.sh && \
    echo -e "" >> /tmp/test.sh && \
    echo -e "for PYTHON_VERSION in 2 3; do" >> /tmp/test.sh && \
{'fraction_non_alphanumeric': 0.16876217460598547, 'fraction_numerical': 0.0024791924915884543, 'mean_word_length': 2.5634069400630914, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '588251', 'n_tokens_mistral': 2152, 'n_tokens_neox': 2124, 'n_words': 395}