diff --git a/.github/actions/action.yml b/.github/actions/action.yml deleted file mode 100644 index 06f14ce..0000000 --- a/.github/actions/action.yml +++ /dev/null @@ -1,5 +0,0 @@ -name: build-latte -description: 'build latte' -runs: - using: 'docker' - image: 'latte:ci' diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6dcdfa2..dbc24e6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,19 +3,50 @@ name: Build Latte on: [push, pull_request] jobs: - build: - runs-on: ubuntu-latest + ubuntu-22-cpu: + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 1 + - name: Clone + id: checkout + uses: actions/checkout@v4 - - name: Build the Docker image - run: docker build -t latte:ci -f docker/dockerfile_ci . + - name: Dependencies + id: depends + run: | + sudo apt-get update + sudo apt-get install -y libopenblas-dev build-essential cmake - - name: Build Latte - uses: ./.github/actions - id: build-latte + - name: Build + id: cmake-build + run: | + cmake -S . -B build -DBUILD_CUDA=OFF + cmake --build build -j $(nproc) + + ubuntu-22-cuda: + runs-on: ubuntu-22.04 + steps: + - name: Clone + id: checkout + uses: actions/checkout@v4 + + - name: Dependencies + id: depends + run: | + sudo apt-get update + sudo apt-get install -y libopenblas-dev build-essential cmake + + - name: CUDA + uses: Jimver/cuda-toolkit@v0.2.16 + id: cuda-toolkit + with: + cuda: '12.5.0' + method: 'network' + + - name: Build + id: cmake-build + run: | + cmake -S . -B build -DBUILD_CUDA=ON + cmake --build build -j $(nproc) # build_and_test_gpu: # runs-on: [self-hosted, linux, x64, gpu] @@ -37,4 +68,4 @@ jobs: # run: docker exec ${CONTAINER_NAME} bash /workspace/scripts/build_test.sh /workspace # - name: Stop Container - # run: docker stop ${CONTAINER_NAME} \ No newline at end of file + # run: docker stop ${CONTAINER_NAME} diff --git a/docker/dockerfile b/docker/dockerfile index ec5a778..6e988f0 100644 --- a/docker/dockerfile +++ b/docker/dockerfile @@ -1,17 +1,11 @@ -FROM nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04 +FROM nvidia/cuda:12.5.1-cudnn-devel-ubuntu22.04 RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update && apt-get install -y --no-install-recommends \ - git \ - wget \ - ca-certificates \ + cmake \ libopenblas-dev && \ rm -rf /var/lib/apt/lists/* -RUN wget https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-linux-x86_64.tar.gz \ - && tar -xzf cmake-3.22.1-linux-x86_64.tar.gz --strip-components=1 -C /usr/local/ \ - && rm cmake-3.22.1-linux-x86_64.tar.gz - RUN groupadd -g 1000 latte && useradd -u 1000 -g 1000 -m -d /home/latte latte -s /bin/bash USER latte diff --git a/docker/dockerfile_ci b/docker/dockerfile_ci deleted file mode 100644 index d9a0051..0000000 --- a/docker/dockerfile_ci +++ /dev/null @@ -1,16 +0,0 @@ -FROM nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04 - -RUN export DEBIAN_FRONTEND=noninteractive && \ - apt-get update && apt-get install -y --no-install-recommends \ - git \ - wget \ - ca-certificates \ - libopenblas-dev && \ - rm -rf /var/lib/apt/lists/* - -RUN wget https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-linux-x86_64.tar.gz \ - && tar -xzf cmake-3.22.1-linux-x86_64.tar.gz --strip-components=1 -C /usr/local/ \ - && rm cmake-3.22.1-linux-x86_64.tar.gz - -ADD ./ /workspace/ -ENTRYPOINT ["bash", "/workspace/scripts/build.sh", "/workspace"] diff --git a/scripts/build.sh b/scripts/build.sh deleted file mode 100644 index 097fb76..0000000 --- a/scripts/build.sh +++ /dev/null @@ -1,6 +0,0 @@ -set -xe - -SRC_ROOT=$1 -cd ${SRC_ROOT} -cmake -S . -B build -cmake --build build -j diff --git a/scripts/build_test.sh b/scripts/build_test.sh deleted file mode 100644 index 2f690a9..0000000 --- a/scripts/build_test.sh +++ /dev/null @@ -1,7 +0,0 @@ -set -xe - -SRC_ROOT=$1 -cd ${SRC_ROOT} -cmake -S . -B build -cmake --build build -j -./build/src/latte/test/test_latte --gtest_filter="-*GPU*" \ No newline at end of file