Skip to content

Commit

Permalink
docs: update some notes
Browse files Browse the repository at this point in the history
  • Loading branch information
BobAnkh committed Oct 30, 2024
1 parent c5342ed commit 4db55da
Show file tree
Hide file tree
Showing 9 changed files with 222 additions and 42 deletions.
128 changes: 128 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
thuburrow.com.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
8 changes: 7 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ Follow the official [naming convention](https://rust-lang.github.io/api-guidelin

## Building Mitosis

Mitosis builds on stable Rust, if you want to build mdBook from source, here are the steps to follow:
### Dependencies

You have to install pkg-config, libssl-dev if you want to build the binary from source.

### Building

Mitosis builds on stable Rust, if you want to build it from source, here are the steps to follow:

1. Navigate to the directory of your choice
2. Clone this repository with git.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

**Mitosis** is a Rust library and a command line tool to run distributed platforms for transport research.

This guide is an example of how to use Mitosis to run a simple distributed platform to parallelize your tasks.
This guide is an example of how to use **Mitosis** to run a simple distributed platform to parallelize your tasks.
It is designed for transport-layer research, but it can be used for any other purpose.

## Usage

Please check our [User Guide](https://stack.rs/mitosis/guide) for how to use Mitosis.
Please check our [User Guide](https://docs.stack.rs/mitosis) for how to use **Mitosis**.

## Contributing

Mitosis is free and open source. You can find the source code on
**Mitosis** is free and open source. You can find the source code on
[GitHub](https://github.com/stack-rs/mitosis) and issues and feature requests can be posted on
the [GitHub issue tracker](https://github.com/stack-rs/mitosis/issues). Mitosis relies on the community to fix bugs and
the [GitHub issue tracker](https://github.com/stack-rs/mitosis/issues). **Mitosis** relies on the community to fix bugs and
add features: if you'd like to contribute, please read
the [CONTRIBUTING](https://github.com/stack-rs/mitosis/blob/master/CONTRIBUTING.md) guide and consider opening
a [pull request](https://github.com/stack-rs/mitosis/pulls).
12 changes: 12 additions & 0 deletions guide/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
This guide is an example of how to use Mitosis to run a simple distributed platform to parallelize your tasks.
It is designed for transport-layer research, but it can be used for any other purpose.

## Basic Workflow

The Mitosis CLI tool is a single binary that provides subcommands for starting the Coordinator, Worker and Client processes.

Users function as units for access control, while groups operate as units for tangible resource control.
Every user has an identically named group but also has the option to create or join additional groups.

Users can delegate tasks to various groups via the Client, which are then delivered to the Coordinator and subsequently executed by the corresponding Worker.
Each Worker can be configured to permit specific groups and carry tags to denote its characteristics.

Tasks, once submitted, are distributed to different Workers based on their groups and tags. Every task is assigned a unique UUID, allowing users to track the status and results of their tasks.

## Contributing

Mitosis is free and open source. You can find the source code on
Expand Down
2 changes: 1 addition & 1 deletion guide/src/client/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ netmito = "0.1"

Here is a simple example of how to create a new user using the SDK:

```rust
```rust,ignore
# use netmito::client::MitoClient;
# use netmito::config::client::{ClientConfig, CreateUserArgs};
#
Expand Down
21 changes: 14 additions & 7 deletions guide/src/guide/client.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
# Running a Client

A Client is a process that interact with the Coordinator. It is responsible for creating tasks, querying their results, and managing workers or groups. The Client is a short-lived process that is typically run on-demand.
A Client is a process that interact with the Coordinator.
It is responsible for creating tasks, querying their results, and managing workers or groups.
The Client is a short-lived process that is typically run on-demand.

## Starting a Client

While it's possible to provide a TOML configuration file to the client, it's often unnecessary given the limited number of configuration items, all of which pertain to login procedures.
While it's possible to provide a TOML configuration file to the client,
it's often unnecessary given the limited number of configuration items, all of which pertain to login procedures.

Typically, to start a Client, we can simply run the following command to enter interactive mode:

```sh
```bash
mito client -i
```

If a user has never logged in or if his/her session has expired, the Client will prompt them to re-input their username and password for authentication. Alternatively, they can directly specify their username (`-u`) or password (`-p`) during execution. Once authenticated, the Client will retain their credentials in a file for future use.
If a user has never logged in or if his/her session has expired, the Client will prompt them to re-input their username and password for authentication.
Alternatively, they can directly specify their username (`-u`) or password (`-p`) during execution.
Once authenticated, the Client will retain their credentials in a file for future use.

We recommend using the interactive mode for most operations, as it provides a more user-friendly experience.

We can also directly run a command without entering interactive mode by specifying the command as an argument. For example, to create a new user, we can run:
We can also directly run a command without entering interactive mode by specifying the command as an argument.
For example, to create a new user, we can run:

```sh
```bash
mito client create user -u new_user -p new_password
```

Expand Down Expand Up @@ -49,7 +55,8 @@ Options:
-V, --version Print version
```

To know how each subcommand works, you can run `mito client <subcommand> --help`. For example, to know how to create a new user, you can run `mito client create user --help`:
To know how each subcommand works, you can run `mito client <subcommand> --help`.
For example, to know how to create a new user, you can run `mito client create user --help`:

```txt
Create a new user
Expand Down
44 changes: 32 additions & 12 deletions guide/src/guide/coordinator.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
# Running a Coordinator

A Coordinator is a process that manages the execution of a workflow. It is responsible for scheduling tasks, tracking their progress, and handling failures. The Coordinator is a long-running process that is typically deployed as a service.
A Coordinator is a process that manages the execution of a workflow.
It is responsible for scheduling tasks, tracking their progress, and handling failures.
The Coordinator is a long-running process that is typically deployed as a service.

## External Requirements

The Coordinator requires access to several external services.
It needs a PostgreSQL database to store data, an S3-compatible storage service to store task artifacts or group attachments.
The Redis server is an optional service that acts as a pub/sub provider,
enabling clients to subscribe to and query more comprehensive details regarding the execution status of tasks.

For those services, you can use the docker-compose file provided in the repository.
First, Copy `.env.example` to `.env` and set the variables in it.
And then, run the following command to start the services:

```bash
docker-compose up -d
```

The Coordinator also requires a private and public key pair to sign and verify access tokens.
For the private and public keys, you can generate them using the following commands:

```bash
openssl genpkey -algorithm ed25519 -out private.pem
openssl pkey -in private.pem -pubout -out public.pem
```

## Starting a Coordinator

To start a Coordinator, you need to provide a TOML file that configures the Coordinator. The TOML file specifies the Coordinator's configuration, such as the address it binds to, the URL of the postgres database, and token expiry settings. All configuration options are optional and have default values.
To start a Coordinator, you need to provide a TOML file that configures the Coordinator.
The TOML file specifies the Coordinator's configuration, such as the address it binds to, the URL of the postgres database, and token expiry settings.
All configuration options are optional and have default values.

Here is an example of a Coordinator configuration file:
Here is an example of a Coordinator configuration file (you can also refer to `config.example.toml` in the repository):

```toml
[coordinator]
Expand All @@ -28,16 +55,9 @@ file_log = false
# log_path is not set. It will use the default rolling log file path if file_log is set to true
```

For the private and public keys, you can generate them using the following commands:

```sh
openssl genpkey -algorithm ed25519 -out private.pem
openssl pkey -in private.pem -pubout -out public.pem
```

To start a Coordinator, run the following command:

```sh
```bash
mito coordinator --config /path/to/coordinator.toml
```

Expand All @@ -47,7 +67,7 @@ We can also override the configuration settings using command-line arguments.
Note that the names of command-line arguments may not be the same as those in the configuration file.
For example, to change the address the Coordinator binds to, you can run:

```sh
```bash
mito coordinator --config /path/to/coordinator.toml --bind 0.0.0.0:8000
```

Expand Down
27 changes: 15 additions & 12 deletions guide/src/guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ and a SDK library (named `netmito`) that you can use to create your own client.
There are multiple ways to install the Mitosis CLI tool.
Choose any one of the methods below that best suit your needs.

> **ATTENTION**: As we are still in the early stages of development without a released version, we only support building from source currently.
## Pre-compiled binaries

Executable binaries are available for download on the [GitHub Releases page][releases].
Download the binary and extract the archive.
The archive contains an `mito` executable which you can run to start your distributed platform.

To make it easier to run, put the path to the binary into your `PATH` or install it in a directory that is already in your `PATH`.
For example, do `sudo install mito /usr/local/bin/mito` on Linux.
For example, do `sudo install -m 755 mito /usr/local/bin/mito` on Linux.

[releases]: https://github.com/stack-rs/mitosis/releases

Expand All @@ -23,14 +25,14 @@ For example, do `sudo install mito /usr/local/bin/mito` on Linux.

You have to install pkg-config, libssl-dev if you want to build the binary from source.

### Building
### Installing with Cargo

To build the `mito` executable from source, you will first need to install Rust and Cargo.
Follow the instructions on the [Rust installation page].

Once you have installed Rust, the following command can be used to build and install mito:

```sh
```bash
cargo install mito
```

Expand All @@ -44,28 +46,29 @@ To uninstall, run the command `cargo uninstall mito`.
[Rust installation page]: https://www.rust-lang.org/tools/install
[crates.io]: https://crates.io/

### Installing the latest master version
### Installing the latest git version with Cargo

The version published to crates.io will ever so slightly be behind the version hosted on GitHub.
If you need the latest version you can build the git version of mito yourself.
Cargo makes this ***super easy***!

```sh
```bash
cargo install --git https://github.com/stack-rs/mitosis.git mito
```

Again, make sure to add the Cargo bin directory to your `PATH`.

## Basic Workflow

The Mitosis CLI tool is a single binary that provides subcommands for starting the Coordinator, Worker and Client processes.
### Building from source

Users function as units for access control, while groups operate as units for tangible resource control.
Every user has an identically named group but also has the option to create or join additional groups.
If you want to build the binary from source, you can clone the repository and build it using Cargo.

Users can delegate tasks to various groups via the Client, which are then delivered to the Coordinator and subsequently executed by the corresponding Worker. Each Worker can be configured to permit specific groups and carry tags to denote its characteristics.
```bash
git clone https://github.com/stack-rs/mitosis.git
cd mitosis
cargo build --release
```

Tasks, once submitted, are distributed to different Workers based on their groups and tags. Every task is assigned a unique UUID, allowing users to track the status and results of their tasks.
Then you can find the binary in `target/release/mito` and install or run it as you like.

## Modifying and contributing

Expand Down
Loading

0 comments on commit 4db55da

Please sign in to comment.