This repository has been archived by the owner on Mar 3, 2024. It is now read-only.
forked from dptech-corp/Uni-Dock
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor unidock tools cicd workflow (#25)
* refactor:ut by module * rm old ut * refactor:use pytest syntex for ut * fix:ut * fix static type * fix static type 2 * fix static type 3 * build:base env dockerfile * feat:add application e2e tests * fix:e2e tests * fix:app test read score * fix:app test * build:update unidocktools ci * test:update tools ci trigger condition * build:fix tool yaml * build:fix ci yaml variable * build:fix build ninja dep * build:fix ninja dep * test: ut unidock input change to 1iep * test: skip ad4 test * build:change push image condition * feat(unidock):add energy_range arg * build:downgrade docker login action * build:reupdate docker login action * build:dockerhub token * build:add checkout * build:change docker login action version * build:change docker login action version 2 * build:docker login action 3 * build:docker build job * build image workflow trigger after push * style:pyright check * build:fix toml pyright setting --------- Co-authored-by: Yuan Yannan <[email protected]>
- Loading branch information
Showing
40 changed files
with
21,119 additions
and
4,807 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Uni-Dock/Tools Build Image Workflow | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build_unidock_docker_image: | ||
if: github.repository_owner == 'dptech-corp' | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
cuda-version: ["12.0.0"] | ||
steps: | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: dptechnology | ||
password: ${{ secrets.DOCKERHUB_PAT }} | ||
|
||
- uses: benjlevesque/[email protected] | ||
id: short-sha | ||
with: | ||
length: 7 | ||
|
||
- name: build and push container | ||
uses: docker/build-push-action@v5 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
tags: dptechnology/unidock:${{ steps.short-sha.outputs.sha }},dptechnology/unidock:latest | ||
file: containers/Dockerfile.cuda${{ matrix.cuda-version }} | ||
context: "{{defaultContext}}:unidock" | ||
push: true | ||
|
||
build_unidock_tools_docker_image: | ||
if: github.repository_owner == 'dptech-corp' | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
cuda-version: ["12.0.0"] | ||
steps: | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: dptechnology | ||
password: ${{ secrets.DOCKERHUB_PAT }} | ||
|
||
- uses: benjlevesque/[email protected] | ||
id: short-sha | ||
with: | ||
length: 7 | ||
|
||
- name: build and push container | ||
uses: docker/build-push-action@v5 | ||
with: | ||
platforms: linux/amd64 | ||
build-args: BASE_IMAGE=xmyyn/unidock_tools_base:0.0.1_cuda${{ matrix.cuda-version }} | ||
tags: dptechnology/unidock_tools:${{ steps.short-sha.outputs.sha }},dptechnology/unidock_tools:latest | ||
file: unidock_tools/containers/Dockerfile | ||
push: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: Uni-Dock Tools CI/CD | ||
on: | ||
push: | ||
branches: | ||
- '**ci**' | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
env: | ||
PYTHON_VERSION: "3.11" | ||
|
||
jobs: | ||
flake8: | ||
continue-on-error: true | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 | ||
- name: Run flake8 formating | ||
run: | | ||
flake8 unidock_tools/unidock_tools --exit-zero | ||
pyright: | ||
continue-on-error: true | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pyright | ||
- name: Run pyright check | ||
id: pyright_check | ||
working-directory: ./unidock_tools | ||
run: | | ||
pyright | ||
tests: | ||
if: ${{ always() }} | ||
needs: [flake8,pyright] | ||
runs-on: nvidia | ||
strategy: | ||
matrix: | ||
cuda-version: ["12.0.0"] | ||
container: | ||
image: docker.io/xmyyn/unidock_tools_base:0.0.1_cuda${{ matrix.cuda-version }} | ||
options: --gpus all | ||
steps: | ||
- name: checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: install unidock | ||
working-directory: ./unidock | ||
run: | | ||
apt-get update && apt-get install -y ninja-build | ||
mkdir build | ||
cd build | ||
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release | ||
cmake --build . | ||
cmake --install . | ||
cd .. | ||
- name: check env | ||
run: | | ||
unidock --version | ||
confgen --version | ||
which python | ||
- name: install tools | ||
working-directory: ./unidock_tools | ||
run: | | ||
pip install . | ||
- name: run unit-test | ||
run: | | ||
pip install pytest pytest-cov | ||
pytest unidock_tools/tests/ut -vv --cov --cov-report term | ||
- name: run application e2e test | ||
run: | | ||
pytest unidock_tools/tests/applications -vv --cov --cov-report term |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
name: Uni-Dock CI/CD | ||
on: | ||
push: | ||
branches: [] | ||
branches: | ||
- '**ci**' | ||
pull_request: | ||
branches: [ main ] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
unidock_test: | ||
|
@@ -52,35 +54,3 @@ jobs: | |
python -m pip install --upgrade pip | ||
pip install pytest>=8.0.0 pytest-cov | ||
pytest unidock/test/ut -vv --doctest-modules --junitxml=junit/test-results.xml --cov --cov-report term | ||
build_docker_image: | ||
needs: unidock_test | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: log in to docker hub | ||
uses: docker/login-action@v3 | ||
if: github.event_name == 'push' | ||
with: | ||
username: dptechnology | ||
password: ${{ secrets.DOCKERHUB_PAT }} | ||
|
||
- name: set up docker buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- uses: benjlevesque/[email protected] | ||
id: short-sha | ||
with: | ||
length: 7 | ||
|
||
- name: check commit short sha | ||
run: echo ${{ steps.short-sha.outputs.sha }} | ||
|
||
- name: build and push container | ||
uses: docker/build-push-action@v4 | ||
with: | ||
tags: dptechnology/unidock:${{ steps.short-sha.outputs.sha }},dptechnology/unidock:latest | ||
file: Dockerfile | ||
context: "{{defaultContext}}:unidock" | ||
push: ${{ github.event_name == 'push' }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
ARG BASE_IMAGE | ||
|
||
FROM ${BASE_IMAGE} | ||
|
||
COPY ./unidock /opt/unidock | ||
|
||
RUN cd /opt/unidock && \ | ||
cmake -B build && \ | ||
cmake --build build -j`nprocs` && \ | ||
cmake --install build && \ | ||
rm -r /opt/unidock | ||
|
||
COPY ./unidock_tools /opt/unidock_tools | ||
RUN cd /opt/unidock_tools && \ | ||
pip install . && \ | ||
rm -r /opt/unidock_tools |
Oops, something went wrong.