Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new conductor api #311

Draft
wants to merge 72 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
ae0ff33
FD-495 definition list query (#262)
soson Mar 21, 2023
3895c6b
Executed workflow query (#264)
MarcoMruz Mar 23, 2023
9ff7af0
Pause resume wf mutations (#265)
MarcoMruz Mar 27, 2023
ea3582a
fix typescript error of nonexisting property
MarcoMruz Mar 27, 2023
47cba94
FD-496 workflow definition mutations (#267)
soson Mar 27, 2023
5a7d0fe
add scheduler api to inventory server (#270)
soson Mar 28, 2023
9a29bb7
workflow labels query added (#271)
soson Mar 28, 2023
2a8bb52
Add mutation execute workflow (#268)
MarcoMruz Mar 29, 2023
941bc00
FD-504 workflow filters (#272)
soson Mar 30, 2023
b9eeff4
Add workflow input params (#273)
soson Mar 30, 2023
0cd6187
Retry, restart, terminate and remove workflow mutations (#269)
MarcoMruz Mar 30, 2023
9f718d0
FD-517 task definitions query (#274)
soson Apr 5, 2023
6c869ae
Merge branch 'master' into story-new-conductor-api
soson Apr 17, 2023
9d09d98
bulk operations added (terminate, restart, retry) (#275)
soson Apr 17, 2023
d507c3c
add workflow instance detail query (#278)
soson Apr 17, 2023
24cba7f
instance detail query fix (#283)
soson Apr 19, 2023
f2601c3
bulk executed workflow id fix (#285)
soson Apr 20, 2023
3553a5a
FD-526 new workflow attributes (#287)
soson May 4, 2023
7d71fad
Add graphql scheduler (#289)
MarcoMruz May 10, 2023
abb7b03
FD-527 custom connection from array (#288)
soson May 10, 2023
e2d5826
unify workflow mutation input (#291)
soson May 11, 2023
905c656
add status to schedule (#292)
MarcoMruz May 15, 2023
f2a3974
Workflow status subscription (#293)
MarcoMruz May 22, 2023
38ef6f2
Change executed task query (#307)
MarcoMruz Jun 7, 2023
4435f83
Merge branch 'master' into story-new-conductor-api
soson Jun 8, 2023
4a8e3b5
prettier fix
soson Jun 8, 2023
0c08226
FD-537 add resource manager (#312)
soson Jun 16, 2023
afc4c90
add resource manger api url to pr-check env
soson Jun 16, 2023
b32fb85
Merge branch 'story-new-conductor-api' of github.com:FRINXio/frinx-in…
soson Jun 16, 2023
154a049
fix formatter
soson Jun 16, 2023
1fbc2ee
README.md updated
soson Jun 16, 2023
92850c9
freeResource mutation added (#313)
soson Jun 20, 2023
42586a2
fix formatter
soson Jun 20, 2023
4c909c3
Add delete and create mutation for task definitions (#316)
plehocky Jul 14, 2023
35b85e5
Add event listener graphql support (#318)
MarcoMruz Jul 14, 2023
a2aa828
remove generated id of event handler actions
MarcoMruz Jul 17, 2023
5a3c8f9
fix lint and formatting
MarcoMruz Jul 17, 2023
6a1be8d
output parameters fix (#319)
soson Jul 18, 2023
3b52493
Typegen fix (#321)
soson Jul 18, 2023
101cd0b
add poll data query (#317)
MarcoMruz Jul 18, 2023
00df639
shortest path endpoint implementation (#324)
soson Jul 24, 2023
d6d72e7
Update poll data sorting (#323)
plehocky Jul 24, 2023
83447e8
add new data types for validation (#325)
MarcoMruz Jul 24, 2023
3f9237a
add name to event handlers filter (#326)
MarcoMruz Jul 26, 2023
b6278b2
task definitions createdAt, updatedAt fix (#328)
soson Jul 27, 2023
446b676
refactored executed workflows query to support sorting (#329)
plehocky Aug 2, 2023
727da25
make executed workflow order input optional (#334)
soson Aug 3, 2023
878c705
updated workflow list to sort by name (#332)
plehocky Aug 4, 2023
20d4958
shortest path (#327)
soson Aug 4, 2023
1235672
update logic of how to handle update of event handler (#337)
MarcoMruz Aug 9, 2023
4610995
added sorting to event handlers (#338)
plehocky Aug 14, 2023
fd31ef3
added sorting to taskDefinitions query (#342)
plehocky Aug 22, 2023
af37af9
FD-540 shortest path weights (#340)
soson Aug 24, 2023
530f4db
updated device sorting (#343)
plehocky Aug 24, 2023
d3b5b43
new workflow properties added (#344)
soson Aug 24, 2023
ff16089
external storage endpoint added (#345)
soson Aug 25, 2023
16bef8f
FD-540 backups query (#341)
soson Aug 25, 2023
7d5e387
regenarate seed script to conform new folder structure (#348)
soson Aug 31, 2023
b19713d
fix import paths (#349)
soson Sep 4, 2023
99388d0
FD-540 diff and update positions (#350)
soson Sep 5, 2023
60e5080
add missing workflow definition properties to make updating more cust…
MarcoMruz Sep 7, 2023
50e1522
bump version 2.0.1 (#367)
soson Sep 7, 2023
b05f45d
remove possibility to change values of createdAt or updatedAt values …
MarcoMruz Sep 11, 2023
dc4aa1d
add pool properties to resource pool (#369)
MarcoMruz Sep 14, 2023
4afea05
added filtering by name to zones and labels (#368)
plehocky Sep 18, 2023
e28698a
Add bulk install (#373)
MarcoMruz Oct 4, 2023
b29124b
bump version 2.0.2 (#375)
soson Oct 5, 2023
1fe622c
resource type fix (#374)
soson Oct 9, 2023
de1a97b
bump version 2.0.3 (#381)
soson Oct 20, 2023
71d2467
deleted topology discovery rest APIcode (#384)
plehocky Dec 5, 2023
370a2aa
install device fix (#386)
soson Dec 20, 2023
806de45
bump version 2.0.4 (#387)
soson Dec 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ DATABASE_URL="postgresql://postgres:postgres@localhost:5432/frinx"
UNICONFIG_API_PROTOCOL=http
UNICONFIG_API_PORT=4000
UNICONFIG_LIST_URL=http://localhost:4000/static/list/uniconfig
CONDUCTOR_API_URL="http:/10.19.0.7:8080/api"
SCHEDULER_API_URL="http://10.19.0.7:3001/query"
RESOURCE_MANAGER_API_URL="http://10.19.0.7/api/resource"
SHELL_HOST=10.19.0.12
X_TENANT_ID="frinx"
TOPOLOGY_ENABLED=true
Expand All @@ -12,3 +15,4 @@ TOPOLOGY_ENABLED=true
# if TOPOLOGY_ENABLED=false they are ignored
# either define all of them or do not define them at all
TOPOLOGY_DISCOVERY_API_URL=http://10.19.0.5:8080/api/topology/data
TOPOLOGY_DISCOVERY_GRAPHQL_API_URL=http://localhost:5000/api/graphql
5 changes: 4 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ prettier.config.js
nexus-typegen.ts
jest.config.js
seed.ts
init.ts
init.ts
src/helpers/base64.helpers.ts
src/helpers/connection.helpers.ts
src/__generated__/*.graphql.ts
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
fetch-depth: 0

- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME
run: docker build --build-arg git_commit=$(git rev-parse HEAD) . --file Dockerfile --tag $IMAGE_NAME

- name: Log into docker hub
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
pull_request:
branches:
- master
- story-new-conductor-api
jobs:
pr-check:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -42,6 +43,9 @@ jobs:
X_TENANT_ID: frinx
TOPOLOGY_ENABLED: false
SHELL_HOST: 10.19.0.12
CONDUCTOR_API_URL: 10.19.0.7
SCHEDULER_API_URL: 10.19.0.7
RESOURCE_MANAGER_API_URL: 10.19.0.7
- name: Check code formatting
run: yarn run formatter:check
- name: Run eslint check
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,6 @@ build
!/.yarn/plugins
!/.yarn/sdks
!/.yarn/versions
/.pnp.*
/.pnp.*

.idea
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
build
coverage
coverage
src/__generated__
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ RUN yarn run build

FROM node:18-slim

ARG git_commit=unspecified
LABEL git_commit="${git_commit}"
LABEL org.opencontainers.image.source="https://github.com/FRINXio/frinx-inventory-server"

RUN apt-get update
RUN apt-get install -y openssl wget

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ DATABASE_URL="postgresql://postgres:postgres@localhost:5432/frinx"
UNICONFIG_API_PROTOCOL=http
UNICONFIG_API_PORT=8181
UNICONFIG_LIST_URL=http://10.19.0.7/static/list/uniconfig
CONDUCTOR_API_URL="http:/10.19.0.7:8080/api"
SCHEDULER_API_URL="http://10.19.0.7:3001/query"
RESOURCE_MANAGER_API_URL="http://10.19.0.7/api/resource"
X_TENANT_ID="frinx"
```

Expand Down
15 changes: 15 additions & 0 deletions codegen-resource-manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
schema:
- 'http://10.19.0.7/api/resource'
documents:
- './src/external-api/resource-manager.ts'
generates:
src/__generated__/resource-manager.graphql.ts:
plugins:
- 'typescript'
- 'typescript-operations'
config:
enumsAsTypes: true
avoidOptionals:
field: true
object: false
inputValue: false
15 changes: 15 additions & 0 deletions codegen-scheduler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
schema:
- 'http://10.19.0.7:3001/query'
documents:
- './src/external-api/scheduler.ts'
generates:
src/__generated__/scheduler.graphql.ts:
plugins:
- 'typescript'
- 'typescript-operations'
config:
enumsAsTypes: true
avoidOptionals:
field: true
object: false
inputValue: false
15 changes: 15 additions & 0 deletions codegen-topology-discovery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
schema:
- 'http://localhost:5000/api/graphql'
documents:
- './src/external-api/topology-discovery-graphql.ts'
generates:
src/__generated__/topology-discovery.graphql.ts:
plugins:
- 'typescript'
- 'typescript-operations'
config:
enumsAsTypes: true
avoidOptionals:
field: true
object: false
inputValue: false
18 changes: 13 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@frinx/inventory-server",
"version": "1.9.2",
"version": "2.0.1",
"engines": {
"node": "18"
},
Expand All @@ -20,10 +20,18 @@
"formatter:check": "prettier -l '*.md' '**/*.ts' '**/*.js' '**/*.json' ",
"test:generate": "cross-env NODE_ENV=testing ts-node --transpile-only -r dotenv/config src/schema/index.ts",
"jest": "cross-env NODE_ENV=testing jest --verbose",
"test": "run-s test:generate jest"
"test": "run-s test:generate jest",
"codegen:scheduler": "graphql-codegen --config codegen-scheduler.yml",
"codegen:resource-manager": "graphql-codegen --config codegen-resource-manager.yml",
"codegen:topology-discovery": "graphql-codegen --config codegen-topology-discovery.yml",
"codegen": "yarn codegen:scheduler && yarn codegen:resource-manager"
},
"devDependencies": {
"@frinx/eslint-config-typescript-base": "15.0.0-build.1",
"@graphql-codegen/cli": "3.3.1",
"@graphql-codegen/introspection": "^3.0.1",
"@graphql-codegen/typescript": "^3.0.4",
"@graphql-codegen/typescript-operations": "^3.0.4",
"@types/jest": "28.1.8",
"@types/ssh2": "^1.11.6",
"@typescript-eslint/eslint-plugin": "5.54.0",
Expand All @@ -38,7 +46,6 @@
"eslint-plugin-import": "2.27.5",
"get-port": "5.1.1",
"glob": "8.1.0",
"graphql-request": "4.3.0",
"jest": "28.1.3",
"npm-run-all": "4.1.5",
"prettier": "2.8.8",
Expand All @@ -51,7 +58,7 @@
"dependencies": {
"@devoxa/prisma-relay-cursor-connection": "2.2.2",
"@graphql-tools/schema": "^9.0.9",
"@prisma/client": "4.2.1",
"@prisma/client": "5.1.1",
"@types/express": "4.17.13",
"@types/graphql-upload": "15.0.2",
"@types/json-templates": "3.0.0",
Expand All @@ -71,6 +78,7 @@
"fp-ts": "2.15.0",
"graphql": "16.6.0",
"graphql-relay": "0.10.0",
"graphql-request": "^6.0.0",
"graphql-upload": "15.0.2",
"graphql-ws": "^5.11.2",
"i18n-iso-countries": "7.5.0",
Expand All @@ -82,7 +90,7 @@
"node-ssh": "^13.0.0",
"pino": "8.11.0",
"pino-pretty": "9.4.0",
"prisma": "4.2.1",
"prisma": "5.1.1",
"ssh2": "^1.11.0",
"url-join": "4.0.1",
"uuid": "^9.0.0",
Expand Down
4 changes: 2 additions & 2 deletions prisma/seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const csv_parse_1 = require('csv-parse');
const fs_1 = require('fs');
const json_templates_1 = __importDefault(require('json-templates'));
const import_csv_helpers_1 = require('../helpers/import-csv.helpers');
const unwrap_1 = __importDefault(require('../helpers/unwrap'));
const utils_helpers_1 = require('../helpers/utils.helpers');
const DEFAULT_UNICONFIG_ZONE = 'localhost';
const { X_TENANT_ID } = process.env;
if (!X_TENANT_ID) {
Expand Down Expand Up @@ -70,7 +70,7 @@ async function getCreateDevicesArgs() {
return {
name: node_id,
tenantId,
uniconfigZoneId: (0, unwrap_1.default)(uniconfigZoneId).id,
uniconfigZoneId: (0, utils_helpers_1.unwrap)(uniconfigZoneId).id,
managementIp: ip_address,
port: port_number,
software: device_type,
Expand Down
2 changes: 1 addition & 1 deletion prisma/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { parse } from 'csv-parse';
import { createReadStream } from 'fs';
import jsonParse from 'json-templates';
import { CSVParserToPromise, CSVValuesToJSON, isHeaderValid, JSONDevice } from '../src/helpers/import-csv.helpers';
import unwrap from '../src/helpers/unwrap';
import { unwrap } from '../src/helpers/utils.helpers';

const DEFAULT_UNICONFIG_ZONE = 'localhost';

Expand Down
Loading