Skip to content

Commit

Permalink
docs: version 1.1.0 (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
ifokeev authored Jan 26, 2024
1 parent 2353002 commit 4c127a4
Show file tree
Hide file tree
Showing 190 changed files with 2,144 additions and 376 deletions.
1 change: 0 additions & 1 deletion .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
cname: docs.synmetrix.org
27 changes: 1 addition & 26 deletions docs/development/contributing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,4 @@ When submitting code contributions, you must sign a [Developer Certificate of Or
This is my commit message

Signed-off-by: Random J Developer <random@developer.example.org>


The process is automatically managed by the Probot app for GitHub.

IDE Settings
The recommended development environment for Synmetrix is IntelliJ IDEA. Refer to the README for instructions on importing and configuring Synmetrix to work with IntelliJ IDEA.

Synmetrix does not enforce strict code formatting, but it is recommended to adhere to the following settings:

Use spaces for indentation
Tab size: 4
Indent: 4
Use single class import
Class count to use import with *: 99
Names count to use static import with *: 99
Imports layout:
<blank line>
import org.junit.*
import spock.lang.*
<blank line>
import java.*
import javax.*
<blank line>
all other imports
all other static imports
New files must include the appropriate license header boilerplate, author name(s), and contact email(s) (example).
```
155 changes: 137 additions & 18 deletions docs/development/local-development/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ sidebar_label: Local Development
sidebar_position: 1
---

## Backend

## Prerequisites

Before you can begin local development for Synmetrix, make sure you have the following prerequisites installed:
### Requirements

Before using the backend-side of the project, ensure that you have the following components installed:

- [Docker](https://docs.docker.com/install)
- [Docker Compose](https://docs.docker.com/compose/install)
- [Python3](https://www.python.org/downloads/) (with [pip3](https://pip.pypa.io/en/stable/installing/))
- [Node.js 8.9+](https://nodejs.org/en/download/) with [Yarn](https://classic.yarnpkg.com/en/docs/install) installed

## Getting Started
### Getting Started

1. Clone the Synmetrix repository:

Expand All @@ -32,34 +31,154 @@ Before you can begin local development for Synmetrix, make sure you have the fol
bash init.sh
```

## Starting the UI in Dev Mode

To start the UI in development mode, run the following command:
## Frontend

### Requirements

Before using the client-side of the project, ensure that you have the following components installed:

- **NodeJS:** Version 20.8.1 or higher.
- **Synmetrix Backend:** Ensure the [Synmetrix backend](https://github.com/mlcraft-io/mlcraft/) is properly set up and running.

### Installation

To install the client-side of the project, follow these steps:

```bash
python3 cli.py ui
# Clone the Synmetrix Client repository
git clone https://github.com/mlcraft-io/client-v2

# Navigate to the project directory
cd client-v2

# Install required packages using Yarn
yarn

# Start the client-side application
yarn start
```

Then, open your web browser and visit [http://localhost:3000](http://localhost:3000).
After completing these steps, open your web browser and go to [](http://localhost:8000) to access the Synmetrix client.

### Usage

For detailed guidance on utilizing the Synmetrix client and exploring its features, please consult the [Synmetrix Documentation](https://docs.synmetrix.org/).

## Managing Containers
### Storybook Integration

To manually start the containers, use the following command:
Explore the interactive UI components and functionalities of the Synmetrix client using Storybook. Storybook provides a convenient environment to showcase and test UI components in isolation.

To launch Storybook, use the following command:

```bash
python3 cli.py services up
yarn storybook
```
Once the command is executed, navigate to [](http://localhost:6007)

To destroy all services (note that volumes will still be present), run:
### Code Linting

```bash
python3 cli.py services destroy
Maintain code consistency and quality in the Synmetrix client by implementing linting. Follow these steps to configure linting in Visual Studio Code (VS Code):

#### Requirements:

- [ESLint Extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Prettier Extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)

#### Configuration:

1. Install ESLint and Prettier VS Code extensions.
2. Open your VS Code settings (settings.json) and add the following configuration:
```json
{
"eslint.enable": true,
"eslint.format.enable": true,
"editor.formatOnSave": true
}
```

This configures VS Code to run ESLint and Prettier on file save.

### Component Structure

In the Synmetrix project, components follow a consistent structure to enhance maintainability and organization. Each component typically consists of the following files:

1. **index.tsx:**
The main file containing the component's implementation. This file includes the React component code.

2. **index.module.less:**
A Less file containing the component's styles. Using module.less ensures that styles are scoped to the component and won't conflict with styles from other components.

3. **index.stories.tsx:**
A file dedicated to Storybook stories for the component. Storybook stories help in visually testing and documenting the component's variations and use cases.

4. **index.test.tsx:**
The file containing unit tests for the component using testing framework vitest. Writing tests ensures the reliability and correctness of the component's functionality.

Here's an example directory structure for a component named `ExampleComponent`:

```plaintext
/src
/components
/ExampleComponent
index.tsx
index.module.less
index.stories.tsx
index.test.tsx
```

For additional command-line options and information, you can check the available commands using:
### Testing

Ensure the reliability and correctness of the Synmetrix client by utilizing testing functionalities powered by Vitest. Vitest provides a robust testing framework to validate the behavior of your components and functionalities.

To run tests, use the following command:

```bash
python3 cli.py --help
yarn test
```

Executing this command will initiate the testing suite, allowing you to assess the client's performance and functionality. Any detected issues or failures will be highlighted, providing valuable insights for debugging and maintaining code quality.

### Build

Efficiently build and package the Synmetrix client with the following commands:

- **Build the Client:**
```bash
yarn build
```
This command utilizes Vite to build the Synmetrix client.

- **Post-Build Tasks:**
```bash
yarn postbuild
```
After the build, this command creates compressed archives (<b>dist.tar.gz</b> and <b>dist.zip</b>) of the generated distribution files.

- **Build Storybook:**
```bash
yarn build-storybook
```
Use this command to build the Storybook for the client.

- **Serve the Built Client Locally:**
```bash
yarn serve
```
This command previews the built client locally using Vite.

Incorporate these commands into your workflow to streamline the build process and prepare the Synmetrix client for deployment.

## Conventional Commits

We adhere to the Conventional Commits specification to ensure consistent and meaningful commit messages. The structure of our commits follows the pattern:

```
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
```

You also need to know a [Synmetrix System Architecture](/architecture-and-design/system-architecture/index.md)
For a detailed understanding of Conventional Commits, refer to the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/).
38 changes: 8 additions & 30 deletions docs/production-deployment/docker-swarm/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,27 @@ title: Docker Swarm deployment guide
slug: /docker-swarm
sidebar_label: Docker Swarm
---

# Docker Swarm deployment guide

## Run containers locally (staging mode)

```
# init docker swarm mode
docker swarm init
# if needed
# docker network rm mlcraft_default
./create-overlay-network.sh
# create overlay swarm network
./scripts/create-overlay-network.sh
# run local docker registry
./run-registry.sh
# build images and push
DOMAIN=localhost REGISTRY_HOST=127.0.0.1:50001 python3 cli.py --env stage services push
# up the stack
DOMAIN=localhost REGISTRY_HOST=127.0.0.1:50001 python3 cli.py --env stage services up mlcraft_bi
DOMAIN=localhost REGISTRY_HOST=127.0.0.1:50001 python3 cli.py --env stage services up synmetrix
```

:::note

default docker registry url is `index.docker.io`

:::

Then run migrations:

```
Expand All @@ -41,32 +34,17 @@ Then run migrations:
### Destroy stack

```
python3 cli.py --env stage services destroy mlcraft_bi
python3 cli.py --env stage services destroy synmetrix
```

### Show logs

```
python3 cli.py --env stage services logs mlcraft_bi_hasura
python3 cli.py --env stage services logs synmetrix_hasura
```

### Show stack tasks status

```
python3 cli.py --env stage services ps mlcraft_bi
```

### Bugs

If you see:

```
failed to create service app_nginx: Error response from daemon: rpc error: code = FailedPrecondition desc = service needs ingress network, but no ingress network is present
```

Just create the ingress network:

python3 cli.py --env stage services ps synmetrix
```
docker network create --ingress --driver overlay ingress
```
12 changes: 6 additions & 6 deletions docs/production-deployment/requirements/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ title: Requirements
slug: /production-deployment/requirements/
sidebar_label: Requirements
---

## Hardware Requirements

Synmetrix is intended for installation and use on servers equipped with processors supporting x86-64 architecture and based on operating systems such as Ubuntu Server 22.04 and higher.
Synmetrix is intended for installation and use on servers equipped with processors supporting x86-64 architecture and based on operating systems such as Ubuntu Server 18.04 and higher.

**Minimum Hardware Requirements**:

```bash
- Processor (CPU): 3.2 GHz or higher, modern processor with multi-threading and virtualization support.
- RAM: 16 GB or more to handle computational tasks and data processing.
- Disk Space: At least 100 GB of free space for software installation and storing working data.
- RAM: 8 GB or more to handle computational tasks and data processing.
- Disk Space: At least 30 GB of free space for software installation and storing working data.
- Network: Internet connectivity is required for cloud services and software updates.
```


:::note

These requirements are minimum and may vary depending on specific use cases and data processing volumes. Scaling the solution may require more powerful servers or distributed systems.

:::

## Source Code
You can access the source code of Synmetrix on [GitHub](https://github.com/mlcraft-io/mlcraft).

You can access the source code of Synmetrix on [GitHub](https://github.com/mlcraft-io/mlcraft).
Loading

0 comments on commit 4c127a4

Please sign in to comment.