eclipse-theia / theia-blueprint

The Eclipse IDE is a modern and open IDE for cloud and desktop. The Theia IDE is based on the Theia platform. The Theia IDE is available as a downloadable desktop application. You can also try the latest version of the Theia IDE online. For more details, see the Readme below.
https://theia-ide.org/#theiaide
MIT License
310 stars 120 forks source link

Browser package for Blueprint #74

Open marcdumais-work opened 3 years ago

marcdumais-work commented 3 years ago

Feature Description:

Now that we have packages for multiple operating systems, for that Electron version of Blueprint, it would be desirable to also have some sort of packaged browser version of Blueprint.

This could be easily consumed, e.g. in Docker images, instead of attempting to build the contained Theia app from scratch, each time, as has been the norm so far. We think it will lower the bar considerably, for creating Theia-based containerised vanilla IDE appliances (where no customisation of the app is required).

As a first step, we'd be happy to have a single type of package, whatever is easiest, so long as we can use it in a Docker image we intend to create in this repo.

paul-marechal commented 3 years ago

Note that I'm currently investigating building such a browser app as well as its packaging into an executable format.

This is in the investigation state and I'm making very slow progress on this. I'm basically trying tools such as pkg to turn a Node app into an exe, bundling the backend code using Webpack to minimize the build size, etc... Learning as I go, so it is not clear if it will actually work for Theia since the project is not trivial to bundle.

I will post my conclusion once I reach one on this task.

brianking commented 3 years ago

A nice first use-case or test bed for this would be if we stood up our own hosted version of Theia. However, we would need someone to contribute infrastructure for hosting it.

For current adopters, what is the current way for them to integrate Theia? Is the idea with this to make their job easier?

paul-marechal commented 3 years ago

The way I see it, Theia is an appliance to get a window into a development environment. With that in mind, I was thinking that people using Theia Blueprint in the browser would define their development environment as a Dockerfile of some sort, and lastly drop in and install Theia in order to work inside it.

I think Che also focuses on the "development container" approach where Theia runs in one container dedicated for it, and when you open terminals to run your project it is actually running in the container running your development environment. While it is nice it is more complex to setup.

So the idea I'm investigating would make people's job easier in the sense that they'll be able to focus on building their containerized development environment, and have Theia/Blueprint at the ready easily deployable inside it.

For current adopters, what is the current way for them to integrate Theia?

Create images and build Theia for those themselves, usually by building directly into the image.

Is the idea with this to make their job easier?

Yes, but keep in mind that this is just an investigation so far.

[...] if we stood up our own hosted version of Theia.

I am having a hard time imagining what that would look like. It would be the most useful if people can define/pick their development environment and get to work inside it using Theia. But that's what workspace servers like Che are doing, so running a Che workspace server instance deploying Blueprint?

marcdumais-work commented 3 years ago

if we stood up our own hosted version of Theia.

Providing a Docker image that bundles Blueprint is a step towards that direction, but like Paul says, there are important required components/services that are not part of Blueprint or Theia (e.g. authentication, managing development containers, ...). If we wanted to go in that direction, I would suggest the Foundation investigate using Che, which could probably have a version of Blueprint, adapted to run in its environment.

paul-marechal commented 3 years ago

Progress update: I managed to package a browser version of Blueprint.

My changes are on the following branch: https://github.com/eclipse-theia/theia-blueprint/tree/mp/browser-package

See theia-blueprint-linux-prototype-1.tar.gz for a prototype binary made on Ubuntu 16.04.

Doing this work revealed a few areas that could be improved in Theia, see https://github.com/eclipse-theia/theia-blueprint/blob/mp/browser-package/applications/browser/README.md#theia-blueprint-web, I'll open issues on the relevant repositories and see if I can come up with fixes.

paul-marechal commented 3 years ago

Note that an alternative to packaging could be to only bundle the backend using Webpack, and expecting people to run the minimized scripts using their own installed Node version (which would have to be compatible with our bundle).

The bundle size is roughly ~20MB IIRC, compared to ~200MB once packaged as executable.

The executable version is that much bigger because of the embedded Node runtime.

jfaltermeier commented 3 years ago

@paul-marechal @marcdumais-work Currently this is part of the Beta 1 milestone. We would plan to announce the move from Alpha to Beta end of June. Shall we move this ticket to the next milestone?

paul-marechal commented 3 years ago

@jfaltermeier sounds good.

czadikem commented 1 year ago

This still being worked on?

koegel commented 1 year ago

Just for completeness, this question was answered here, where it was also asked: https://github.com/eclipse-theia/theia-blueprint/issues/75#issuecomment-1408590806

shuaiyy commented 1 year ago

This is very helpful for our production environment:

  1. In CI, the image building can be accelerated by using ADD http://xxx/thiea-ide.tar.gz.
  2. for most case with-no nodejs/theia-ide pre-installed, containers can mount the host directory or download from remote storage when they need the pakage.
shuaiyy commented 1 year ago

hi @paul-marechal , Your contributions to the browser-package are highly valuable and significant,I want to know if it will work for the latest version.

I want to build a browser package with Node.js runtime, but I'm not familiar with Node.js. I've read thisGenerate webpack config for backend bundling

12412 and mp/browser-package , but I still don't know how to get started.

Can you provide some suggestions?