Skip to content

Commit

Permalink
Merge devel to master (#3165)
Browse files Browse the repository at this point in the history
Prepare v2.2.8
  • Loading branch information
njzjz committed Jan 23, 2024
2 parents 839f4fe + 138ffef commit b875ea8
Show file tree
Hide file tree
Showing 260 changed files with 15,372 additions and 8,472 deletions.
52 changes: 38 additions & 14 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,39 @@
Python:
- deepmd/**/*
- deepmd_cli/**/*
- source/tests/**/*
Docs: doc/**/*
Examples: examples/**/*
Core: source/lib/**/*
CUDA: source/lib/src/gpu/**/*
ROCM: source/lib/src/gpu/**/*
OP: source/op/**/*
C++: source/api_cc/**/*
C: source/api_c/**/*
LAMMPS: source/lmp/**/*
Gromacs: source/gmx/**/*
i-Pi: source/ipi/**/*
- changed-files:
- any-glob-to-any-file:
- deepmd/**/*
- deepmd_utils/**/*
- source/tests/**/*
Docs:
- changed-files:
- any-glob-to-any-file: doc/**/*
Examples:
- changed-files:
- any-glob-to-any-file: examples/**/*
Core:
- changed-files:
- any-glob-to-any-file: source/lib/**/*
CUDA:
- changed-files:
- any-glob-to-any-file: source/lib/src/gpu/**/*
ROCM:
- changed-files:
- any-glob-to-any-file: source/lib/src/gpu/**/*
OP:
- changed-files:
- any-glob-to-any-file: source/op/**/*
C++:
- changed-files:
- any-glob-to-any-file: source/api_cc/**/*
C:
- changed-files:
- any-glob-to-any-file: source/api_c/**/*
LAMMPS:
- changed-files:
- any-glob-to-any-file: source/lmp/**/*
Gromacs:
- changed-files:
- any-glob-to-any-file: source/gmx/**/*
i-Pi:
- changed-files:
- any-glob-to-any-file: source/ipi/**/*
34 changes: 34 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
changelog:
exclude:
authors:
- app/pre-commit-ci
- app/dependabot
categories:
- title: Breaking Changes
labels:
- "breaking change"
- title: New Features
labels:
- "new feature"
- title: Enhancement
labels:
- enhancement
- title: Documentation
labels:
# automatically added
- Docs
# for docs outside the doc directory
- "other docs"
exclude:
labels:
- build
- bug
- title: Build and release
labels:
- build
- title: Bug fixings
labels:
- bug
- title: Other Changes
labels:
- "*"
4 changes: 2 additions & 2 deletions .github/workflows/build_cc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
dp_variant: clang
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
Expand All @@ -37,7 +37,7 @@ jobs:
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb \
&& sudo dpkg -i cuda-keyring_1.0-1_all.deb \
&& sudo apt-get update \
&& sudo apt-get -y install cuda-cudart-dev-12-0 cuda-nvcc-12-0
&& sudo apt-get -y install cuda-cudart-dev-12-2 cuda-nvcc-12-2
if: matrix.variant == 'cuda120'
env:
DEBIAN_FRONTEND: noninteractive
Expand Down
57 changes: 40 additions & 17 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ jobs:
python: 311
platform_id: manylinux_x86_64
dp_variant: cuda
cuda_version: 12.2
- os: ubuntu-latest
python: 311
platform_id: manylinux_x86_64
dp_variant: cuda
cuda_version: 11.8
dp_pkg_name: deepmd-kit-cu11
# macos-x86-64
- os: macos-latest
python: 311
Expand Down Expand Up @@ -68,8 +75,11 @@ jobs:
CIBW_ARCHS: all
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
DP_VARIANT: ${{ matrix.dp_variant }}
- uses: actions/upload-artifact@v3
CUDA_VERSION: ${{ matrix.cuda_version }}
DP_PKG_NAME: ${{ matrix.dp_pkg_name }}
- uses: actions/upload-artifact@v4
with:
name: cibw-cp${{ matrix.python }}-${{ matrix.platform_id }}-cu${{ matrix.cuda_version }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
Expand All @@ -78,7 +88,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.11'
Expand All @@ -87,8 +97,9 @@ jobs:
- name: Build sdist
run: python -m build --sdist

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

upload_pypi:
Expand All @@ -99,22 +110,31 @@ jobs:
id-token: write
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1

build_docker:
# use the already built wheels to build docker
needs: [build_wheels]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- variant: ""
cuda_version: "12"
- variant: "_cu11"
cuda_version: "11"
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
path: source/install/docker/dist
merge-multiple: true
- name: Log in to the Container registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
Expand All @@ -124,27 +144,30 @@ jobs:

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934
uses: docker/metadata-action@dbef88086f6cef02e264edb7dbf63250c17cef6c
with:
images: ghcr.io/deepmodeling/deepmd-kit

- name: Build and push Docker image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56
with:
context: source/install/docker
push: ${{ github.repository_owner == 'deepmodeling' && github.event_name == 'push' }}
tags: ${{ steps.meta.outputs.tags }}
push: ${{ github.repository_owner == 'deepmodeling' && github.event_name == 'push' && github.actor != 'dependabot[bot]' }}
tags: ${{ steps.meta.outputs.tags }}${{ matrix.variant }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VARIANT=${{ matrix.variant }}
CUDA_VERSION=${{ matrix.cuda_version }}
build_pypi_index:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist/packages
- uses: actions/setup-python@v4
merge-multiple: true
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.11'
Expand All @@ -153,7 +176,7 @@ jobs:
ls dist/packages > package_list.txt
dumb-pypi --output-dir dist --packages-url ../../packages --package-list package_list.txt --title "DeePMD-kit Developed Packages"
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
path: dist
deploy_pypi_index:
Expand All @@ -169,11 +192,11 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4

pass:
name: Pass testing build wheels
needs: [build_wheels, build_sdist]
needs: [build_wheels, build_sdist, build_docker, build_pypi_index]
runs-on: ubuntu-latest
if: always()
steps:
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: "CodeQL"

on:
push:
pull_request:
schedule:
- cron: '45 2 * * 2'

jobs:
analyze:
name: Analyze
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'c-cpp', 'javascript-typescript', 'python' ]

steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
if: matrix.language == 'c-cpp'
- name: "Setup dependencies"
if: matrix.language == 'c-cpp'
run: |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb \
&& sudo dpkg -i cuda-keyring_1.0-1_all.deb \
&& sudo apt-get update \
&& sudo apt-get -y install cuda-cudart-dev-12-2 cuda-nvcc-12-2
python -m pip install tensorflow
env:
DEBIAN_FRONTEND: noninteractive
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: security-extended,security-and-quality
- name: "Run, Build Application using script"
run: source/install/build_cc.sh
env:
DP_VARIANT: cuda
DOWNLOAD_TENSORFLOW: "FALSE"
if: matrix.language == 'c-cpp'

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
27 changes: 21 additions & 6 deletions .github/workflows/package_c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,48 @@ jobs:
build_c:
name: Build C library
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- tensorflow_build_version: "2.15"
tensorflow_version: ""
filename: libdeepmd_c.tar.gz
- tensorflow_build_version: "2.14"
tensorflow_version: ">=2.5.0rc0,<2.15"
filename: libdeepmd_c_cu11.tar.gz
steps:
- uses: actions/checkout@v4
- name: Package C library
run: ./source/install/docker_package_c.sh
env:
TENSORFLOW_VERSION: ${{ matrix.tensorflow_version }}
TENSORFLOW_BUILD_VERSION: ${{ matrix.tensorflow_build_version }}
- run: cp libdeepmd_c.tar.gz ${{ matrix.filename }}
if: matrix.filename != 'libdeepmd_c.tar.gz'
# for download and debug
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: libdeepmd_c
path: ./libdeepmd_c.tar.gz
name: libdeepmd_c-${{ strategy.job-index }}-${{ matrix.filename }}
path: ${{ matrix.filename }}
- name: Test C library
run: ./source/install/docker_test_package_c.sh
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: libdeepmd_c.tar.gz
files: ${{ matrix.filename }}
test_c:
name: Test building from C library
needs: [build_c]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: libdeepmd_c
pattern: libdeepmd_c-*
merge-multiple: true
- run: tar -vxzf ./libdeepmd_c.tar.gz
- name: Test C library
run: ./source/install/build_from_c.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_cc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
Expand Down

0 comments on commit b875ea8

Please sign in to comment.