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

Support buildkite CICD and restructure smoke tests #4396

Open
wants to merge 55 commits into
base: master
Choose a base branch
from

Conversation

zpoint
Copy link
Collaborator

@zpoint zpoint commented Nov 22, 2024

The PR is based on #4386. Please review and merge that PR first, then review and merge this one.

  • Restructure test_smoke.py into multiple files within this directory.
tests/smoke_tests
├── __init__.py
├── test_basic.py
├── test_cluster_job.py
├── test_images.py
├── test_managed_job.py
├── test_mount_and_storage.py
├── test_region_and_zone.py
├── test_required_before_merge.py
├── test_sky_serve.py
└── util.py
  • Add a directory .buildkite to contain all the smoke tests that will be picked up by buildkite.
    • Files under .buildkite correspond one-to-one with files under tests/smoke_tests.
    • Test cases in test_required_before_merge.py will be triggered only by valid users' comment on a PR.
      • Support format: pre-merge-test aws / pre-merge-test aws,azure / pre-merge-test(default aws)
    • Other test cases in different files will be run before release and triggered manually.
    • After modifying any test case, please execute python .buildkite/generate_pipeline.py to generate all the YAML files from tests/smoke_tests. (This process can be automated and will be implemented in a subsequent PR.)
.buildkite
├── generate_pipeline.py  -- script to generate following yaml automatically
├── pipeline_smoke_tests_pre_merge.yaml -- pre merge smoke tests, only the minimal requried
└── pipeline_smoke_tests_release.yaml -- release smoke tests, all smoke tests included
  • Support the LOG_TO_STDOUT environment variable when executing pytest, so that the output is visible directly on the CI/CD terminal page

Test

Don't have permission for this repo, currently tested under my personal repo

image
image

Per PR merged CI

  • I configured the pre-PR Buildkite pipeline on my personal forked repository.
  • You can see an example PR on my personal repository (GitHub integration is visible in that PR).

Scheduled CI

A build attempt link

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
  • All smoke tests: pytest tests/test_smoke.py
  • Relevant individual smoke tests: pytest tests/test_smoke.py::test_fill_in_the_name
  • Backward compatibility tests: conda deactivate; bash -i tests/backward_compatibility_tests.sh

@zpoint zpoint changed the title Support buildkite and restructure smoke tests Support buildkite CI and restructure smoke tests Nov 22, 2024
@zpoint zpoint changed the title Support buildkite CI and restructure smoke tests Support buildkite CICD and restructure smoke tests Nov 22, 2024
exclude: (build/.*|sky/skylet/providers/ibm/.*) # Matches exclusions from the script
args: ['--recursive', '--parallel'] # Only necessary flags
exclude: (sky/skylet/providers/ibm/.*) # Matches exclusions from the script
args: ['--recursive', '--parallel', '--in-place'] # Only necessary flags
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't add this flag, pre-commit does nothing for yapf. Now it should be fine.

(sky) ➜  skypilot git:(dev/zeping/restructure_smoke_tests) ✗ git commit -m "fix pre-commit"
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...............................................................Passed
check for added large files..............................................Passed
black (IBM specific).................................(no files to check)Skipped
isort (general)......................................(no files to check)Skipped
isort (IBM specific).................................(no files to check)Skipped
mypy.....................................................................Passed
yapf.....................................................................Failed
- hook id: yapf
- files were modified by this hook
pylint...............................................(no files to check)Skipped

@@ -24,7 +24,6 @@ repos:
args:
- "--sg=build/**" # Matches "${ISORT_YAPF_EXCLUDES[@]}"
- "--sg=sky/skylet/providers/ibm/**"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The format.sh script limits files to this range, but .github/workflows/format.yml does not. Remove the limitation in format.sh to ensure consistency with the final result (format.yml).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant