thanos icon indicating copy to clipboard operation
thanos copied to clipboard

Support Github Codespace

Open yeya24 opened this issue 2 years ago • 18 comments

Is your proposal related to a problem?

Right now Thanos repo supports using Gitpod as a remote development environment. Similar to that, Github codespace is also a remote development environment that integrates better on GH.

image

Although this feature is ready to use on the Thanos repo, a lot of toolings are missing in the cloud env. It would be good to have better support for this.

Describe the solution you'd like

Follow examples like https://github.com/codespaces-examples/go to add a folder for .devcontainer. Add Dockerfile, setup script, etc so that developers can use GH codespace for development out of the box.

Additional context

(Write your answer here.)

yeya24 avatar Jul 03 '22 22:07 yeya24

Hey, can I work on this?

mohitsaxenaknoldus avatar Jul 05 '22 20:07 mohitsaxenaknoldus

Yeah, feel free to take it!

yeya24 avatar Jul 07 '22 01:07 yeya24

What is exactly missing? I've been using Codespaces for a while and they are working fine for me. I don't remember having to install extra tooling in them. All the PRs I opened in Thanos, except for the very first, came from work through Codespaces.

douglascamata avatar Aug 03 '22 08:08 douglascamata

Also no codespaces setting. I think this is only for private orgs/repos 🤔 image

bwplotka avatar Aug 03 '22 08:08 bwplotka

To have access to Codespaces in public repos as an individual you have to be enrolled in the beta: https://github.com/features/codespaces/signup

douglascamata avatar Aug 03 '22 09:08 douglascamata

What is exactly missing? I've been using Codespaces for a while and they are working fine for me. I don't remember having to install extra tooling in them. All the PRs I opened in Thanos, except for the very first, came from work through Codespaces.

Well in order to use github codespaces we have to enrolled in the beta but without enrolled in the beta everyone can use github codespace that' s the main goal behind this issue(At the end of this year everyone has the github codespaces access). Correct me if I am wrong

Akshit42-hue avatar Aug 03 '22 14:08 Akshit42-hue

I understand, @Akshit42-hue. Anyone will be automatically able to use Github Codespaces on any public repository when it goes out of beta. There's no action required from the Thanos organization to enable this.

The configuration at organization level is to allow usage in private repositories, as @bwplotka mentioned.

Regarding tooling, the default image Github provides has everything needed for development in this repository and the makefile does a great job at downloading the rest, so a .devcontainer folder with extra setup is not needed.

douglascamata avatar Aug 03 '22 15:08 douglascamata

I understand, @Akshit42-hue. Anyone will be automatically able to use Github Codespaces on any public repository when it goes out of beta. There's no action required from the Thanos organization to enable this.

The configuration at organization level is to allow usage in private repositories, as @bwplotka mentioned.

Regarding tooling, the default image Github provides has everything needed for development in this repository and the makefile does a great job at downloading the rest, so a .devcontainer folder with extra setup is not needed.

Ohh Got it! So this issue need to be close

Akshit42-hue avatar Aug 03 '22 15:08 Akshit42-hue

What I intended to solve for this pr is to bundle the required toolings for Thanos in the GitHub codespace so that codespace users can have an environment with all the tools installed including binaries like Prometheus, Promtool, etc.

yeya24 avatar Aug 03 '22 15:08 yeya24

@yeya24 the default container image at the moment is based off of Ubuntu 20.04.4 LTS and has quite some batteries included, I didn't have to install anything. The makefile took care of downloading any missing tool.

douglascamata avatar Aug 03 '22 16:08 douglascamata

Given my experience using Codespaces to develop Thanos, I would say we can close this. Even interactive tests work fine.

douglascamata avatar Aug 03 '22 16:08 douglascamata

@douglascamata That's good to know. From what I tried last time, I found a lot of important toolings are missing. Maybe you can help provide a quick start guide about using code space to setup the dev environment?

yeya24 avatar Aug 03 '22 16:08 yeya24

@douglascamata That's good to know. From what I tried last time, I found a lot of important toolings are missing. Maybe you can help provide a quick start guide about using code space to setup the dev environment?

+1

Akshit42-hue avatar Aug 03 '22 16:08 Akshit42-hue

I can add something. It'll be nothing more than clicking buttons in the Github interface though (it's so intuitive and easy to follow), like you would do in any other project. I didn't have to do any special customization and it worked out of the box.

douglascamata avatar Aug 03 '22 16:08 douglascamata

I wouldn't call it out of box if people still need to run some make commands to install some toolings and Prometheus.

I feel the doc would be super helpful to have and then we can close this issue.

yeya24 avatar Aug 03 '22 16:08 yeya24

@yeya24 the make commands are well so structured that people don't need to run special commands to download dependencies or set up things. You should give a try to work on a fresh clone of Thanos, it's a breeze. You run the make command for what you need and all dependencies are set-up.

The commands we have in the GitPod configuration in fact aren't needed. That is severely out of date. For example, nowadays Prometheus is installed with Bingo automatically when running any makefile target that will need it, we don't need to download it with wget/curl.

Ah, there is one thing that comes to mind that we could add to the .devcontainer file though:

  • A default set of extensions that will be installed. My suggestions:
    • Go
    • gitignore
    • jsonnet language server (by Grafana)
    • Markdown all in one
    • ShellCheck
    • Docker
    • YAML
    • Kubernetes

douglascamata avatar Aug 03 '22 16:08 douglascamata

Thanks @douglascamata for all the shared information. @Akshit42-hue Regarding the extensions to install, would you like to work on them?

yeya24 avatar Aug 03 '22 16:08 yeya24

Thanks @douglascamata for all the shared information. @Akshit42-hue Regarding the extensions to install, would you like to work on them?

Yes, definitely :)

Akshit42-hue avatar Aug 03 '22 16:08 Akshit42-hue

Close as #5661 has been merged.

yeya24 avatar Sep 29 '22 23:09 yeya24