Skip to content

Commit

Permalink
使用原生 actions 方案替换原有基于 docker 的方案
Browse files Browse the repository at this point in the history
  • Loading branch information
xcnick committed Sep 4, 2024
1 parent 7d7915a commit 91d8838
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 53 deletions.
5 changes: 0 additions & 5 deletions .github/actions/action.yml

This file was deleted.

53 changes: 42 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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]
Expand All @@ -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}
# run: docker stop ${CONTAINER_NAME}
10 changes: 2 additions & 8 deletions docker/dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 0 additions & 16 deletions docker/dockerfile_ci

This file was deleted.

6 changes: 0 additions & 6 deletions scripts/build.sh

This file was deleted.

7 changes: 0 additions & 7 deletions scripts/build_test.sh

This file was deleted.

0 comments on commit 91d8838

Please sign in to comment.