From 9cbbfb1598021386a73810248a5aaeb8118bb33c Mon Sep 17 00:00:00 2001 From: reymondzzzz Date: Wed, 8 Nov 2023 14:52:58 +0300 Subject: [PATCH] add base --- .github/cicl/Dockerfile_base | 52 ++++++++++++++++++++++++++++++++ .github/workflows/build_base.yml | 36 ++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 .github/cicl/Dockerfile_base create mode 100644 .github/workflows/build_base.yml diff --git a/.github/cicl/Dockerfile_base b/.github/cicl/Dockerfile_base new file mode 100644 index 000000000..b295c8f23 --- /dev/null +++ b/.github/cicl/Dockerfile_base @@ -0,0 +1,52 @@ +FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 + +RUN apt-get update +RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y \ + curl \ + git \ + htop \ + tmux \ + file \ + vim \ + expect \ + mpich \ + libmpich-dev \ + python3 python3-pip \ + && rm -rf /var/lib/{apt,dpkg,cache,log} + +RUN echo "export PATH=/usr/local/cuda/bin:\$PATH" > /etc/profile.d/50-smc.sh +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 + +# torch +RUN pip install --no-cache-dir torch==2.0.1 --index-url https://download.pytorch.org/whl/cu118 + +# linguist requisites +RUN apt-get update +RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y \ + expect \ + ruby-full \ + ruby-bundler \ + build-essential \ + cmake \ + pkg-config \ + libicu-dev \ + zlib1g-dev \ + libcurl4-openssl-dev \ + libssl-dev +RUN git clone https://github.com/smallcloudai/linguist.git /tmp/linguist \ + && cd /tmp/linguist \ + && bundle install \ + && rake build_gem +ENV PATH="${PATH}:/tmp/linguist/bin" + +RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y python3-packaging + +ENV INSTALL_OPTIONAL=TRUE +ENV BUILD_CUDA_EXT=1 +ENV GITHUB_ACTIONS=true +ENV TORCH_CUDA_ARCH_LIST="6.0;6.1;7.0;7.5;8.0;8.6;8.9;9.0+PTX" +ENV FLASH_ATTENTION_FORCE_BUILD=TRUE +ENV MAX_JOBS=8 +COPY . /tmp/app +RUN pip install ninja +RUN pip install -vvv git+https://github.com/smallcloudai/flash-attention@feat/alibi diff --git a/.github/workflows/build_base.yml b/.github/workflows/build_base.yml new file mode 100644 index 000000000..20d367a9e --- /dev/null +++ b/.github/workflows/build_base.yml @@ -0,0 +1,36 @@ +name: Build base +on: + pull_request: + workflow_dispatch: + +jobs: + build_base: + name: Build base + runs-on: ubuntu-latest + steps: + # Free GitHub Actions Environment Disk Space + - name: Maximize Build Space + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/local/lib/android + sudo rm -rf /opt/ghc + + # Check out current repository + - name: Fetch Sources + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: false + context: ./.github/cicl + file: ./.github/cicl/Dockerfile_base + tags: smallcloud/refact_base:latest + platforms: | + linux/amd64