diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 04e79a87..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,372 +0,0 @@ -version: 2.1 - -orbs: - shellcheck: circleci/shellcheck@3.0.0 - -executors: - golang: - docker: - - image: cimg/go:1.21 - resource_class: small - environment: - # Build the kernel only for the single architecture. This should reduce - # the overall compile-time significantly. - EC_GPU_CUDA_NVCC_ARGS: --fatbin --gpu-architecture=sm_75 --generate-code=arch=compute_75,code=sm_75 - BELLMAN_CUDA_NVCC_ARGS: --fatbin --gpu-architecture=sm_75 --generate-code=arch=compute_75,code=sm_75 - NEPTUNE_CUDA_NVCC_ARGS: --fatbin --gpu-architecture=sm_75 --generate-code=arch=compute_75,code=sm_75 - -jobs: - shellcheck: - description: Lint the install-filcrypto shell script - docker: - - image: 'cimg/base:stable' - resource_class: small - steps: - - checkout - - shellcheck/install - - run: shellcheck ./install-filcrypto - gofmt: - executor: golang - steps: - - checkout - - run: git submodule sync - - run: git submodule update --init - - run: - name: Run go fmt - # `! go fmt ./... 2>&1 | read"` doesn't work, this one does, thanks - # https://carsonip.me/posts/go-fmt-and-ci/ - command: | - output=$(go fmt ./...) - echo "${output}" - test -z "${output}" - - go_lint: - description: Run various linters - executor: golang - resource_class: medium - steps: - - configure_environment_variables - - prepare - - run: - command: make go-lint - - build_and_test_aarch64_linux_cgo_bindings: - parameters: - run_leak_detector: - type: boolean - default: true - machine: - image: default - resource_class: arm.large - working_directory: ~/go/src/github.com/filecoin-project/filecoin-ffi - steps: - - configure_environment_variables - - prepare - - run: - name: Make sure libcuda is found by linker - command: sudo ln --symbolic --relative /usr/lib/aarch64-linux-gnu/stubs/libcuda.so /usr/lib/aarch64-linux-gnu/stubs/libcuda.so.1 - - build_project - - restore_parameter_cache - - obtain_filecoin_parameters - - save_parameter_cache - - run: cd rust && rustup target add wasm32-unknown-unknown - - run_tests - - build_and_test_linux_cgo_bindings: - parameters: - run_leak_detector: - type: boolean - default: true - executor: golang - resource_class: medium+ - working_directory: ~/go/src/github.com/filecoin-project/filecoin-ffi - steps: - - configure_environment_variables - - prepare - - build_project - - restore_parameter_cache - - obtain_filecoin_parameters - - save_parameter_cache - - run: cd rust && rustup target add wasm32-unknown-unknown - - run_tests: - run_leak_detector: << parameters.run_leak_detector >> - - build_darwin_cgo_bindings: - macos: - xcode: "13.4.1" - working_directory: ~/go/src/github.com/filecoin-project/filecoin-ffi - resource_class: macos.m1.medium.gen1 - steps: - - configure_environment_variables: - linux: false - darwin: true - - prepare: - linux: false - darwin: true - - run: cd rust && cargo fetch - - build_project - - compile_tests - - # SupraSeal pulls in a C++ code base, make sure everything compiles properly. - build_linux_supraseal: - executor: golang - resource_class: medium - working_directory: ~/go/src/github.com/filecoin-project/filecoin-ffi - steps: - - configure_environment_variables - - prepare - - run: - name: Build project with `FFI_USE_CUDA_SUPRASEAL=1` - command: FFI_BUILD_FROM_SOURCE=1 FFI_USE_CUDA_SUPRASEAL=1 make - - publish_linux_x86_64_staticlib: - executor: golang - resource_class: medium - steps: - - configure_environment_variables - - prepare - - publish_release - publish_linux_aarch64_staticlib: - machine: - image: ubuntu-2204:current - resource_class: arm.large - steps: - - configure_environment_variables - - prepare - - publish_release - publish_darwin_staticlib: - macos: - xcode: "13.4.1" - resource_class: macos.m1.medium.gen1 - steps: - - configure_environment_variables: - linux: false - darwin: true - - prepare: - linux: false - darwin: true - - run: cd rust && rustup target add x86_64-apple-darwin - - run: cd rust && cargo fetch - - publish_darwin_release - rustfmt: - docker: - - image: cimg/rust:1.73 - resource_class: small - steps: - - checkout - - run: git submodule sync - - run: git submodule update --init - - run: - name: Run cargo fmt - command: cargo fmt --manifest-path ./rust/Cargo.toml --all -- --check - clippy: - executor: golang - steps: - - configure_environment_variables - - prepare - - run: - name: Run cargo clippy - command: cd rust && cargo clippy --all-targets --features blst-portable,opencl -- -D warnings - -workflows: - version: 2 - test_all: - jobs: - # Lint the install Bash script - - shellcheck - - rustfmt - - clippy - - gofmt - - go_lint - - build_and_test_linux_cgo_bindings: - run_leak_detector: false - - build_and_test_aarch64_linux_cgo_bindings: - run_leak_detector: false - - build_darwin_cgo_bindings - - build_linux_supraseal - - publish_linux_x86_64_staticlib: - filters: - tags: - only: /^v.*/ - branches: - ignore: /.*/ - - publish_linux_aarch64_staticlib: - filters: - tags: - only: /^v.*/ - branches: - ignore: /.*/ - - publish_darwin_staticlib: - filters: - tags: - only: /^v.*/ - branches: - ignore: /.*/ - -commands: - prepare: - parameters: - linux: - default: true - description: is a linux build environment? - type: boolean - darwin: - default: false - description: is a darwin build environment? - type: boolean - steps: - - checkout - - when: - condition: << parameters.linux >> - steps: - - run: sudo apt-get update - - run: DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends -y valgrind ocl-icd-opencl-dev libssl-dev libhwloc-dev nvidia-cuda-toolkit g++-10 - - run: - name: Downgrade to GCC 10, as CUDA 11 doesn't play nice with GCC 11 - command: | - sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-10 10 - sudo update-alternatives --set c++ /usr/bin/g++-10 - - when: - condition: << parameters.darwin >> - steps: - - run: - name: Install Go - command: | - curl https://dl.google.com/go/go1.21.11.darwin-arm64.pkg -o /tmp/go.pkg && \ - sudo installer -pkg /tmp/go.pkg -target / - go version - - run: - name: Install other dependencies with Homebrew - command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config md5sha1sum jq hwloc || brew link --overwrite python@2 - - run: - name: Install Rust toolchain - command: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none - - run: git submodule sync - - run: git submodule update --init - - publish_release: - steps: - - run: - name: Build and publish the standard release - command: | - cd rust - - TARBALL_PATH="/tmp/${CIRCLE_PROJECT_REPONAME}-$(uname)-$(uname -m)-standard.tar.gz" - RELEASE_NAME="${CIRCLE_PROJECT_REPONAME}-$(uname)-$(uname -m)-standard" - - # Note: the blst dependency uses the portable configuration for maximum compatibility - ./scripts/build-release.sh build --verbose --no-default-features --features multicore-sdr,opencl,blst-portable - ./scripts/package-release.sh $TARBALL_PATH - ./scripts/publish-release.sh $TARBALL_PATH $RELEASE_NAME - - run: - name: Build the optimized release - command: | - cd rust - - TARBALL_PATH="/tmp/${CIRCLE_PROJECT_REPONAME}-$(uname)-$(uname -m)-optimized.tar.gz" - RUSTFLAGS="-C target-feature=$(cat rustc-target-features-optimized.json | jq -r '.[].rustc_target_feature' | tr '\n' ',')" - - ./scripts/build-release.sh build --verbose --no-default-features --features multicore-sdr,opencl - ./scripts/package-release.sh $TARBALL_PATH - - publish_darwin_release: - steps: - - run: - name: Build and publish the universal standard release - command: | - cd rust - - RELEASE_NAME="${CIRCLE_PROJECT_REPONAME}-$(uname)-standard" - TARBALL_PATH="/tmp/${RELEASE_NAME}.tar.gz" - - # Note: the blst dependency uses the portable configuration for maximum compatibility - ./scripts/build-release.sh lipo --verbose --no-default-features --features multicore-sdr,opencl,blst-portable - ./scripts/package-release.sh $TARBALL_PATH - ./scripts/publish-release.sh $TARBALL_PATH $RELEASE_NAME - configure_environment_variables: - parameters: - linux: - default: true - description: is a Linux build environment? - type: boolean - darwin: - default: false - description: is a Darwin build environment? - type: boolean - steps: - - run: - name: Configure environment variables - command: | - echo 'export FIL_PROOFS_PARAMETER_CACHE="${HOME}/filecoin-proof-parameters/"' >> $BASH_ENV - echo 'export GO111MODULE=on' >> $BASH_ENV - echo 'export GOPATH="${HOME}/go"' >> $BASH_ENV - echo 'export PATH="/usr/local/go/bin:${HOME}/.cargo/bin:${PATH}:${HOME}/go/bin:${HOME}/.bin"' >> $BASH_ENV - echo 'export RUST_LOG=info' >> $BASH_ENV - echo 'export CIRCLE_ARTIFACTS="/tmp"' >> $BASH_ENV - # Make sure CUDA is found on aarch64 - echo 'export LD_LIBRARY_PATH="/usr/lib/aarch64-linux-gnu/stubs:${LD_LIBRARY_PATH}"' >> ${BASH_ENV} - echo 'export LIBRARY_PATH="/usr/lib/aarch64-linux-gnu/stubs:${LIBRARY_PATH}"' >> ${BASH_ENV} - - when: - condition: << parameters.darwin >> - steps: - - run: - name: Add a few more environment variables - command: | - echo 'export PATH="${HOME}/.cargo/bin:${HOME}/.bin:${PATH}"' >> $BASH_ENV - echo 'export LIBRARY_PATH=/opt/homebrew/lib' >> $BASH_ENV - obtain_filecoin_parameters: - steps: - - run: | - DIR=$(pwd) - cd $(mktemp -d) - go install github.com/filecoin-project/go-paramfetch/paramfetch@latest - $GOPATH/bin/paramfetch 2048 "${DIR}/parameters.json" "${DIR}/srs-inner-product.json" - - build_project: - steps: - - run: - name: Build project - command: make - - - run: - name: Build project without CGO - command: env CGO_ENABLED=0 go build . - - run_tests: - parameters: - run_leak_detector: - type: boolean - default: false - steps: - - when: - condition: <> - steps: - - run: - name: Run leak detector - command: make cgo-leakdetect - no_output_timeout: 90m - - run: - name: Run the Rust tests with default features - command: cd rust && FIL_PROOFS_PARAMETER_CACHE="${HOME}/filecoin-proof-parameters/" RUST_LOG=info cargo test --all --release -- --test-threads 1 && cd .. - no_output_timeout: 90m - - run: - name: Run the Go tests - command: GOEXPERIMENT=cgocheck2 RUST_LOG=info go test -p 1 -timeout 60m - no_output_timeout: 60m - compile_tests: - steps: - - run: - name: Build project and tests, but don't actually run the tests (used to verify that build/link works with Darwin) - command: GOEXPERIMENT=cgocheck2 RUST_LOG=info go test -run=^$ - restore_parameter_cache: - steps: - - restore_cache: - keys: - - v28-proof-params-{{ arch }} - save_parameter_cache: - steps: - - save_cache: - key: v28-proof-params-{{ arch }} - paths: - - "~/filecoin-proof-parameters/"