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

Dev #18

Merged
merged 17 commits into from
Sep 14, 2023
Merged

Dev #18

Show file tree
Hide file tree
Changes from all 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
49 changes: 49 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Bug Report
description: Create a report for problems with DeePTB
labels: [Bug]
assignees: zhanghao
body:
- type: textarea
attributes:
label: Describe the bug
description: |
A clear and concise description of what the bug is. The bug may results in:
- abnormal interruption of the program,
- systematic or randomized numerical error, or
- relatively low efficiency.
validations:
required: true

- type: textarea
attributes:
label: Expected behavior
description: |
A clear and concise description of what you expected to happen.

- type: textarea
attributes:
label: To Reproduce
description: |
Steps to reproduce the behavior:
1. [e.g. clone the source code from ...]
2. [e.g. install DeePTB ...]
3. [e.g. run DeePTB with ...]

It is recommended to attach your calculation case here for the developers to reproduce the bug.

- type: textarea
attributes:
label: Environment
description: |
- OS: [e.g. Ubuntu 20.04]
- Dependencies: [e.g. PyTorch, SciPy, NumPy, ...]

- type: textarea
attributes:
label: Additional Context
description: |
Add any other context about the problem here.
- type: markdown
attributes:
value: >
Thanks for contributing 🎉!
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Docs
description: For users or developers to report issues related to software documentation, such as missing or incomplete documentation, or documentation that is difficult to understand.
labels: [Docs]
assignees: Qiangqiang Gu
body:
- type: textarea
attributes:
label: Details
description: |
Please provide details about the documentation issue you are experiencing. Include any relevant information such as the specific section of the documentation, the information that is missing or unclear, and any suggestions for improvement.
placeholder: |
Example: The documentation for the band structure calculations is missing. I have read the online manual, but I am still not sure how to do it. My suggestion is to add a new section to the online manual that describes this.
validations:
required: true
- type: markdown
attributes:
value: >
Thank you for reporting this documentation issue. We will review and update the documentation as necessary. 📚
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Feature Request
description: Suggest something more for DeePTB to do
labels: [Feature]
assignees: zhanghao

body:
- type: textarea
attributes:
label: Background
description: |
A clear and concise description of why this new feature is important.
validations:
required: true

- type: textarea
attributes:
label: Describe the solution you'd like
description: |
A clear and concise description of what you want to happen.
validations:
required: true

- type: textarea
attributes:
label: Additional Context
description: |
Add any other context or screenshots about the feature request here.

- type: markdown
attributes:
value: >
Thanks for contributing 🎉!
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/help-wanted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Help Wanted
description: For general questions or assistance.
labels: [Help wanted]
assignees: zhanghao

body:
- type: textarea
attributes:
label: Details
description: |
Want to use DeePTB for certain system? Facing problems when installing DeePTB? Don't know how to choose a good parameter? Feel free to reach us, and we'll do our best to help!
validations:
required: true
- type: markdown
attributes:
value: >
Thanks for contributing 🎉!
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/software-enhancements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Software Enhancements
description: Suggest an idea to make DeePTB more robust and organized
labels: [Refactor]
assignees: zhanghao

body:
- type: textarea
attributes:
label: Describe Current Status and Possible Solution
description: |
A clear and concise description of why this enhancement is important.
Describing the current situation of DeePTB is preferred.
If you have some ideas about how to achieve it, please feel free to comment.
validations:
required: true

- type: textarea
attributes:
label: Additional Context
description: |
Add any other context or screenshots about the enhancement here.

- type: markdown
attributes:
value: >
Thanks for contributing 🎉!
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Tests
description: Regarding tests of DeePTB
labels: [Test]
assignees: zhanghao

body:
- type: textarea
attributes:
label: Describe Current Status and Possible Solution

validations:
required: true

- type: textarea
attributes:
label: Additional Context
description: |
Add any other context or screenshots about the enhancement here.

- type: markdown
attributes:
value: >
Thanks for contributing 🎉!
47 changes: 47 additions & 0 deletions .github/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Container

on:
push:
paths-ignore:
- 'docs/**'
branches:
- dev

jobs:
build_container_and_push:
runs-on: ubuntu-latest
if: github.repository_owner == 'deepmodeling'
strategy:
matrix:
dockerfile: ["dev"]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to Aliyun Registry
uses: docker/login-action@v2
with:
registry: registry.dp.tech
username: ${{ secrets.DP_HARBOR_USERNAME }}
password: ${{ secrets.DP_HARBOR_PASSWORD }}

- name: Build and Push Container
uses: docker/build-push-action@v4
with:
tags: |
ghcr.io/deepmodeling/deeptb-${{ matrix.dockerfile }}:latest
registry.dp.tech/deepmodeling/deeptb-${{ matrix.dockerfile }}:latest
file: Dockerfile.${{ matrix.dockerfile }}
cache-from: type=registry,ref=ghcr.io/deepmodeling/deeptb-${{ matrix.dockerfile }}:latest
cache-to: type=inline
push: true
50 changes: 50 additions & 0 deletions .github/workflows/image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build Image

on:
workflow_dispatch:
push:
tags:
- 'v*'
jobs:
build_container_and_push:
runs-on: ubuntu-latest
if: github.repository_owner == 'deepmodeling'
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/deepmodeling/deeptb
registry.dp.tech/deepmodeling/deeptb
tags: |
type=semver,pattern={{version}}
type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' }}

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to Aliyun Registry
uses: docker/login-action@v2
with:
registry: registry.dp.tech
username: ${{ secrets.DP_HARBOR_USERNAME }}
password: ${{ secrets.DP_HARBOR_PASSWORD }}

- name: Build and Push Container
uses: docker/build-push-action@v4
with:
tags: ${{ steps.meta.outputs.tags }}
file: Dockerfile
push: true
labels: ${{ steps.meta.outputs.labels }}
44 changes: 44 additions & 0 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: DeePTB tests.

on:
pull_request:
paths-ignore:
- 'docs/**'

jobs:
build:
runs-on: self-hosted
outputs:
output1: ${{ steps.s1.outputs.test }}
output2: ${{ steps.s2.outputs.test }}
output3: ${{ steps.s3.outputs.test }}
if: github.repository_owner == 'deepmodeling'
container: ghcr.io/deepmodeling/deeptb:latest
steps:
- name: Checkout
id: s1
uses: actions/checkout@v3
with:
ref: "refs/pull/${{ github.event.number }}/merge"
- name: Install DeePTB
id: s2
run: |
exec bash
conda activate deeptb
pip install .
pip install pytest
- name: Run Test
id: s3
run: |
exec bash
conda activate deeptb
pytest ./dptb/tests/
job2:
runs-on: self-hosted
needs: build
steps:
- env:
OUTPUT1: ${{needs.build.outputs.output1}}
OUTPUT2: ${{needs.build.outputs.output2}}
OUTPUT3: ${{needs.build.outputs.output3}}
run: echo "$OUTPUT1 $OUTPUT2 $OUTPUT3 ????"
18 changes: 18 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

formats: all

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.8
install:
- requirements: docs/requirements.txt
34 changes: 25 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
FROM python:3.10
RUN pip install torch
RUN pip install torchsort
RUN pip install numpy scipy spglib matplotlib
RUN pip install ase
RUN pip install pytest
RUN pip install future
RUN pip install pyyaml
RUN pip install dargs==0.3.3
FROM ubuntu:20.04
SHELL ["/bin/bash", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install wget -y && apt-get clean all
RUN apt update && apt install -y --no-install-recommends git

RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/miniconda && \
/opt/miniconda/bin/conda init bash && \
rm -rf Miniconda3-latest-Linux-x86_64.sh && \
rm -rf /var/lib/apt/lists/*

ENV PATH=/opt/miniconda/bin:$PATH

RUN git clone https://github.com/deepmodeling/DeePTB.git && \
conda create -n deeptb python=3.8 -c conda-forge -y && \
conda init && \
source activate deeptb && \
cd ./DeePTB && \
pip install . && \
cd .. && \
rm ./DeePTB -r && \
conda clean --all -y && \
rm -rf /root/.cache/pip && \
echo "source activate deeptb" >> ~/.bashrc
Loading