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

Homepage installation script one-liner #139

Open
danielledeleo opened this issue Apr 5, 2024 · 3 comments
Open

Homepage installation script one-liner #139

danielledeleo opened this issue Apr 5, 2024 · 3 comments

Comments

@danielledeleo
Copy link
Contributor

danielledeleo commented Apr 5, 2024

Part of improving the first touch experience. (See #137)

The NGINX Unit home page should prominently feature an easy way to get started with Unit.

Summary: we need a script that installs a CLI to control Unit and Unit itself. Our current scripts and guides are not suited to a one-liner.

Inspiration

rustup.rs offers a particularly spartan way to get going.

rustup.rs screenshot

Several ideas have been floated so far in private discussions in Unit team as to the best way to go from zero to serving requests with Unit.

Docker

Many production deployments of Unit use Docker, and it also happens to be a relatively simple way to get Unit onto developers' computers. We already have a fairly in-depth guide to running Unit in Docker, but it's not simple enough as is to be put on the home page as a one liner.

Current friction points when running Unit inside of Docker:

  • Control socket requires running curl inside the container (or restarting the container to pick up modified config file)
  • Users must manually compose images to get certain combinations of modules to work (PHP+Python+Wasm, e.g.)
    • We used to provide -full images to get around this.
  • Users have to get their application code into the container (usually a Docker --mount)

What this could look like today
rustup.rs screenshot

Questions:

  • Should these commands be hidden inside of a curl ... | sh one-liner? Is that helpful?
  • Can this example be simpler? (Suggestions welcome)
  • Would it be more helpful to show users a lightly customized Dockerfile example instead?

Personally, I don't think the above image presents a great first touch experience, and I'd be thrown off if all that happened from a shell piped script.

Local install

These options could be displayed intelligently on the home page by reading the client user agent.

On macOS with Homebrew, we already have a very good one-liner:

brew install nginx/unit/unit

On Linux (including WSL), we have our existing setup-unit script:

wget https://raw.githubusercontent.com/nginx/unit/master/tools/setup-unit && chmod +x setup-unit
sudo ./setup-unit repo-config
# ... apt, yum, etc.

What's missing is a reasonable way to run something in Unit quickly.

Proposed Solution

curl --proto '=https' --tlsv1.2 -sSf https://<SOME_URL>/setup.sh | sh

What this script should do is out of scope for this issue. See (todo: link to CLI issue)

@avahahn
Copy link
Contributor

avahahn commented Apr 18, 2024

I am a huge fan of having GH releases that offer a static compiled binary.
I think if we can settle on a path forward for our CLI we can offer a CLI binary that will deploy docker containers of NGINX Unit into a user's environment, and even configure them automatically.

Then we dont have to tell users to curl scripts into their shell, but can still offer a really fast self-serve experience.

@avahahn
Copy link
Contributor

avahahn commented Apr 19, 2024

Current friction points when running Unit inside of Docker:
Control socket requires running curl inside the container (or restarting the container to pick up modified config file)
unitc handles this problem in a clever way
Users must manually compose images to get certain combinations of modules to work (PHP+Python+Wasm, e.g.)
We used to provide -full images to get around this.
Users have to get their application code into the container (usually a Docker --mount)

Can I ask when we stopped providing the full images and why?
I figure a CLI could automatically mount a user's application project directory at time of deployment.

@danielledeleo danielledeleo removed their assignment May 23, 2024
@Jcahilltorre
Copy link
Collaborator

What is the status of this ticket @avahahn ? What do we need to do to keep this moving forward?

cc @callahad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants