Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit e3acf66

Browse files
authored
chore: updater docs (#1622)
* chore: updater docs * chore: add CLI command * chore: add updater to sidebars * chore: capitalize the Updater in the sidebar and page title
1 parent f231e76 commit e3acf66

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

docs/docs/architecture/updater.mdx

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: Updater
3+
description: Updater Overview.
4+
slug: "updater"
5+
---
6+
7+
import Tabs from "@theme/Tabs";
8+
import TabItem from "@theme/TabItem";
9+
10+
:::warning
11+
🚧 Cortex.cpp is currently under development. Our documentation outlines the intended behavior of Cortex, which may not yet be fully implemented in the codebase.
12+
:::
13+
14+
This document outlines the architectural design for a C++ updater responsible for downloading and executing installers for two binaries: CLI and Server.
15+
16+
## Overview
17+
18+
The updater is designed to check for available updates, download the necessary installer files, and execute them to update the CLI and Server binaries. The architecture consists of several key components that work together to achieve this functionality.
19+
20+
## Components
21+
22+
### 1. **Version Management Module**
23+
24+
- **Purpose**: Responsible for checking the current version of the installed binaries and determining if updates are available.
25+
- **Responsibilities**:
26+
- Retrieve the current version from local installations.
27+
- Fetch the latest version information from a remote source, latest version information is saved to `.cortexrc`.
28+
- Determine if an update is necessary based on version comparison.
29+
30+
### 2. **Installer Download Manager**
31+
32+
- **Purpose**: Handles downloading the installer files from specified URLs.
33+
- **Responsibilities**:
34+
- Manage HTTP requests to fetch installer files.
35+
- Handle errors during download.
36+
- Save downloaded installers in a temporary directory.
37+
38+
### 3. **Installer Execution Module**
39+
40+
- **Purpose**: Executes the downloaded installer files to perform updates.
41+
- **Responsibilities**:
42+
- Launch the installer with appropriate command-line arguments.
43+
- Monitor the installation process and capture any output or errors.
44+
- Ensure that installation completes successfully before proceeding.
45+
46+
### 4. **User Interface (CLI)**
47+
48+
- **Purpose**: Provides a command-line interface for users to initiate updates and view status messages.
49+
- **Responsibilities**:
50+
- Display current version information for CLI and Server: `cortex -v`
51+
- Inform users about available updates and progress during downloading and installation.
52+
- Handle user input for initiating updates: `(sudo) cortex update`
53+
54+
## Workflow
55+
56+
1. **Initialization**:
57+
- The updater starts and initializes all necessary modules.
58+
59+
2. **Version Check**:
60+
- The Version Management Module retrieves the current versions of both CLI and Server from local installations.
61+
- It fetches the latest version information from a remote source.
62+
63+
3. **Update Decision**:
64+
- If newer versions are available, the updater proceeds to download the installers; otherwise, it informs the user that no updates are necessary.
65+
66+
4. **Download Process**:
67+
- The Installer Download Manager downloads the latest installer files using HTTP requests.
68+
- Progress is reported back to the User Interface.
69+
70+
5. **Installer Execution**:
71+
- Once downloaded, the Installer Execution Module runs the installer with silent mode.
72+
- It monitors the installation process, capturing any output or errors.
73+
74+
6. **Completion Notification**:
75+
- After successful installation, the User Interface notifies users of completion or any issues encountered during installation.
76+
- Logs are updated with relevant information about the update process.

docs/sidebars.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ const sidebars: SidebarsConfig = {
7575
{ type: "doc", id: "architecture/data-folder", label: "Cortex Data Folder" },
7676
{ type: "doc", id: "architecture/cortex-db", label: "cortex.db" },
7777
{ type: "doc", id: "architecture/cortexrc", label: ".cortexrc" },
78+
{ type: "doc", id: "architecture/updater", label: "Updater" },
7879
]
7980
},
8081
{

0 commit comments

Comments
 (0)