Skip to content

Commit

Permalink
feature: added updated diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
YarikRevich committed Jun 14, 2024
1 parent a8ccfd5 commit f2abb05
Show file tree
Hide file tree
Showing 15 changed files with 126 additions and 96 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# RepoAchiever

[![Build](https://github.com/YarikRevich/ResourceTracker/actions/workflows/build.yml/badge.svg)](https://github.com/YarikRevich/ResourceTracker/actions/workflows/build.yml)
[![Build](https://github.com/YarikRevich/RepoAchiever/actions/workflows/build.yml/badge.svg)](https://github.com/YarikRevich/ResourceTracker/actions/workflows/build.yml)
![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black)
![MacOS](https://img.shields.io/badge/MacOS-8773f5?style=for-the-badge&logo=macos&logoColor=black)
[![StandWithUkraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)

## General Information

A tool used for remote Git repositories achieving operations.
A tool used for remote content achieving operations.

![](./docs/high-level-design.png)

![](./docs/detailed-design.png)
![](./docs/detailed-design-raw.png)

![](./docs/workspace-design.png)
![](./docs/internal-storage-design.png)

RepoAchiever uses server-side data validation. It means, that on client side no data transformation or further analysis are made.
Only API Server calls are on client side responsibility.
Expand All @@ -31,7 +31,7 @@ make build-cli

After the execution of command given above the executable will be generated and placed into **bin** folder in the root directory of the project

**CLI** build automatically places default **user.yaml** configuration file into ~/.resourcetracker/config directory.
**CLI** build automatically places default **user.yaml** configuration file into ~/.repoachiever/config directory.

### GUI

Expand All @@ -42,7 +42,7 @@ make build-gui

After the execution of command given above the executable will be generated and placed into **bin** folder in the root directory of the project

**GUI** build automatically compiles **API Server** and places both executable JAR and other dependencies into **~/.resourcetracker/bin/api-server** directory
**GUI** build automatically compiles **API Server** and places both executable JAR and other dependencies into **~/.repoachiever/bin/api-server** directory

It's highly recommended not to move **API Server** files from the default local directory

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ public class PropertiesEntity {
@Value(value = "${git.commit.id.abbrev}")
private String gitCommitId;

@Value(value = "${rest-client.timeout}")
private String restClientTimeout;

@Value(value = "${config.default.location}")
private String configDefaultLocation;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,7 @@ private void version(
return;
}

try {
versionExternalCommandService.process(configService.getConfig());
} catch (ApiServerOperationFailureException e) {
logger.fatal(e.getMessage());

return;
}
versionExternalCommandService.process(configService.getConfig());

visualizationService.await();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.repoachiever.service.client.info.version.VersionInfoClientService;
import com.repoachiever.service.command.common.ICommand;
import com.repoachiever.service.visualization.state.VisualizationState;
import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

Expand All @@ -24,7 +25,7 @@ public class VersionExternalCommandService implements ICommand<ConfigEntity> {
/**
* @see ICommand
*/
public void process(ConfigEntity config) throws ApiServerOperationFailureException {
public void process(ConfigEntity config) {
visualizationState.getLabel().pushNext();

VersionInfoClientService versionInfoClientService =
Expand All @@ -36,11 +37,12 @@ public void process(ConfigEntity config) throws ApiServerOperationFailureExcepti
visualizationState.addResult(
String.format(
"API Server version: %s", versionInfoResult.getExternalApi().getHash()));
} finally {
visualizationState.addResult(
String.format("Client version: %s", properties.getGitCommitId()));
} catch (ApiServerOperationFailureException ignored) {
}

visualizationState.addResult(
String.format("Client version: %s", properties.getGitCommitId()));

visualizationState.getLabel().pushNext();
}
}
3 changes: 3 additions & 0 deletions cli/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Describes Spring related properties.
spring.main.web-application-type=NONE

# Describes timeout used for RepoAchiever API Server client.
rest-client.timeout=15

# Describes location of application configuration file.
config.default.location=${user.home}/.repoachiever/config/user.yaml

Expand Down
96 changes: 58 additions & 38 deletions docs/detailed-design-raw.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,75 +2,95 @@
!pragma teoz true
title
Detailed design of "ResourceTracker"
Detailed design of "RepoAchiever"
end title
box "External environment" #MOTIVATION
actor "Client" as client
actor "Diagnostics" as diagnostics
end box
box "Control plain" #MOTIVATION
participant "API Server" as apiserver
database "Local storage" as localstorage
entity "Metrics registry" as metricsregistry
box "Cloud environment" #Lavender
queue "Kafka" as kafka
participant "Kafka starter" as kafkastarter
participant "Agent" as agent
entity "Cloud provider" as cloudprovider
box "Decentralized environment" #Lavender
participant "Cluster" as cluster
entity "Worker" as worker
end box
end box
note over [[[[[[kafka]]]]]]: Kafka is considered to be used in persisted mode
box "Third-party environment" #MOTIVATION
entity "External service" as externalservice
end box
opt "endpoints"
opt "/v1/secrets/acquire [POST]"
apiserver -> cloudprovider: validate provided credentials
cloudprovider -> apiserver: validation result
opt "/v1/content [POST]"
localstorage -> apiserver: retrieve details about all the available content for the given user
end
opt "/v1/topic/logs [GET]"
apiserver -> kafka: retrieve state for the given "logs" topic
kafka -> apiserver: transform data stream according to the specified filters
opt "/v1/content/apply [POST]"
apiserver -> externalservice: validate provided credentials
apiserver -> localstorage: apply provided user configuration
apiserver -> cluster: update topology according to the new configuration
end
opt "/v1/terraform/apply [POST]"
apiserver -> cloudprovider: deploy resource tracking infrastructure
apiserver -> kafkastarter: request kafka cluster startup
kafkastarter -> kafka: start kafka cluster
opt "/v1/content/withdraw [DELETE]"
apiserver -> localstorage: remove configuration for the given user
apiserver -> cluster: remove topology
end
opt "/v1/terraform/destroy [POST]"
apiserver -> cloudprovider: destroy resource tracking infrastructure
opt "/v1/content/download [POST]"
localstorage -> apiserver: retrieve requested content in a form of achieve
end
opt "/v1/content/clean [DELETE]"
apiserver -> localstorage: remove requested content for the given user
end
opt "/v1/content/clean/all [DELETE]"
apiserver -> localstorage: remove all content for the given user
end
opt "agent execution flow"
agent -> cloudprovider: execute remote operations
agent <-- cloudprovider: remote operation result
agent --> kafka: push latest resource state to "logs" topic
opt "cluster execution flow"
cluster -> worker: allocate instances according to the provided locations
worker -> externalservice: retrieve content with the given identification
worker -> apiserver: transfer retrieved content
end
opt "requests"
note over client: Uses properties specified in a client\nconfiguration file located in\n a common directory
opt "credentials validation"
client -> apiserver: /v1/secrets/acquire [POST]
opt "retrieve available content"
client -> apiserver: /v1/content [POST]
end
opt "configuration application"
client -> apiserver: /v1/content/apply [POST]
end
opt "script validation"
client -> apiserver: /v1/script/acquire [POST]
opt "configuration withdrawal"
client -> apiserver: /v1/content/withdraw [DELETE]
end
opt "download content"
client -> apiserver: /v1/content/download [POST]
end
opt "clean selected content"
client -> apiserver: /v1/content/clean [DELETE]
end
opt "clean all the content for the given user"
client -> apiserver: /v1/content/clean/all [DELETE]
end
opt "health check"
client -> apiserver: /v1/health [GET]
end
opt "readiness check"
client -> apiserver: /v1/readiness [GET]
end
opt "version validation"
opt "version retrieval"
client -> apiserver: /v1/info/version [GET]
end
opt "infrustructure deployment"
client -> apiserver: /v1/terraform/apply [POST]
opt "topology retrieval"
client -> apiserver: /v1/info/topology [GET]
end
opt "infrustructure clean up"
opt ""
client -> apiserver: /v1/terraform/destroy [POST]
end
opt "state retrieval"
client -> apiserver: /v1/topic/logs [GET]
end
opt "metrics retrieval"
diagnostics -> metricsregistry: / [GET]
end
end
```
Binary file added docs/detailed-design-raw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/detailed-design.png
Binary file not shown.
23 changes: 0 additions & 23 deletions docs/high-level-design-raw.md

This file was deleted.

33 changes: 33 additions & 0 deletions docs/high-level-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
```plantuml
title
High-level design of "RepoAchiever"
end title
cloud "External environment" {
actor "Client"
actor "Diagnostics"
}
component "Control plane" {
node "API Server"
node "Metrics registry"
cloud " Decentralized environment" {
node "Cluster"
entity "Worker"
}
}
cloud " Third-party environment" {
entity "External service"
}
[Client] <--> [API Server]: " Send requests"
[API Server] <-> [Cluster]: " Schedule content processing"
[Cluster] <--> [Worker]: " Propagate individual requests "
[Worker] <--> [External service]: " Retrieve content"
[API Server] <-- [Metrics registry]: " Retrieve metrics"
[Diagnostics] --> [Metrics registry]: " Scrap metrics"
```
Binary file modified docs/high-level-design.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions docs/internal-storage-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```plantuml
@startwbs
title
Internal storage design of "RepoAchiever"
end title
* Workspace unit
** Repository
*** Raw
**** N-versions
*** Additional(PRs)
**** N-versions
@endwbs
```
Binary file added docs/internal-storage-design.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 0 additions & 18 deletions docs/workspace-design.md

This file was deleted.

Binary file removed docs/workspace-design.png
Binary file not shown.

0 comments on commit f2abb05

Please sign in to comment.