Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

refactor unidock tools cicd workflow #25

Merged
merged 33 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c50176e
refactor:ut by module
dp-yuanyn Feb 16, 2024
4b887b5
rm old ut
dp-yuanyn Feb 16, 2024
9105373
refactor:use pytest syntex for ut
dp-yuanyn Feb 17, 2024
b74f2b2
fix:ut
YNYuan Feb 18, 2024
ffa4a91
fix static type
YNYuan Feb 19, 2024
f0b9284
fix static type 2
YNYuan Feb 19, 2024
81513d3
fix static type 3
YNYuan Feb 19, 2024
7284eb5
build:base env dockerfile
YNYuan Feb 19, 2024
cbc400f
feat:add application e2e tests
YNYuan Feb 19, 2024
ef8fa46
fix:e2e tests
dp-yuanyn Feb 19, 2024
7c788b8
fix:app test read score
YNYuan Feb 19, 2024
1dcf29f
fix:app test
dp-yuanyn Feb 19, 2024
48fb9df
build:update unidocktools ci
YNYuan Feb 20, 2024
4e1c426
test:update tools ci trigger condition
YNYuan Feb 20, 2024
ee03ff3
build:fix tool yaml
YNYuan Feb 20, 2024
63901f7
build:fix ci yaml variable
YNYuan Feb 20, 2024
3af7376
build:fix build ninja dep
YNYuan Feb 20, 2024
7cc4f15
build:fix ninja dep
YNYuan Feb 20, 2024
8c8f8fa
test: ut unidock input change to 1iep
YNYuan Feb 20, 2024
262e0a9
test: skip ad4 test
YNYuan Feb 20, 2024
746e83c
build:change push image condition
YNYuan Feb 20, 2024
0d07060
feat(unidock):add energy_range arg
YNYuan Feb 20, 2024
97f8f3d
build:downgrade docker login action
YNYuan Feb 20, 2024
d590468
build:reupdate docker login action
YNYuan Feb 20, 2024
9ff2413
build:dockerhub token
dp-yuanyn Feb 20, 2024
e1dd16d
build:add checkout
dp-yuanyn Feb 20, 2024
82554f9
build:change docker login action version
YNYuan Feb 21, 2024
cea1434
build:change docker login action version 2
YNYuan Feb 21, 2024
38ab1a7
build:docker login action 3
YNYuan Feb 21, 2024
bac5bf0
build:docker build job
YNYuan Feb 21, 2024
4d3263c
build image workflow trigger after push
YNYuan Feb 21, 2024
0a77023
style:pyright check
YNYuan Feb 21, 2024
6d943ac
build:fix toml pyright setting
YNYuan Feb 21, 2024
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
74 changes: 74 additions & 0 deletions .github/workflows/ci_docker.yml
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
99 changes: 99 additions & 0 deletions .github/workflows/ci_test_tools.yml
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
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:
Expand Down Expand Up @@ -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' }}
113 changes: 0 additions & 113 deletions .github/workflows/ci_tools.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Running this Docker image requires Docker to support NVIDIA GPUs. Please make sure NVIDIA Container Toolkit is configured.
# See https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/index.html https://github.com/NVIDIA/nvidia-docker

FROM nvidia/cuda:12.2.0-devel-ubuntu22.04
FROM nvidia/cuda:12.0.0-devel-ubuntu22.04

COPY . /opt/unidock

Expand Down
30 changes: 0 additions & 30 deletions unidock_tools/Dockerfile

This file was deleted.

16 changes: 16 additions & 0 deletions unidock_tools/containers/Dockerfile
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
Loading
Loading