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

[Installer] Add the installer v2 documents #257

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions docs/contribute/installer_v2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
sidebar_position: 7
---

# Installer V2 Guide

## Overview

WasmEdge installer V2 is designed for installing the Core Tools (`wasmedge`, `wasmedge compile`), the Libraries (`libwasmedge`), and the WASI-NN GGML/GGUF Plugin..

## Dependencies

This is a pure shell script implementation. The only dependecies are `curl` or `wget` for downloading the tarballs, and `tar` for extracting them.


## Usage

```bash
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install_v2.sh | bash -s -- ${OPTIONS}
```

## Roles

### `install_v2.sh`

The installer entry point.

## Options

### Help Msg

- Short Option: `-h`
- Full Option: `--help`
- Description: Show the help message and exit.

### Verbose

- Short Option: `-V`
- Full Option: `--verbose`
- Description: Enable verbosity debug

### Specify the version of WasmEdge to install

- Short Option: `-v VERSION`
- Full Option: `--version=VERSION`
- Description: Install the given VERSION of WasmEdge
- Available Value: VERSION `{{ wasmedge_version }}` or other valid release versions.
- Note - If supplied an invalid or nonexistent version, the installer exits with an error.

### Installation path

- Short Option: `-p PATH`
- Full Option: `--path=PATH`
- Description: Install WasmEdge into the given PATH. The default Path is `$HOME/.wasmedge`.
- Note - Any paths other than the ones starting with `/usr` are treated as non-system paths in the internals of the installer. The consequences are different directory structures for both.

### Temporary directory

- Short Option: `-t PATH`
- Full Option: `--tmpdir=PATH`
- Description: Download the tarballs into the given PATH. The default Path is `/tmp`.
- Note - If the `/tmp` directory is not writable, the installer exits with an error. Please use this option to change the temporary directory.

### GGML/GGUF related options

#### Install CUDA version of the GGUF plugin

- Short Option: `-c cuda_version`
- Full Option: `--ggmlcuda=cuda_version[11/12]`
- Description: Install the specified CUDA version of the GGUF plugin. E.g. `11` for cuda-11, `12` for cuda-12.
- Note - The installer will try to detect the CUDA version if not specified. However, if the detection failed, you can specify the version using this option.

#### Specify the plugin version to install

- Short Option: `-b ggmlversion`
- Full Option: `--ggmlbn=ggmlversion`
- Description: Install the specified GGUF plugin. E.g. `b2963`.
- Note - Please use this option when you really know what you are doing.

### Platform and OS

- Short Option: `-o OS`
- Full Option: `--os=OS`
- Description: Install the given `OS` version of WasmEdge. This value should be case insensitive to make the maximum compatibility.
- Available Value (case insensitive): "Linux", "Darwin".

### Machine and Arch

- Short Option: `-a ARCH`
- Full Option: `--arch=ARCH`
- Description: Install the `ARCH` version of WasmEdge.
- Available Value: "x86\_64", "aarch64", "arm64".

## Behavior

- WasmEdge installation appends all the files it installs to a file which is located in the installer directory named `env` with its path as `$INSTALLATION_PATH/env`.

### Shell and it's configuration

- Source string in shell configuration is given as `. $INSTALLATION_PATH/env` so that it exports the necessary environment variables for WasmEdge.
- Shell configuration file is appended with source string if it cannot find the source string in that file.
- Currently, it detects only `Bash` and `zsh` shells.
- If the above shells are found, then their respective configuration files `$HOME/.bashrc` and `$HOME/.zshrc` are updated along with `$HOME/.zprofile` and `$HOME/.bash_profile` in the case of Linux.
- In the case of `Darwin`, only `$HOME/.zprofile` is updated with the source string.
1 change: 1 addition & 0 deletions docs/contribute/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ To help new contributors understand WasmEdge development workflow, this guide wi
- [WasmEdge Fuzzing](fuzzing.md)
- [WasmEdge internal explanation](internal.md)
- [WasmEdge installer system explanation](installer.md)
- [WasmEdge installer v2 system explanation](installer_v2.md)
- [contributing steps](contribute.md)
- [WasmEdge release process](release.md)
- [Join WasmEdge community](community.md)
Expand Down
Loading