Skip to content

Commit

Permalink
update action/provision and mamba-org/setup-micromamba (#732)
Browse files Browse the repository at this point in the history
* update action/provision and mamba-org/setup-micromamba

* replace extra-specs with python-version

* update docker config

* temporarily pinned hoomd to be <4, to be unpinned once mbuild is released
  • Loading branch information
daico007 authored Jun 12, 2023
1 parent 8cb3e59 commit e488a03
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 40 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ jobs:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
name: Checkout Branch / Pull Request

- name: Install Mamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-dev.yml
extra-specs: |
python=${{ matrix.python-version }}
python-version: python=${{ matrix.python-version }}

- name: Install Package
run: python -m pip install -e .
Expand All @@ -57,15 +56,14 @@ jobs:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
name: Checkout Branch / Pull Request

- name: Install Mamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-dev.yml
extra-specs: |
python=3.8
python-version: python="3.10"

- name: Clone mBuild and Foyer and forcefield-utilities
run: |
Expand Down Expand Up @@ -108,12 +106,12 @@ jobs:

- name: Get Tagged Version
run: |
echo "DOCKER_TAGS=mosdef/gmso:${GITHUB_REF_NAME}, mosdef/gmso:stable" >> $GITHUB_ENV
echo "DOCKER_TAGS=mosdef-gmso-${CI_COMMIT_REF_SLUG}, mosdef-gmso-stable" >> $GITHUB_ENV
if: github.ref_type == 'tag'

- name: Get Push Version
run: |
echo "DOCKER_TAGS=mosdef/gmso:${GITHUB_REF_NAME}, mosdef/gmso:latest" >> $GITHUB_ENV
echo "DOCKER_TAGS=mosdef-gmso-${CI_COMMIT_REF_SLUG}, mosdef-gmso-latest" >> $GITHUB_ENV
if: github.ref_type == 'branch'

- name: Docker Image Info
Expand Down
41 changes: 12 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ARG PY_VERSION=3.8
FROM continuumio/miniconda3:4.10.3-alpine AS builder
FROM mambaorg/micromamba:1.4.3

EXPOSE 8888

Expand All @@ -14,33 +13,17 @@ ADD . /gmso

WORKDIR /gmso

# Create a group and user
RUN addgroup -S anaconda && adduser -S anaconda -G anaconda

RUN conda update conda -yq && \
conda config --set always_yes yes --set changeps1 no && \
. /opt/conda/etc/profile.d/conda.sh && \
sed -i -E "s/python.*$/python="$PY_VERSION"/" environment-dev.yml && \
conda install -c conda-forge mamba && \
mamba env create nomkl -f environment-dev.yml && \
conda activate gmso-dev && \
mamba install -c conda-forge nomkl jupyter && \
python setup.py install && \
echo "source activate gmso-dev" >> \
/home/anaconda/.profile && \
conda clean -afy && \
mkdir -p /home/anaconda/data && \
chown -R anaconda:anaconda /gmso && \
chown -R anaconda:anaconda /opt && \
chown -R anaconda:anaconda /home/anaconda

WORKDIR /home/anaconda

COPY devtools/docker-entrypoint.sh /entrypoint.sh

RUN chmod a+x /entrypoint.sh

USER anaconda
RUN apt-get update && apt-get install -y git

RUN micromamba create --file environment-dev.yml
ARG MAMBA_DOCKERFILE_ACTIVATE=1 # (otherwise python will not be found)

RUN micromamba install -c conda-forge nomkl jupyter python="3.10"
RUN python setup.py install
RUN echo "source activate gmso-dev" >> /home/.bashrc
RUN micromamba clean -afy
RUN mkdir -p /home/data


ENTRYPOINT ["/entrypoint.sh"]
CMD ["jupyter"]
2 changes: 1 addition & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ dependencies:
- pandas
- symengine
- python-symengine
- hoomd>=3
- hoomd<4

0 comments on commit e488a03

Please sign in to comment.