Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
ilbertt committed May 18, 2024
2 parents 7589fcf + fd781cd commit aec66a8
Show file tree
Hide file tree
Showing 751 changed files with 54,785 additions and 57,663 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/docker-build-stats-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Stats Web CI

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Check for changes in stats-web folder
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
stats-web:
- 'stats-web/**'
- name: Build the Docker image
if: steps.filter.outputs.stats-web == 'true'
run: docker build ./stats-web/
59 changes: 55 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ docker-compose up
```
This command spins up the database service and automatically handles the downloading and importing of the specified data.


```bash

# Database Structure

The database schemas is defined using [sequelize-typescript](https://github.com/sequelize/sequelize-typescript) in [/shared/dbSchemas/](./shared/dbSchemas/). Models are separated into the following folders:
Expand Down Expand Up @@ -311,12 +308,18 @@ Created for each days (UTC based), simplifies querying for daily stats.
|owner|varchar|Address of the wallet that owns this provider
|hostUri|varchar|ex: `https://provider.europlots.com:8443`
|createdHeight|integer|Height at which the provider is created on-chain. (`MsgCreateProvider`)
|updatedHeight|integer|Height at which the provider was last updated. (`MsgUpdateProvider`)
|deletedHeight|integer|Height at which the provider is deleted on-chain. (`MsgDeleteProvider`)
|email|varchar
|website|varchar
|isOnline|boolean|Indicates if the latest uptime check was successful
|lastCheckDate|timestamp|Date & Time of the latest uptime check
|error|text|`null` if the latest uptime check was successful, otherwise this wil contain the error message.
|lastSnapshotId|uuid|ID of the last snapshot taken
|nextCheckDate|timestamp|Planned Date & Time of the next uptime check
|failedCheckCount|integer|Amount of consecutive failed checks, `NULL` if currently online.
|lastSuccessfulSnapshotId|uuid|Snapshot ID of the last successful check
|downtimeFirstSnapshotId|uuid|Snapshot ID of the first failed check of the current downtime period. `NULL` if currently online.
|error|text|`NULL` if the latest uptime check was successful, otherwise this wil contain the error message.
|deploymentCount|integer
|leaseCount|integer
|activeCPU|bigint|Thousandth of CPU
Expand Down Expand Up @@ -368,6 +371,7 @@ Similar to stats on the [Provider](#provider), but a new row is inserted for eve
|id|uuid|
|owner|varchar|Address of the wallet that owns this provider
|isOnline|boolean|Indicates if this uptime check was successful
|isLastOfDay|boolean|Indicates if this is the last snapshot of the day for this provider
|checkDate|timestamp|Date & Time of this uptime check
|error|text|`null` if the uptime check was successful, otherwise this wil contain the error message.
|deploymentCount|integer
Expand All @@ -382,6 +386,53 @@ Similar to stats on the [Provider](#provider), but a new row is inserted for eve
|availableMemory|bigint|Memory in bytes
|availableStorage|bigint|Storage in bytes

## ProviderSnapshotNodes

Keep track of ressources of individual provider nodes obtained through feature discovery.

|Column|Type|Note|
|-|-|-
|id|uuid
|snapshotId|uuid|Snapshot ID
|name|varchar|Name of the node
|cpuAllocatable|bigint|Thousandth of CPU
|cpuAllocated|bigint|Thousandth of CPU
|memoryAllocatable|bigint|Memory in bytes
|memoryAllocated|bigint|Memory in bytes
|ephemeralStorageAllocatable|bigint|Storage in bytes
ephemeralStorageAllocated|bigint|Storage in bytes
|capabilitiesStorageHDD|boolean|Indicates if the node supports HDD storage
|capabilitiesStorageSSD|boolean|Indicates if the node supports SSD storage
|capabilitiesStorageNVME|boolean|Indicates if the node supports NVME storage
|gpuAllocatable|bigint
|gpuAllocated|bigint

## ProviderSnapshotNodeCPU

Store CPU informations for each [Provider Nodes](#providersnapshotnodes)

|Column|Type|Note
|-|-|-
|id|uuid
|snapshotNodeId|uuid|Snapshot node ID
|vendor|varchar|ex: `GenuineIntel`
|model|varchar|ex: `Intel(R) Xeon(R) CPU @ 2.30GHz`
|vcores|smallint|

## ProviderSnapshotNodeGPU

Store GPU informations for each [Provider Nodes](#providersnapshotnodes)

|Column|Type|Note
|-|-|-
|id|uuid
|snapshotNodeId|uuid|Snapshot node ID
|vendor|varchar|ex: `nvidia`
|name|varchar|Model name (ex: `rtx4090`)
|modelId|varchar|On the provider, this gets mapped to vendor, name, interface and memorySize based on [this file](https://github.com/akash-network/provider-configs/blob/main/devices/pcie/gpus.json).
|interface|varchar|ex: `PCIe`
|memorySize|varchar|ex: `24Gi`

## Template

|Column|Type|Note|
Expand Down
3 changes: 0 additions & 3 deletions api/.env.functional.test

This file was deleted.

1 change: 1 addition & 0 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ When running the api locally the following environment variables can be set in a
|-|-|-
Network|`mainnet` or `testnet`|Specify if the api should be in mainnet or testnet mode. Default: `mainnet`.
RestApiNodeUrl|ex: `"https://api.akashnet.net"`|Rest api to use. Will default to `"https://rest.cosmos.directory/akash"` for mainnet and `"https://api.testnet-02.aksh.pw:443"` for testnet.
ServerOrigin|ex: `http://localhost:3080`|Origin of the api server. Will be used to populate the swagger server list.
HealthchecksEnabled|`true` or `false`|Specify if the [Scheduler](./src/index.ts#L42) should send health check pings.
SentryDSN|ex: `"https://[email protected]/1234"`|[Sentry DSN](https://docs.sentry.io/product/sentry-basics/dsn-explainer/) used when [initializing](./src/index.ts#L29) Sentry
AkashDatabaseCS|ex: `postgres://user:password@localhost:5432/cloudmos-akash`|Akash Database Connection String
Expand Down
35 changes: 18 additions & 17 deletions api/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
const MAP_ALIASES = {
'^@src(.*)$': "<rootDir>/src$1",
'^@shared/(.*)$': '<rootDir>/../shared/$1',
"^@src(.*)$": "<rootDir>/src/$1",
"^@test/(.*)$": "<rootDir>/test/$1",
"^@shared/(.*)$": "<rootDir>/../shared/$1"
};
const MAP_TO_SAME_SEQUELIZE_PACKAGE = {
'^sequelize(.*)$': '<rootDir>/node_modules/sequelize$1',
}
"^sequelize(.*)$": "<rootDir>/node_modules/sequelize$1"
};

const common = {
transform: {
'^.+\\.(t|j)s$': ['ts-jest', { tsconfig: './tsconfig.json' }],
"^.+\\.(t|j)s$": ["ts-jest", { tsconfig: "./tsconfig.json" }]
},
rootDir: '.',
rootDir: ".",
moduleNameMapper: {
...MAP_ALIASES,
...MAP_TO_SAME_SEQUELIZE_PACKAGE,
...MAP_TO_SAME_SEQUELIZE_PACKAGE
},
setupFiles: ['./test/setup.ts'],
setupFiles: ["./test/setup.ts"]
};

module.exports = {
collectCoverageFrom: ['./src/**/*.{js,ts}'],
collectCoverageFrom: ["./src/**/*.{js,ts}"],
projects: [
{
displayName: 'unit',
displayName: "unit",
...common,
testMatch: ['<rootDir>/src/**/*.spec.ts'],
setupFilesAfterEnv: ['./test/setup-unit-tests.ts'],
testMatch: ["<rootDir>/src/**/*.spec.ts"],
setupFilesAfterEnv: ["./test/setup-unit-tests.ts"]
},
{
displayName: 'functional',
displayName: "functional",
...common,
testMatch: ['<rootDir>/test/functional/**/*.spec.ts'],
setupFilesAfterEnv: ['./test/setup-functional-tests.ts'],
},
],
testMatch: ["<rootDir>/test/functional/**/*.spec.ts"],
setupFilesAfterEnv: ["./test/setup-functional-tests.ts"]
}
]
};
Loading

0 comments on commit aec66a8

Please sign in to comment.