Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Github CI #539

Merged
merged 20 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from 18 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
33 changes: 18 additions & 15 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.10"]
exclude:
- os: windows-latest
python-version: "3.9"
Expand All @@ -29,19 +29,19 @@ jobs:
shell: bash -l {0}

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

- name: Install Mamba (Linux)
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 }}
if: runner.os != 'Windows'

- name: Install Mamba (Windows)
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-dev-win.yml
extra-specs: |
Expand Down Expand Up @@ -70,11 +70,11 @@ 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: |
Expand All @@ -96,42 +96,45 @@ jobs:
pip install -e gmso
pip install -e .

- name: Run Bleeding Edge Tests
- name: Bleeding Edge Tests
run: |
python -m pytest -v --color yes --pyargs foyer

docker:
runs-on: ubuntu-latest
needs: test
name: Build Docker Image
if: github.event_name != 'pull_request'
#if: github.event_name != 'pull_request'

steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
username: mtest2023
password: mtest2023

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

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

- name: Docker Image Info
run: |
echo Docker Image tags: ${DOCKER_TAGS}

- name: Build and Push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
push: true
tags: ${{ env.DOCKER_TAGS }}
36 changes: 10 additions & 26 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,32 +13,17 @@ ADD . /foyer

WORKDIR /foyer

# Create a group and user
RUN addgroup -S anaconda && adduser -S anaconda -G anaconda
RUN apt-get update && apt-get install -y git

RUN /sbin/apk add --no-cache git && \
conda update conda -yq && conda install -c conda-forge mamba && \
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 && \
mamba env create nomkl -f environment-dev.yml && \
conda activate foyer-dev && \
mamba install -c conda-forge nomkl jupyter python="$PY_VERSION" && \
python setup.py install && \
echo "source activate foyer-dev" >> /home/anaconda/.profile && \
conda clean -afy && \
mkdir -p /home/anaconda/data && \
chown -R anaconda:anaconda /foyer && \
chown -R anaconda:anaconda /opt && \
chown -R anaconda:anaconda /home/anaconda
RUN micromamba create --file environment-dev.yml
ARG MAMBA_DOCKERFILE_ACTIVATE=1 # (otherwise python will not be found)

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

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

RUN chmod a+x /entrypoint.sh

USER anaconda

ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT ["/usr/local/bin/_entrypoint.sh"]
CMD ["jupyter"]
50 changes: 0 additions & 50 deletions devtools/appveyor-ci/run_with_env.cmd

This file was deleted.

2 changes: 2 additions & 0 deletions foyer/element.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Element support in foyer."""
import os
Fixed Show fixed Hide fixed

import openmm.app.element as elem


Expand Down