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

Add Support for Remote Cloud Development with Gitpod #31185

Closed
wants to merge 4 commits into from

Conversation

Siddhant-K-code
Copy link

@Siddhant-K-code Siddhant-K-code commented May 27, 2022

Related to #31146

About this PR

This PR Contains a .gitpod.yml which enables the prebuild and creates a ready to code workspace for contributors.

Maintainability

You do not have to change anything, until or unless you change the build commands flow. In all cases it would work perfect. & This Will Not affect the ongoing maintenance

Contribute with Gitpod

PS: Prebuilds are enabled - saving ~3 minutes of build/ workspace startup time from a cold state.

Gitpod Prebuild Saved Building Time

@pivotal-cla
Copy link

@Siddhant-K-code Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@Siddhant-K-code Thank you for signing the Contributor License Agreement!

joschi added a commit to dropwizard/dropwizard that referenced this pull request May 31, 2022
joschi added a commit to dropwizard/dropwizard that referenced this pull request May 31, 2022
joschi added a commit to dropwizard/dropwizard that referenced this pull request May 31, 2022
joschi added a commit to dropwizard/dropwizard that referenced this pull request May 31, 2022
joschi added a commit to dropwizard/metrics that referenced this pull request May 31, 2022
joschi added a commit to dropwizard/metrics that referenced this pull request May 31, 2022
joschi added a commit to dropwizard/metrics that referenced this pull request May 31, 2022
Copy link
Member

@wilkinsona wilkinsona left a comment

Choose a reason for hiding this comment

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

Thanks for the updates, @Siddhant-K-code. I wanted to try things out so I opened https://gitpod.io/#https://github.com/gitpod-forks/spring-projects-spring-boot to pick up the changes in your fork.

It took a while for the IDE to be ready as it downloaded JDK 17 and ran the build. Am I right in thinking that a pre-build will typically take care of this?

An error popped up during the project import that said the following:

Cannot activate the 'Test Runner for Java' extension because it depends on the 'Language Support for Java(TM) by Red Hat' extension, which is not installed. Would you like to install the extension and reload the window?

Is it possible for this extension to be pre-installed so that users get an error-free experience when they first open the project on Gitpod?

After manually installing Language Support for Java and reloading the workspace, no Java projects are found and I haven't managed to figure out how to add them.

@Siddhant-K-code
Copy link
Author

Siddhant-K-code commented Jun 9, 2022

It took a while for the IDE to be ready as it downloaded JDK 17 and ran the build. Am I right in thinking that a pre-build will typically take care of this?

Yeah, prebuild works in the case when there is init task in the .gitpod.yml file. But, to save the new build each time & loading the previous commit prebuild requires Gitpod - GitHub App or We can simply run the same commands as command which will fastly load the workspace and then all will steps would be running the terminal, automatically.

Doc: Gitpod Prebuilds

Is it possible for this extension to be pre-installed so that users get an error-free experience when they first open the project on Gitpod?

Yeah, we can do that, will do the required changes.

Related Doc: vscode-extensions in .gitpod.yml file

After manually installing Language Support for Java and reloading the workspace, no Java projects are found and I haven't managed to figure out how to add them.

Thanks for pointing this out, it is a known issue we are tracking in gitpod-io/gitpod#9839

@wilkinsona
Copy link
Member

Thanks for pointing this out, it is a known issue we are tracking in gitpod-io/gitpod#9839

Thanks for the link to the Gitpod issue. I'll mark this as blocked until it has been resolved.

@wilkinsona wilkinsona added the status: blocked An issue that's blocked on an external project change label Jun 9, 2022
@Siddhant-K-code
Copy link
Author

I have added the needed extension for java, that issue will not affect now, as it would install the extension while creating the dev. environment. We can merge this!

@wilkinsona
Copy link
Member

wilkinsona commented Jun 9, 2022

Unfortunately, it doesn't seem to work. With your latest changes, the first time I opened https://gitpod.io/#https://github.com/gitpod-forks/spring-projects-spring-boot, it reported an error that the Java extension wasn't installed. The second time, it seemed to install the Java extension automatically but then reported an error that said "redhat.java extension is not synced, but not added in .gitpod.yml". In both cases no Java projects were found in the workspace.

@Siddhant-K-code Siddhant-K-code force-pushed the main branch 3 times, most recently from ec4f7f3 to bb5f6f9 Compare June 9, 2022 07:46
@Siddhant-K-code
Copy link
Author

Siddhant-K-code commented Jun 9, 2022

I have installed the required VsCode Extensions

But, it is now showing this, is there something issue with dev. environment or some build command? can you pls help me on this. Getting this:
image

Build Status:
image

@snicoll snicoll changed the title Added Support for Remote Cloud Development with Gitpod Add Support for Remote Cloud Development with Gitpod Jun 9, 2022
@wilkinsona
Copy link
Member

The error in the first screenshot means that it's using a version of Java lower than 17 to run the build. The second looks to be unrelated but indicates that something else isn't quite right as it's using a nightly build of Gradle 7.5. It should be using the Gradle wrapper (./gradlew) which is Gradle 7.4.2 at this time.

@snicoll
Copy link
Member

snicoll commented Jul 18, 2022

@Siddhant-K-code Do you have any update for us?

@Siddhant-K-code Siddhant-K-code force-pushed the main branch 6 times, most recently from e3e9345 to d2f9b49 Compare July 19, 2022 09:48
@wilkinsona
Copy link
Member

Thanks for the updates.

I've opened https://gitpod.io/#https://github.com/gitpod-forks/spring-projects-spring-boot in my browser. 25 minutes later, the prebuild is still running. I can understand the benefits of it downloading all of the dependences so that things work smoothly in the IDE, but it's running all of the tests which feels unnecessary to me. I suspect it might be a lot quicker if https://github.com/gitpod-forks/spring-projects-spring-boot wasn't 100s of commits being https://github.com/spring-projects/spring-boot as cache hits from Gradle Enterprise would be more likely. Regardless of that, the current prebuild configuration feels suboptimal to me.

I'll take another look once the prebuild has completed and I've had a chance to use the IDE.

@Siddhant-K-code
Copy link
Author

Sorry for kept you waiting @wilkinsona @snicoll

I think, it should work now. I have put the build commands to init that means it would be build before a workspace will start.

image

To get the full benefit of prebuilds (which would save time) you need to install the Gitpod app to this repository.

This Saves Build time, (very recently Node does which can save around ~41 minutes every time a person open a gitpod workspace)

Also, I think we should skip the running tests while build. Any flag in build command to skip tests?

@wilkinsona
Copy link
Member

The prebuild failed after almost an hour with the following message

"We are having trouble connecting to the server. Either you are offline or websocket connections are blocked."

Clicking Skip Prebuild then allowed the IDE to open in my browser but there's no Java extension installed. I can open the code, but it's treated as plain text.

Unfortunately, it's getting increasingly difficult to justify spending more time on this. Flagging for discussion at a team meeting so that we can decide what we want to do.

@Siddhant-K-code
Copy link
Author

The prebuild failed after almost an hour with the following message

"We are having trouble connecting to the server. Either you are offline or websocket connections are blocked."

It was due to, Gitpod has 1 hour timeout for the prebuilds. I think with skipping the tests check while build will decrease this time. & It would work smoothly.

Clicking Skip Prebuild then allowed the IDE to open in my browser but there's no Java extension installed. I can open the code, but it's treated as plain text.

It was in the previous commit (outdated workspace image). Now, this problem won't be there. I have updated the workspace image.

Unfortunately, it's getting increasingly difficult to justify spending more time on this. Flagging for discussion at a team meeting so that we can decide what we want to do.

Sorry for the friction. Would be fix soon 🤞🏼

@wilkinsona wilkinsona added the for: team-meeting An issue we'd like to discuss as a team to make progress label Jul 19, 2022
@wilkinsona
Copy link
Member

I think with skipping the tests check while build will decrease this time. & It would work smoothly

We can't skip the tests entirely, unfortunately. Some of our documentation is test-driven so skipping them will prevent the documentation from being built. Running ./gradlew assemble may be a better option. That'll build everything and only run the handful of tests that are used to generate documentation. If it would be beneficial to also pre-download test dependencies, ./gradlew assemble compileTestJava should still be relatively quick.

Build time should also be improved by our Gradle Enterprise cache that's hosted at https://ge.spring.io. Cache retention is relatively short so your branch being 600 commits behind our main branch will be negating its benefits. Perhaps you can rebase and force-push?

@Siddhant-K-code
Copy link
Author

Siddhant-K-code commented Jul 19, 2022

We can't skip the tests entirely, unfortunately. Some of our documentation is test-driven so skipping them will prevent the documentation from being built. Running ./gradlew assemble may be a better option. That'll build everything and only run the handful of tests that are used to generate documentation. If it would be beneficial to also pre-download test dependencies, ./gradlew assemble compileTestJava should still be relatively quick.

Thanks for the suggestions, I have updated the .gitpod.yml file. It should work now.

Build time should also be improved by our Gradle Enterprise cache that's hosted at https://ge.spring.io/. Cache retention is relatively short so your branch being 600 commits behind our main branch will be negating its benefits. Perhaps you can rebase and force-push?

Updated that 👍🏼


For me It is loading something like this:
image

@bclozel
Copy link
Member

bclozel commented Jul 27, 2022

The team discussed this PR and unfortunately we're going to decline it.
Having seen how difficult it is to set up, we're not confident in our ability to maintain this in the long run. We don't use a cloud setup on a day-to-day basis, so only newcomers are likely to find out about issues. On the other hand, we're maintaining our Contributing docs and have a dedicated first-time-contributor process that brought many new contributors to the project.

Thanks @Siddhant-K-code !

@bclozel bclozel closed this Jul 27, 2022
@bclozel bclozel added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged status: blocked An issue that's blocked on an external project change for: team-meeting An issue we'd like to discuss as a team to make progress labels Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants