AlabamaASRL / asset_asrl

https://alabamaasrl.github.io/asset_asrl/
Apache License 2.0
29 stars 6 forks source link

[Feature Request] Install by Package Managers #10

Closed jasonmeverett closed 3 weeks ago

jasonmeverett commented 1 year ago

ASSET libraries and package should be able to be installed with:

conda install -c <channel> asset_asrl

Or:

pip install asset_asrl
jbpezent commented 1 year ago

@jasonmeverett , agreed this is top priority right now, we will probably focus on getting it on pypi/pip first and then do conda

jasonmeverett commented 1 year ago

@jbpezent sounds good. Updated title of the issue

jbpezent commented 1 year ago

The library is now on pypi, you should be able to run pip install asset-asrl on windows and linux for pythons >=3.7. One caveat on linux though. At present we only have uploaded wheels adhering to the manylinux_2_31 or newer standard. This should cover everyone with a linux distro released since 2020. I'm working on setting up a docker container on actions so we can generate wheels with wider compatibility with earlier distros.

jbpezent commented 1 year ago

I'm going to reopen this in case anyone has any issues. Also if you are installing in an anaconda or miniconda environment on Ubuntu 22.04 make sure to install asset in a new environment with libstdcxx-ng=12.2.

conda install -c conda-forge libstdcxx-ng=12.2

By default, conda's version of GLIBC is slightly older than those installed on the system and is found before the system libraries. This will result in an error saying that GLIBC cant be found when you try to run asset. The above package will make sure that the conda environment's GLIBC matches the system.

jasonmeverett commented 1 year ago

@jbpezent Install looks good in 20.04. This brought a running Dockerfile down to only 20 lines:

FROM ubuntu:20.04

# Environment variables
ENV DEBIAN_FRONTEND=noninteractive

# Base updates
RUN apt-get update && apt-get upgrade -y && apt-get install -y wget

# Miniconda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-py39_22.11.1-1-Linux-x86_64.sh \
  && bash Miniconda3-py39_22.11.1-1-Linux-x86_64.sh -b -p /opt/miniconda3 \
  && /opt/miniconda3/bin/conda init bash \
  && . /root/.bashrc \
  && conda create --name asset \
  && rm Miniconda3-py39_22.11.1-1-Linux-x86_64.sh \
  && echo "conda activate asset" >> /root/.bashrc \
  && conda clean --all

# Conda environment
RUN . /root/.bashrc \
  && conda install python=3.9 \
  && pip install asset_asrl

I see that packages like matplotlib and seaborn are installed as dependencies. Does ASRL have any plans to move towards a "minimalist" ASSET install? Would be cool to see an option to install only baseline ASSET libraries, and then a separate astro/plotting library if folks want to use that. That would allow for folks to just use pure ASSET libraries and reduce footprint for containerization.

jbpezent commented 1 year ago

@jasonmeverett Its unlikely that we remove matplotlib as a dependency, since all of our examples use it. We will probably get rid of seaborn at some point, though, we only currently use it to do some plotting stuff that could also be done with matplotlib.