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

Update docs to indicate preferred versions of some build dependencies #248

Closed
kro-cat opened this issue Aug 16, 2023 · 6 comments
Closed

Comments

@kro-cat
Copy link
Contributor

kro-cat commented Aug 16, 2023

Describe the problem/challenge you have
When following the docs, it's not readily obvious what the required go packages and their preferred versions are. For example, controller-gen may need to be installed before running make, but the latest version of that program is incompatible with this repository's code. The absence of some dependencies may cause a build or a test step to fail, as they may not be installed automatically.

Describe the solution you'd like
It may be useful to indicate build deps and their preferred versions (if any) in docs/developer-setup.md:

...

Building and Testing your changes

  • install go build dependencies:

    • golangci-lint
    • sigs.k8s.io/controller-tools/cmd/[email protected]
    • ginkgo ( needed for make ci )
  • run make in the top directory. It will:

    • Build the binary.
      ...

Anything else you would like to add:
sigs.k8s.io/controller-tools/cmd/[email protected] appears to work, as well.

@kro-cat
Copy link
Contributor Author

kro-cat commented Aug 16, 2023

I figured I should open up a new issue for this instead of including it in an unrelated PR.

@kro-cat kro-cat changed the title Update docs to indicate preferred versions of controller-gen and ginkgo Update docs to indicate preferred versions of build dependencies Aug 17, 2023
@kro-cat kro-cat changed the title Update docs to indicate preferred versions of build dependencies Update docs to indicate preferred versions of some build dependencies Aug 17, 2023
@kro-cat
Copy link
Contributor Author

kro-cat commented Aug 17, 2023

Maybe it would be wise to contribute some more explicit build steps or practices. It took me a while to figure out the following build procedure for minikube on a local dev system:

# make sure docker is running first...

# link minikube with docker
minikube start
eval $(minikube docker-env)

# install build deps
make install-golangci-lint
make verify-deps
go install sigs.k8s.io/controller-tools/cmd/[email protected]
go install github.com/onsi/ginkgo/ginkgo@latest
# install musl-gcc toolchain b/c we're building for alpine...

# build <- iterate here
CC=musl-gcc make

# push image to minikube if modified
minikube image load "openebs/lvm-driver:ci" --overwrite=true

# run ci tests
make ci

# investigate here...

# cleanup ci tests
sudo rm /tmp/disk.img
losetup -l | grep '(deleted)' | awk '{print $1}' | xargs -I{} sudo losetup -d {}
kubectl delete -f deploy/sample/lvmsnapclass.yaml
kubectl delete -f deploy/lvm-operator.yaml

# iterate if needed

@Abhinandan-Purkait
Copy link
Member

@kro-cat Can you please explain what changes are you planning on this issue? Is it refactoring the docs to include the build deps?

@kro-cat
Copy link
Contributor Author

kro-cat commented Sep 28, 2023

@kro-cat Can you please explain what changes are you planning on this issue? Is it refactoring the docs to include the build deps?

@Abhinandan-Purkait Sorry for the wait, it's been a busy month for me.
I think, yeah, that's the best way to describe what I'd like to see. Refactoring the build docs to describe build and test dependencies (controller-gen, ginkgo, musl-gcc). That would help with local development. I also think documenting those make targets (install-golangci-lint and verify-deps) in the same area as build & test deps would be necessary too, since those targets will automatically install some dependencies.

@Abhinandan-Purkait
Copy link
Member

Sounds good. @kro-cat Would you mind raising a PR or probably explain so that someone can pick it up?

@abhilashshetty04
Copy link
Contributor

Hi @kro-cat , We will proceed with the closure of this ticket. Please let us know If you want to reopen it or create a new ticket incase you need further help.

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

No branches or pull requests

3 participants