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

Enable CI Scripts to Run Locally #35

Merged
merged 5 commits into from
Jan 26, 2023

Conversation

ajschmidt8
Copy link
Member

@ajschmidt8 ajschmidt8 commented Jan 23, 2023

This PR introduces some changes to our CI scripts that enable them to be run locally.

In a nutshell, this PR effectively just adds some prompts that allow users to provide values for environment variables that are typically provided by GitHub Actions.

These environment variables ensure that the build and test scripts run successfully outside of a GH Actions environment.

Breaking down the major changes in this PR by file:

  • tools/rapids-download-conda-from-s3:
    • the changes in this file prompt the user for the necessary env vars that are needed to identify which artifacts should be downloaded from downloads.rapids.ai
  • tools/rapids-download-from-s3:
    • the changes in this file ensure that artifacts are obtained from downloads.rapids.ai (instead of via the aws CLI) when not in a CI environment. VPN access is required to download these artifacts
  • tools/rapids-env-update:
    • sets sccache to use read-only mode (see here) since proper write credentials aren't available to devs running local builds. sets sensible defaults for other build related vars.
  • tools/rapids-upload-conda-to-s3:
    • exits early before any uploads are attempted since upload should only happen in GH Actions

The result of these changes is that devs can now volume mount their locally checked out repository into our CI containers and effortlessly run build / test scripts the same way CI does:

docker run \
  --rm \
  -it \
  --gpus all \
  --network=host \
  -v $PWD:/cugraph -w /cugraph \
  rapidsai/ci:cuda11.4.1-ubuntu18.04-py3.8

## then inside the container...

./ci/test_cpp.sh

This will help developers easily reproduce any build/test failure that they might encounter in CI with conda packages.

Notes

  • --network=host is needed so the container has access to the VPN connection on the host machine (which is necessary since downloads.rapids.ai is only available via VPN at the moment).
  • You should replace the CI image in the example with the image used in the particular CI job that you're trying to replicate

@ajschmidt8
Copy link
Member Author

Proper docs for devs will follow.

@ajschmidt8 ajschmidt8 merged commit b02e70a into rapidsai:main Jan 26, 2023
@ajschmidt8 ajschmidt8 deleted the enable-local-runs branch January 26, 2023 20:57
@ajschmidt8
Copy link
Member Author

Properly documented in rapidsai/docs#335

ajschmidt8 pushed a commit that referenced this pull request Jul 19, 2023
Taking inspiration from #35 and #62

This PR adds / updates:

- `rapids-configure-sccache` (new) : configures sccache for CI/local,
with the intention being to remove this information from CI containers
- `rapids-date-string` (new) : configures date string
- `rapids-configure-conda-channels` (new) : modifies conda channels
based on build type
- `rapids-env-update` (modified) : calls the `rapids-configure-sccache`
- `rapids-prompt-local-repo-config` (new) : consolidates prompts for
users to configure repo information locally
- `rapids-download-wheels/conda-from-s3` (updated) : uses
`rapids-prompt-local-repo-config`
- `rapids-upload-wheels-to-s3` (modifed) : guards to ensure local builds
don't try to upload
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.

2 participants