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

Run a project from a remote repository #147

Closed
Angelmmiguel opened this issue May 31, 2023 · 4 comments · Fixed by #152
Closed

Run a project from a remote repository #147

Angelmmiguel opened this issue May 31, 2023 · 4 comments · Fixed by #152
Assignees
Labels
🚀 enhancement New feature or request
Milestone

Comments

@Angelmmiguel
Copy link
Contributor

Is your feature request related to a problem? Please describe.

There are many different ways a project / workers could be stored. Currently, we are allowing only local resources by pointing wws to a system folder:

wws ./my-folder

However, this restriction introduces an extra step of downloading and configuring the project in the environment. wws can identify the resources based on the path, extension and protocol, and prepare the environment on behalf of the user.

Describe the solution you'd like

All the examples require you to clone / download workers. Ideally, the demos must be available in a single command:

wws https://github.com/vmware-labs/wasm-workers-server.git

wws must detect the resource and prepare the environment based on it. For this initial implementation, it will detect links that ends as .git to process them as git repositories. I would like to set other specific configurations related to git like:

  • --git-folder
  • --git-branch
  • --git-rev

Describe alternatives you've considered

The current alternative is to ask you to clone the repo in advance. We want to avoid this and simplify the process.

Additional context

Related issue from @k33g (#121).

@Angelmmiguel Angelmmiguel added the 🚀 enhancement New feature or request label May 31, 2023
@Angelmmiguel Angelmmiguel self-assigned this May 31, 2023
@Angelmmiguel
Copy link
Contributor Author

The first step to add this feature would be to identify a place to add this logic. wws goes through the following process every time you run it:

stateDiagram-v2
init: Initialize project
routes: Identify routes
workers: Prepare workers
server: Initialize server

[*] --> init
init --> routes
routes --> workers
workers --> server
server --> [*]

The project initialization requires:

  1. Load the project
  2. Install missing dependencies

Currently, the first step is not required as we only support the local filesystem. The second step is done as a separate step (wws runtimes install). Both steps are part of the same process as the project is not ready until the files are in the local filesystem and the runtimes are installed.

For me, it makes sense we consolidate these two steps into a single crate. For this reason, I will first rename the runtimes-manager crate into project to highlight the new scope.

@ereslibre
Copy link
Member

Thanks @Angelmmiguel! I agree with the assessment of the current situation.

For me, it makes sense we consolidate these two steps into a single crate. For this reason, I will first rename the runtimes-manager crate into project to highlight the new scope.

I agree in consolidating both steps in one crate. I like the new crate name, I think it is descriptive. Another alternative name could be wws-worker-initializer, which is more verbose. I think we can go with wws-project though.

@Angelmmiguel
Copy link
Contributor Author

Angelmmiguel commented Jun 2, 2023

Another topic that came to my mind is the projects that requires certain runtimes like Python or Ruby. I think that pulling them directly is not a good approach as we're downloading binaries from Internet. However, it's handy to install them automatically in this case.

For that reason, I'm going to add a new option to install the runtimes automatically. This will pull required runtimes right after preparing the project:

wws https://github.com/vmware-labs/wasm-workers-server.git \
  --git-folder examples/python-basic \
  --install-runtimes

@Angelmmiguel
Copy link
Contributor Author

I focused this task on cloning repositories using HTTP/S. Cloning with SSH requires more changes as it requires to get a SSH key from the system. I wanted to avoid adding too many changes in a single PR.

Reference: #151

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants