pipeline.macos.yml 4.9 KB

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