8000 Disable autodetect when setting is off / Improve the full-pipeline info by yhmtsai · Pull Request #1039 · ginkgo-project/ginkgo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Disable autodetect when setting is off / Improve the full-pipeline info #1039

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

Merged
merged 4 commits into from
May 12, 2022
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
28 changes: 21 additions & 7 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,21 +247,35 @@ trigger_pipeline:
- |
if [[ "${PR_ID}" != "null" ]]; then
echo "Finding the corresponding Pull Request - ${PR_ID}"
echo "Checking whether the PR contains 1:ST:ready-to-merge or 1:ST:run-full-test labels"
ENABLE_FULL_PIPELINE=$(curl -X GET -s -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${BOT_STATUS_TOKEN}" \
"https://api.github.com/repos/ginkgo-project/ginkgo/issues/${PR_ID}" | jq -r \
echo "Checking whether the PR contains 1:ST:ready-to-merge, 1:ST:run-full-test, or 1:ST:skip-full-test labels"
PR_CONTENT=$(curl -X GET -s -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${BOT_STATUS_TOKEN}" \
"https://api.github.com/repos/ginkgo-project/ginkgo/issues/${PR_ID}")
SKIP_FULL_PIPELINE=$(echo "${PR_CONTENT}" | jq -r 'any( [.labels | .[] | .name ] | .[] ; . == "1:ST:skip-full-test")')
ENABLE_FULL_PIPELINE=$(echo "${PR_CONTENT}" | jq -r \
'any( [.labels | .[] | .name ] | .[] ; . == "1:ST:ready-to-merge" or . == "1:ST:run-full-test")')
if [[ "${ENABLE_FULL_PIPELINE}" == "true" ]]; then
echo "trigger full pipeline"
if [[ "${SKIP_FULL_PIPELINE}" == "true" ]]; then
echo "Skipping the full pipeline and making the full pipeline succeed"
curl -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${BOT_STATUS_TOKEN}" \
https://api.github.com/repos/ginkgo-project/ginkgo/statuses/${CI_COMMIT_SHA} \
-d "{\"state\":\"success\",\"context\":\"ci/gitlab/full\",\"target_url\":\"${CI_JOB_URL}\",\"description\":\"skipped full pipeline\"}"
echo "If you want to run the full tests, remove 1:ST:skip-full-test and add 1:ST:ready-to-merge or 1:ST:run-full-test to the pull request. Then rerun this job or start a new pipeline."
elif [[ "${ENABLE_FULL_PIPELINE}" == "true" ]]; then
echo "Running full pipeline."
curl -X POST -F token=${CI_JOB_TOKEN} -F "ref=${CI_COMMIT_REF_NAME}" -F "variables[STATUS_CONTEXT]=full" \
https://gitlab.com/api/v4/projects/6431537/trigger/pipeline
echo "If want to skip full pipeline, add 1:ST:skip-full-test. Rerun this job or start a new pipeline."
else
echo "does not contain required labels"
echo "Didn't find required labels, so we're making the full pipeline fail."
curl -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${BOT_STATUS_TOKEN}" \
https://api.github.com/repos/ginkgo-project/ginkgo/statuses/${CI_COMMIT_SHA} \
-d "{\"state\":\"failure\",\"context\":\"ci/gitlab/full\",\"target_url\":\"${CI_JOB_URL}\",\"description\":\"no run/skip full pipeline\"}"
echo "To skip the full pipeline for this pull request, rerun this job or start a new pipeline after adding the label 1:ST:skip-full-test."
echo "To run the full pipeline for this pull request, rerun this job or start a new pipeline after adding one of the 1:ST:run-full-test or 1:ST:ready-to-merge labels."
fi
else
echo "Can not find the corresponding Pull Request"
fi
# Override variables condition
# Override variables condition from .pr_condition
only:
variables:
- $RUN_CI_TAG && $STATUS_CONTEXT == "quick"
Expand Down
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cmake_policy(SET CMP0074 NEW)

# Let CAS handle the CUDA architecture flags (for now)
# Windows still gives CMP0104 warning if putting it in cuda.
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.18)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.18)
cmake_policy(SET CMP0104 OLD)
endif()

Expand All @@ -14,7 +14,9 @@ set(Ginkgo_VERSION_TAG "develop")
set(PROJECT_VERSION_TAG ${Ginkgo_VERSION_TAG})

# Determine which modules can be compiled
include(cmake/hip_path.cmake)
if(NOT DEFINED GINKGO_BUILD_HIP OR GINKGO_BUILD_HIP)
include(cmake/hip_path.cmake)
endif()
include(cmake/autodetect_executors.cmake)
include(cmake/build_type_helpers.cmake)

Expand Down
43 changes: 22 additions & 21 deletions cmake/autodetect_executors.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,46 @@ set(GINKGO_HAS_MPI OFF)
set(GINKGO_HAS_CUDA OFF)
set(GINKGO_HAS_DPCPP OFF)
set(GINKGO_HAS_HIP OFF)
find_package(OpenMP 3.0)
find_package(MPI)

include(CheckLanguage)
check_language(CUDA)
try_compile(GKO_CAN_COMPILE_DPCPP ${PROJECT_BINARY_DIR}/dpcpp
SOURCES ${PROJECT_SOURCE_DIR}/dpcpp/test_dpcpp.dp.cpp
CXX_STANDARD 17)

if(OpenMP_CXX_FOUND)
if(NOT DEFINED GINKGO_BUILD_OMP)
if (NOT DEFINED GINKGO_BUILD_OMP)
find_package(OpenMP 3.0)
if(OpenMP_CXX_FOUND)
message(STATUS "Enabling OpenMP executor")
set(GINKGO_HAS_OMP ON)
endif()
set(GINKGO_HAS_OMP ON)
endif()

if(MPI_FOUND)
if(NOT DEFINED GINKGO_BUILD_MPI)
if (NOT DEFINED GINKGO_BUILD_MPI)
find_package(MPI)
if(MPI_FOUND)
message(STATUS "Enabling MPI support")
set(GINKGO_HAS_MPI ON)
endif()
set(GINKGO_HAS_MPI ON)
endif()

if(CMAKE_CUDA_COMPILER)
if(NOT DEFINED GINKGO_BUILD_CUDA)
if (NOT DEFINED GINKGO_BUILD_CUDA)
check_language(CUDA)
if(CMAKE_CUDA_COMPILER)
message(STATUS "Enabling CUDA executor")
set(GINKGO_HAS_CUDA ON)
endif()
set(GINKGO_HAS_CUDA ON)
endif()

if(GINKGO_HIPCONFIG_PATH)
if(NOT DEFINED GINKGO_BUILD_HIP)
if (NOT DEFINED GINKGO_BUILD_HIP)
if(GINKGO_HIPCONFIG_PATH)
message(STATUS "Enabling HIP executor")
set(GINKGO_HAS_HIP ON)
endif()
set(GINKGO_HAS_HIP ON)
endif()

if (GKO_CAN_COMPILE_DPCPP)
if(NOT DEFINED GINKGO_BUILD_DPCPP)
if (NOT DEFINED GINKGO_BUILD_DPCPP)
try_compile(GKO_CAN_COMPILE_DPCPP ${PROJECT_BINARY_DIR}/dpcpp
SOURCES ${PROJECT_SOURCE_DIR}/dpcpp/test_dpcpp.dp.cpp
CXX_STANDARD 17)
if (GKO_CAN_COMPILE_DPCPP)
message(STATUS "Enabling DPCPP executor")
set(GINKGO_HAS_DPCPP ON)
endif()
set(GINKGO_HAS_DPCPP ON)
endif()
2 changes: 1 addition & 1 deletion examples/custom-matrix-format/CMakeLists.txt
Original file line number Diff line number Diff line change
5C07 Expand Up @@ -4,8 +4,8 @@ project(custom-matrix-format CXX CUDA)
# We only need to find Ginkgo if we build this example stand-alone
if (NOT GINKGO_BUILD_EXAMPLES)
find_package(Ginkgo 1.5.0 REQUIRED)
find_package(OpenMP 3.0 REQUIRED)
endif()
find_package(OpenMP 3.0 REQUIRED)

if(NOT (GINKGO_BUILD_CUDA AND GINKGO_BUILD_OMP))
message(FATAL_ERROR
Expand Down
0