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

✨ (go/v4): Added DevContainer support for seamless development in environments like GitHub Workspaces without local setup. #4078

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

TAM360
Copy link
Contributor

@TAM360 TAM360 commented Aug 14, 2024

Issue Link

3432

Description

This PR add the functionality of generating DevContainer configuration files along with rest of the Kubebuilder project during scaffolding.

Motivation

DevContainer is an Open Source tool which allows users consolidate their development environment into single container image. This image then can be shared across any environment by anyone. DevContainers can then be launched using any IDE including VSCode. Github's CodeSpaces uses the same tech underline.

In the context of Kubebuilder, having a DevContainer with Kind, Go, and Kubebuilder will allow any user to readily test their Operator's changes without installing any of the tools explicitly, thereby saving the time.

kubebuilder-demo

Copy link

linux-foundation-easycla bot commented Aug 14, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: TAM360 / name: Taimoor Mirza (79aa3d1)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Aug 14, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @TAM360!

It looks like this is your first PR to kubernetes-sigs/kubebuilder 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kubebuilder has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 14, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @TAM360. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Aug 14, 2024
@TAM360 TAM360 changed the title (:seedling:): Support for DevContainers in Project Scaffolding 🌱: Support for DevContainers in Project Scaffolding Aug 14, 2024
@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 14, 2024
@TAM360 TAM360 closed this Aug 14, 2024
@TAM360 TAM360 reopened this Aug 14, 2024
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 14, 2024
@camilamacedo86
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 16, 2024
@camilamacedo86 camilamacedo86 changed the title 🌱: Support for DevContainers in Project Scaffolding ✨ (go/v4): Add support for DevContainers Aug 16, 2024
@camilamacedo86
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 18, 2024
@TAM360 TAM360 requested a review from camilamacedo86 August 18, 2024 14:41
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 18, 2024
@camilamacedo86
Copy link
Member

HI @kannon92, @awfuel, @FabianKramm

I think you all were interest in this one and it seems great for me.
So, if you want spend some time in the review please feel free !

@caozhuozi
Copy link

caozhuozi commented Aug 19, 2024

I see vscode is hardcoded in the settings. If it is not a vendor agnostic feature, How about jetbrains IDE? they seems to be also support devcontainer

@TAM360
Copy link
Contributor Author

TAM360 commented Aug 19, 2024

I see vscode is hardcoded in the settings. If it is not a vendor agnostic feature, How about jetbrains IDE? they seems to be also support devcontainer

@caozhuozi It looks like the JetBrain's support for DevContainers is still in Beta phase. Maybe we can add them later, once it gets stable?

@camilamacedo86 any second thoughts?

@camilamacedo86
Copy link
Member

camilamacedo86 commented Aug 19, 2024

Hi @caozhuozi, @TAM360

I see vscode is hardcoded in the settings. If it is not a vendor agnostic feature, How about jetbrains IDE? they seems to be also support devcontainer

I personally use JetBrains IDEs, but I recognize that a significant portion of users rely on VS Code since it's free and widely adopted. My preference would be to keep the setup vendor-agnostic for this reason. (each person has her/his own preferences and we never will make everybody happy). We also try to avoid dependencies with third-party as much as possible.

That said, it's straightforward for anyone to customize the setup according to their preference after the scaffold is created. So, I suggest we stick with VS Code as the default (given its common, free adoption) while allowing users the flexibility to modify their scaffold to suit their needs.

A second option would not have any IDE at all.
For we do not end up with requests of matter of preference as well.

@camilamacedo86
Copy link
Member

/hold

We might need an small ajusts

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 20, 2024
chmod +x kubectl
mv kubectl /usr/local/bin/kubectl

docker network create -d=bridge --subnet=172.19.0.0/24 kind
Copy link
Member

Choose a reason for hiding this comment

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

Just for we have tracked at least here in a comment why it is required:
kubernetes-sigs/kind#2488 (comment)

Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

/hold cancel

I think all missing nits are addressed now !!
Great work

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 20, 2024
Copy link
Member

@varshaprasad96 varshaprasad96 left a comment

Choose a reason for hiding this comment

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

Hi @TAM360, thanks for your contribution! This is amazing!

Looks good from my end! Just a small question - I personally don't use vscode anymore, but do we also need envtest binaries along with others to be able to test KB projects. We do have a makefile target that helps install this, but would it make it easier to have them in the container itself? (we can have this in follow up too if required)

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 21, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, TAM360, varshaprasad96

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [camilamacedo86,varshaprasad96]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 94d8fce into kubernetes-sigs:master Aug 21, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants