-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d855f85
commit b5a0475
Showing
21 changed files
with
250 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
frontend/node_modules/ | ||
backend/vendor | ||
sqlc.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,8 @@ vendor/ | |
# Go workspace file | ||
go.work | ||
.env | ||
local.env | ||
local.yaml | ||
|
||
# Logs | ||
logs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
env: "local" | ||
log_path_agent: "../../log/agent.log" | ||
log_path_orchestrator: "../../log/orchestrator.log" | ||
log_path_auth: "../../log/auth.log" | ||
inactive_time_for_agent: 20 | ||
time_for_ping: 10 | ||
tokenTTL: 1h | ||
grpc_server: | ||
address: "localhost:44044" | ||
address: ":44044" | ||
grpc_client_connection_string: "auth:44044" | ||
rabbit_queue: | ||
rabbitmq_url: "amqp://guest:guest@localhost:5672/" | ||
rabbitmq_url: "amqp://guest:guest@rabbitmq:5672/" | ||
queue_for_expressions_to_agents: "Expressions to agents" | ||
queue_for_results_from_agents: "Results from agents" | ||
http_server: | ||
address: "localhost:3000" | ||
address: ":3000" | ||
timeout: 4s | ||
idle_timeout: 60s | ||
database_instance: | ||
goose_migration_dir: "./backend/sql/schema" | ||
storage_url: "postgres://postgres:6,62607004@localhost:5434/daec?sslmode=disable" | ||
storage_url: "postgres://postgres:postgres@db:5432/daec?sslmode=disable" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
DROP TYPE IF EXISTS agent_status; | ||
CREATE TYPE agent_status AS ENUM ('running', 'waiting', 'sleeping', 'terminated'); | ||
|
||
CREATE TABLE IF NOT EXISTS agents ( | ||
agent_id int GENERATED ALWAYS AS IDENTITY, | ||
number_of_parallel_calculations int NOT NULL DEFAULT 5, | ||
last_ping timestamp NOT NULL, | ||
status agent_status NOT NULL, | ||
|
||
PRIMARY KEY(agent_id) | ||
); | ||
|
||
ALTER TABLE agents ADD COLUMN created_at timestamp NOT NULL; | ||
|
||
CREATE TABLE IF NOT EXISTS users ( | ||
user_id int GENERATED ALWAYS AS IDENTITY, | ||
email text UNIQUE NOT NULL, | ||
password_hash bytea NOT NULL, | ||
|
||
PRIMARY KEY(user_id) | ||
); | ||
|
||
DROP TYPE IF EXISTS expression_status; | ||
CREATE TYPE expression_status AS ENUM ('ready_for_computation', 'computing', 'result', 'terminated'); | ||
|
||
CREATE TABLE IF NOT EXISTS expressions ( | ||
expression_id int GENERATED ALWAYS AS IDENTITY, | ||
user_id int NOT NULL, | ||
agent_id int, | ||
created_at timestamp NOT NULL, | ||
updated_at timestamp NOT NULL, | ||
data text NOT NULL, | ||
parse_data text NOT NULL, | ||
status expression_status NOT NULL, | ||
result int NOT NULL DEFAULT 0, | ||
is_ready boolean NOT NULL DEFAULT false, | ||
|
||
PRIMARY KEY(expression_id), | ||
FOREIGN KEY(agent_id) | ||
REFERENCES agents(agent_id) | ||
ON DELETE SET NULL, | ||
FOREIGN KEY(user_id) | ||
REFERENCES users(user_id) | ||
ON DELETE CASCADE | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS operations ( | ||
operation_id int GENERATED ALWAYS AS IDENTITY, | ||
operation_type varchar(1) NOT NULL, | ||
execution_time int NOT NULL DEFAULT 100, | ||
user_id int NOT NULL, | ||
|
||
PRIMARY KEY(operation_id), | ||
CONSTRAINT operation_type_user_id UNIQUE(operation_type, user_id), | ||
FOREIGN KEY(user_id) | ||
REFERENCES users(user_id) | ||
ON DELETE CASCADE | ||
); | ||
|
||
ALTER TABLE agents ADD COLUMN number_of_active_calculations int NOT NULL DEFAULT 0; |
Oops, something went wrong.