Skip to content

Commit

Permalink
updated package generation and added conda recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
csachs committed Jan 12, 2021
1 parent 88002aa commit b3c2cad
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 14 deletions.
3 changes: 1 addition & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ environment:
before_build:
- cmd: set PATH=%CONDA%;%CONDA%\Scripts;%CONDA%\Library\bin;%CONDA%\Library\mingw-w64\bin;%PATH%
- cmd: conda config --add channels conda-forge
- cmd: conda config --add channels bioconda
- cmd: conda config --add channels csachs
- cmd: conda config --add channels modsim
- cmd: conda update -y conda
# pyinstaller is currently not working in conjunction with mycelyso, hopefully a pinned commit will resolve this
- cmd: pip install https://github.com/pyinstaller/pyinstaller/archive/15770dadce1227b6772aac68f08ad8eed3d13f99.zip
Expand Down
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.git/
local/
dist/
*.egg-info/
docs/
build/
.idea/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ docs/_build/
.idea/
build/
dist/
local/
examples/*.tif
examples/*.tiff
*.egg-info/
Expand Down
22 changes: 13 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
FROM continuumio/miniconda3:4.7.10-alpine
FROM continuumio/miniconda3:4.9.2-alpine
LABEL maintainer c.sachs@fz-juelich.de

USER root

ENV PATH "$PATH:/opt/conda/bin:/bin/sbin:/usr/bin"

# we could copy the files from the current directory, but that would create an additional layer ...
# COPY . /tmp/package
COPY . /tmp/package

RUN conda config --add channels conda-forge --add channels bioconda --add channels csachs && \
conda install -y jupyter mycelyso mycelyso-inspector && \
pip uninstall -y mycelyso && \
wget https://github.com/modsim/mycelyso/archive/master.tar.gz -O - | tar zx -C /tmp && mv /tmp/mycelyso-master /tmp/package && \
pip install /tmp/package && \

RUN \
wget https://github.com/modsim/mycelyso-inspector/archive/master.tar.gz -O - | tar zx -C /tmp && \
# conda build needs bash
apk add --no-cache bash git && \
conda install -c conda-forge conda-build conda-verify && \
conda build -c conda-forge -c modsim /tmp/mycelyso-inspector-master/recipe && \
conda build -c conda-forge -c modsim /tmp/package/recipe && \
conda install -c conda-forge -c modsim -c local -y python==3.7 jupyter mycelyso mycelyso-inspector && \
mv /tmp/package/examples / && \
rm -rf /tmp/package && \
busybox adduser --disabled-password user && \
Expand All @@ -23,6 +26,7 @@ RUN conda config --add channels conda-forge --add channels bioconda --add channe
echo "c.NotebookApp.ip = '0.0.0.0'" >> /home/user/.jupyter/jupyter_notebook_config.py && \
echo "c.NotebookApp.notebook_dir = '/home/user'" >> /home/user/.jupyter/jupyter_notebook_config.py && \
conda clean -afy || true && \
# conda build purge-all && \ # keep the package in the Docker image
echo Done

USER user
Expand All @@ -31,4 +35,4 @@ WORKDIR /data

EXPOSE 8888

ENTRYPOINT ["python", "-m", "mycelyso"]
ENTRYPOINT ["python", "-m", "mycelyso"]
5 changes: 2 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,12 @@ not be present in the PyPI (Python Package Index). Thankfully the conda Package
provides all packages necessary in an easy to use manner. To use it, please `download Anaconda <https://www.continuum.io/downloads>`_ (Miniconda could be downloaded
as well, but as most packages included in Anaconda are needed anyways, it does hardly provide a size benefit).

You have to enable the necessary channels (we aim to add mycelyso to `bioconda <https://bioconda.github.io>`_ lateron):
You have to enable the necessary channels:

.. code-block:: bash
> conda config --add channels conda-forge
> conda config --add channels bioconda
> conda config --add channels csachs
> conda config --add channels modsim
> conda install -y mycelyso mycelyso-inspector
Expand Down
56 changes: 56 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{% set name = "mycelyso" %}
{% set version = "1.0.1.dev1" %}
#{% set sha256 = "9804cdc22d88beb6f0e6e87870fe962d57aacd6415ba2a5b5ef3c1010cd7f5bf" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
# fn: {{ name }}-{{ version }}.tar.gz
# url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
# sha256: {{ sha256 }}
path: ..

build:
number: 0
script: {{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv
noarch: python

requirements:
build:
- python
- setuptools
run:
- numpy
- scipy
- matplotlib
- scikit-image
- networkx
- pytables
- numexpr
- pandas
- pilyso-io
- mfisp-boxdetection
- molyso
- tunable
- tqdm

test:
imports:
- mycelyso

about:
home: https://github.com/modsim/mycelyso
license: BSD-2-Clause
license_family: BSD
summary: 'mycelyso - MYCEelium anaLYsis SOftware'
description: |
MYCEelium anaLYsis SOftware, see https://github.com/modsim/mycelyso for details.
doc_url: https://mycelyso.readthedocs.io
dev_url: https://github.com/modsim/mycelyso

extra:
recipe-maintainers:
- csachs

0 comments on commit b3c2cad

Please sign in to comment.