Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/docker image #3

Merged
merged 28 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 12 additions & 4 deletions .github/workflows/build-benchmark.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: build-benchmark
name: Build CUDA-Rust benchmark

on: [workflow_dispatch]

jobs:
container-test-job:
runs-on: ubuntu-latest
container:
image: ghcr.io//maya-zk/2022-entries:main
image: ghcr.io/maya-zk/2022-entries:main
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
Expand All @@ -16,8 +16,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and test CUDA code
# - name: Set up Rust
# uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
- name: Build and test CUDA and Rust code
shell: bash -l {0}
env:
NVCC_PREPEND_FLAGS: "-ccbin=gcc -std=c++17"
run: |
cargo build --release
echo $PATH
rustup show
cargo --version
# /root/.cargo/bin/cargo --version
19 changes: 19 additions & 0 deletions .github/workflows/test-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Test CUDA-Rust Build

on: [workflow_dispatch]

jobs:
container-test-job:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up CUDA
uses: Jimver/cuda-toolkit@v0.2.11
id: cuda-toolkit
with:
cuda: '12.2'
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@

FROM nvidia/cuda:12.2.0-devel-ubuntu20.04

ENV NVCC_PREPEND_FLAGS="-ccbin=gcc -std=c++17"

RUN apt-get update && \
# isntal auxiliary tools
apt-get install -y curl && \
# install clang
apt-get -y install clang && \
# install rust
curl https://sh.rustup.rs -sSf | sh -s -- -y && \
. "$HOME/.cargo/env" && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
# cleanup Docker
rm -rf /var/lib/apt/lists/*

CMD ["bash"]
ENV NVCC_PREPEND_FLAGS="-ccbin=gcc -std=c++17" \
PATH="/root/.cargo/bin:${PATH}"

CMD ["bash"]
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
![Docker build](https://github.com/MAYA-ZK/2022-entries/actions/workflows/build-docker.yaml/badge.svg)
![Docker build](https://github.com/MAYA-ZK/2022-entries/actions/workflows/build-benchmark.yaml/badge.svg)


# 2022-entries

Expand Down Expand Up @@ -27,5 +29,6 @@ docker run -d \
# run the build
docker exec -it zprize22-msm-gpu bash
cd /home
. "$HOME/.cargo/env"
cargo build --release
```
Loading