pipeline.macos.yml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. common: &common
  2. env:
  3. BUILDKITE: "true"
  4. CI: "true"
  5. PYTHON: "3.7"
  6. RAY_USE_RANDOM_PORTS: "1"
  7. RAY_DEFAULT_BUILD: "1"
  8. LC_ALL: en_US.UTF-8
  9. LANG: en_US.UTF-8
  10. BUILD: "1"
  11. DL: "1"
  12. prelude_commands: &prelude_commands |-
  13. rm -rf /tmp/bazel_event_logs
  14. cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
  15. (which bazel && bazel clean) || true;
  16. . ./ci/ci.sh init && source ~/.zshenv
  17. ./ci/ci.sh build
  18. ./ci/env/install-dependencies.sh
  19. ./ci/env/env_info.sh
  20. epilogue_commands: &epilogue_commands |-
  21. # Cleanup runtime environment to save storage
  22. rm -rf /tmp/ray || true
  23. # Cleanup local caches (this shouldn't clean up global disk cache)
  24. bazel clean
  25. steps:
  26. - label: ":mac: :apple: Wheels and Jars"
  27. <<: *common
  28. conditions: ["RAY_CI_MACOS_WHEELS_AFFECTED", "RAY_CI_PYTHON_DEPENDENCIES_AFFECTED"]
  29. commands:
  30. # Cleanup environments
  31. - rm -rf /tmp/bazel_event_logs
  32. - cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT
  33. - (which bazel && bazel clean) || true
  34. # TODO(simon): make sure to change both PR and wheel builds
  35. # Special setup for jar builds (will be installed to the machine instead)
  36. # - brew remove --force java & brew uninstall --force java & rm -rf /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
  37. # - brew install --cask adoptopenjdk/openjdk/adoptopenjdk8
  38. - diskutil list external physical
  39. - export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
  40. - java -version
  41. # Build wheels
  42. - export UPLOAD_WHEELS_AS_ARTIFACTS=1
  43. - export MAC_WHEELS=1
  44. - export MAC_JARS=1
  45. - export RAY_INSTALL_JAVA=1
  46. - export RAY_ENABLE_WINDOWS_OR_OSX_CLUSTER=1
  47. - . ./ci/ci.sh init && source ~/.zshenv
  48. - ./ci/ci.sh build
  49. # Test wheels
  50. - ./ci/ci.sh test_wheels
  51. # Build jars
  52. - bash ./java/build-jar-multiplatform.sh darwin
  53. # Upload the wheels and jars
  54. # We don't want to push on PRs, in fact, the copy_files will fail because unauthenticated.
  55. - if [ "$BUILDKITE_PULL_REQUEST" != "false" ]; then exit 0; fi
  56. - pip install -q docker aws_requests_auth boto3
  57. # Upload to branch directory.
  58. - python .buildkite/copy_files.py --destination branch_wheels --path ./.whl
  59. - python .buildkite/copy_files.py --destination branch_jars --path ./.jar/darwin
  60. # Upload to latest directory.
  61. - if [ "$BUILDKITE_BRANCH" = "master" ]; then python .buildkite/copy_files.py --destination wheels --path ./.whl; fi
  62. - if [ "$BUILDKITE_BRANCH" = "master" ]; then python .buildkite/copy_files.py --destination jars --path ./.jar/darwin; fi
  63. - label: ":mac: :apple: Ray Core Unit Tests and Dashboard"
  64. <<: *common
  65. conditions: ["RAY_CI_CORE_CPP_AFFECTED", "RAY_CI_PYTHON_AFFECTED", "RAY_CI_DASHBOARD_AFFECTED"]
  66. commands:
  67. - *prelude_commands
  68. - TORCH_VERSION=1.6 ./ci/env/install-dependencies.sh
  69. # Use --dynamic_mode=off until MacOS CI runs on Big Sur or newer. Otherwise there are problems with running tests
  70. # with dynamic linking.
  71. - bazel test --config=ci --dynamic_mode=off --test_env=CI $(./ci/run/bazel_export_options) --build_tests_only --test_tag_filters=-post_wheel_build --
  72. //:all python/ray/dashboard/... -python/ray/serve/... -rllib/... -core_worker_test
  73. - *epilogue_commands
  74. - label: ":mac: :apple: Ray C++ and Java"
  75. <<: *common
  76. conditions: ["RAY_CI_CPP_AFFECTED", "RAY_CI_JAVA_AFFECTED"]
  77. commands:
  78. - export RAY_INSTALL_JAVA=1
  79. - *prelude_commands
  80. # clang-format is needed by java/test.sh
  81. - pip install clang-format==12.0.1
  82. - ./java/test.sh
  83. - ./ci/ci.sh test_cpp
  84. - *epilogue_commands
  85. - label: ":mac: :apple: Small & Client"
  86. <<: *common
  87. conditions: ["RAY_CI_CORE_CPP_AFFECTED", "RAY_CI_PYTHON_AFFECTED"]
  88. commands:
  89. - *prelude_commands
  90. - bazel test $(./ci/run/bazel_export_options) --config=ci
  91. --test_env=CONDA_EXE --test_env=CONDA_PYTHON_EXE --test_env=CONDA_SHLVL --test_env=CONDA_PREFIX
  92. --test_env=CONDA_DEFAULT_ENV --test_env=CONDA_PROMPT_MODIFIER --test_env=CI
  93. --test_tag_filters=client_tests,small_size_python_tests
  94. -- python/ray/tests/...
  95. - *epilogue_commands
  96. - label: ":mac: :apple: Large"
  97. <<: *common
  98. parallelism: 3
  99. conditions: ["RAY_CI_CORE_CPP_AFFECTED", "RAY_CI_PYTHON_AFFECTED"]
  100. commands:
  101. - *prelude_commands
  102. - ./ci/ci.sh test_large
  103. - *epilogue_commands
  104. - label: ":mac: :apple: Medium A-J"
  105. <<: *common
  106. conditions: ["RAY_CI_CORE_CPP_AFFECTED", "RAY_CI_PYTHON_AFFECTED"]
  107. commands:
  108. - *prelude_commands
  109. - bazel test --config=ci $(./ci/run/bazel_export_options) --test_env=CI
  110. --test_tag_filters=-kubernetes,medium_size_python_tests_a_to_j
  111. python/ray/tests/...
  112. - *epilogue_commands
  113. - label: ":mac: :apple: Medium K-Z"
  114. <<: *common
  115. conditions: ["RAY_CI_CORE_CPP_AFFECTED", "RAY_CI_PYTHON_AFFECTED"]
  116. commands:
  117. - *prelude_commands
  118. - bazel test --config=ci $(./ci/run/bazel_export_options) --test_env=CI
  119. --test_tag_filters=-kubernetes,medium_size_python_tests_k_to_z
  120. python/ray/tests/...
  121. - *epilogue_commands