Skip to content

Commit

Permalink
Merge pull request #145 from mala-project/develop
Browse files Browse the repository at this point in the history
Create release for Aluminium PRB article
  • Loading branch information
RandomDefaultUser authored Jul 7, 2021
2 parents 64b8bbe + e1811a7 commit 9cc771b
Show file tree
Hide file tree
Showing 181 changed files with 1,132 additions and 15,540 deletions.
97 changes: 97 additions & 0 deletions .github/workflows/cpu-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: CPU

on:
pull_request:
branches:
- master
- develop

# Publish `v1.2.3` tags as releases.
tags:
- v*

jobs:
# Build and push Docker image to GitHub Packages.
build-docker-image-cpu:
runs-on: ubuntu-18.04
env:
IMAGE_NAME: mala_conda_cpu
permissions:
packages: write
contents: read
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Set environment variables
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Create environment variable to which all subsequent actions in this job have access
echo "IMAGE_ID=$IMAGE_ID" >> $GITHUB_ENV
- name: Pull image from registry
run: docker pull $IMAGE_ID || true

- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME --cache-from=$IMAGE_ID --build-arg DEVICE=cpu --label "runnumber=${GITHUB_RUN_ID}"

- name: Push image
run: |
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "develop" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
cpu-tests:
needs: build-docker-image-cpu
runs-on: ubuntu-18.04
container:
image: ghcr.io/mala-project/mala_conda_cpu:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Check out repository (mala)
uses: actions/checkout@v2

- name: Install mala package
run: pip --no-cache-dir install -e .

- name: Check out repository (data)
uses: actions/checkout@v2
with:
repository: mala-project/test-data
token: ${{ secrets.ACCESS_TOKEN }}
path: mala_data
ref: v0.1.0
lfs: false

- name: Data setup
shell: bash
run: |
cd mala_data
chmod +x ../install/data_repo_link/link_data_repo.sh
../install/data_repo_link/link_data_repo.sh `pwd`
- name: Test basic functions
run: python test/mala_tests.py

- name: Test workflow
run: python examples/ex99_verify_all_examples.py
64 changes: 64 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: docs

on:
pull_request:
branches:
- master
- develop
push:
branches:
- develop

jobs:
test-docstrings:
runs-on: ubuntu-18.04
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Upgrade pip
run: python3 -m pip install --upgrade pip

- name: Install dependencies
run: pip install -qU pydocstyle

- name: Check docstrings
run: pydocstyle --convention=numpy mala

deploy-pages:
needs: test-docstrings
runs-on: ubuntu-18.04
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
fetch-depth: 0 # 0 fetches complete history and tags

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Upgrade pip
run: python3 -m pip install --upgrade pip

- name: Install dependencies
run: |
pip install -q -r docs/requirements.txt
- name: Build API and docs
run: |
sphinx-apidoc -o docs/source/api mala
sphinx-build -W --keep-going -b html -d docs/_build/doctrees docs/source docs/_build/html
mv -v docs/_build/html public
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,8 @@ cython_debug/
*.pth
/install/data_repo_link/data_repo_path.py
/test/data_repo_path.py


# JupyterNotebooks
.ipynb_checkpoints
*/.ipynb_checkpoints/*
129 changes: 0 additions & 129 deletions .gitlab-ci.yml

This file was deleted.

18 changes: 18 additions & 0 deletions Copyright.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
************************************************************************

MALA v. 0.1.0

Under the terms of Contract DE-NA0003525 with NTESS,
the U.S. Government retains certain rights in this software.

Questions? Contact Attila Cangi ([email protected])
Siva Rajamanickam ([email protected])

************************************************************************

Copyright 2021 National Technology & Engineering Solutions of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights in this software.

Copyright 2021, (in alphabetical order) Attila Cangi, J. Austin Ellis, Lenz Fiedler, Daniel Kotik, Normand Modine, Sivasankaran Rajamanickam, Steve Schmerler, Aidan Thompson

All rights reserved.

16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
FROM continuumio/miniconda3:4.9.2

# Choose 'cpu' or 'gpu'
ARG DEVICE=cpu

# Update the image to the latest packages
RUN apt-get update && apt-get upgrade -y

RUN apt-get install --no-install-recommends -y build-essential \
libz-dev swig git-lfs && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get install --no-install-recommends -y build-essential libz-dev swig git-lfs
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

COPY install/mala_cpu_environment.yml .
RUN conda env create -q -f mala_cpu_environment.yml && rm -rf /opt/conda/pkgs/*
COPY install/mala_${DEVICE}_environment.yml .
RUN conda env create -f mala_${DEVICE}_environment.yml && rm -rf /opt/conda/pkgs/*

RUN echo "source activate mala-cpu" > ~/.bashrc
ENV PATH /opt/conda/envs/mala-cpu/bin:$PATH
RUN echo "source activate mala-${DEVICE}" > ~/.bashrc
ENV PATH /opt/conda/envs/mala-${DEVICE}/bin:$PATH
26 changes: 26 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
BSD 3-Clause License

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading

0 comments on commit 9cc771b

Please sign in to comment.