Skip to content

Add example dev workflow to CONTRIBUTING.md #579

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
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: 27 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Here are a few things to go over before getting started with CodeFlare Operator
## Environment setup

The following should be installed in your working environment:
- Go 1.20.x
- Go 1.21.x
- [Download release](https://go.dev/dl/)
- [Install Instructions](https://go.dev/doc/install)
- [Operator SDK](https://sdk.operatorframework.io/docs/installation/)
Expand Down Expand Up @@ -53,3 +53,29 @@ To write and inspect unit tests:
- Populate the [.vscode/launch.json](https://github.com/project-codeflare/codeflare-operator/tree/main/.vscode/launch.json) file with the location of your Kubernetes config file and desired namespace.
- In VSCode on the activity bar click `Run and Debug` or `CTRL + SHIFT + D` to start a local debugging session of the CodeFlare Operator.
The operator should be running as intended.


## Example dev workflow

I've made changes to `pkg/controllers/raycluster_controller.go` and `pkg/controllers/raycluster_controller.go`. I've
written unit tests and would like to test my changes using the unit tests as well as on an OpenShift cluster which I
have access to.

1. Ensure the unit tests you've written are passing and you haven't introduced any regressions
1. run `make test-unit`
1. build and push image
1. `make image-build -e IMG=<image-repo/image-name:image-tag>`
1. `make image-push -e IMG=<image-repo/image-name:image-tag>`
1. Login to your OpenShift cluster via `oc login --token=... --server=...`
1. deploy ODH/RHOAI if necessary
1. for the latest releases
1. run `make delete-all-in-one -e USE_RHOAI=<true|false>` **if** you would like to run on a fresh ODH/RHOAI deployment
1. run `make all-in-one -e USE_RHOAI=<true|false>` to deploy new instance of ODH/RHOAI
1. otherwise follow the dev guides found in
[ODH](https://github.com/opendatahub-io/opendatahub-operator?tab=readme-ov-file#deployment) and
[RHOAI](https://gitlab.cee.redhat.com/data-hub/olminstall) (Red Hat internal only)
1. run `make install-nfd-operator`, `make install-service-mesh-operator`, `make install-ai-platform-operator`, `make install-nvidia-operator` to ensure all dependent operators are also installed
1. navigate to the DataScienceCluster resource and set `.spec.components.codeflare.managementState` to `Removed`
1. run `make deploy -e IMG=<image-repo/image-name:image-tag>`

Your dev image should now be deployed in the cluster