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

decrease time when cache is cleared to 30 seconds #399

Merged
merged 90 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 89 commits
Commits
Show all changes
90 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
530638b
remove conductor,schellar,rm apis (#376)
Paulooze Oct 10, 2023
934cca4
remove yarn; use npm (#377)
Paulooze Oct 10, 2023
60269c7
update apollo server to v4 (#378)
Paulooze Oct 13, 2023
e3f77de
Small refactor (#379)
Paulooze Oct 13, 2023
9382591
remove https
Paulooze Oct 23, 2023
a718868
remove version from node
Paulooze Nov 22, 2023
89c271a
add ptp topology query and ptp path to GM query (#382)
MarcoMruz Nov 30, 2023
a61cc3f
fix data mapping (#383)
MarcoMruz Dec 1, 2023
06a3288
add topology_type parameter to updatePosition endpoint (#385)
soson Dec 14, 2023
15a5c52
remove ptpStatus and use only status (#388)
MarcoMruz Dec 21, 2023
528f340
add new mutations and queries to support synce topology from topology…
MarcoMruz Jan 11, 2024
6539bdd
add new ptp device details (#390)
MarcoMruz Jan 17, 2024
1727ad0
remove redundant property (optimization) (#391)
soson Jan 18, 2024
5a9da16
hive registry integration
Jan 19, 2024
2ebe5b3
add details about interfaces
MarcoMruz Jan 22, 2024
be53de6
Ignore dependabot for hive ci gha
Jozefiel Jan 24, 2024
ace40a0
synce gm path added (#393)
soson Jan 26, 2024
5eaadf0
build fix
soson Jan 29, 2024
55275f2
obsolete graphql endpoints removed (#395)
soson Feb 1, 2024
442a9c5
Add ptp diff synce (#396)
plehocky Feb 5, 2024
31ccf30
decrease time when cache is cleared to 30 seconds
MarcoMruz Feb 5, 2024
01cd751
resolve merge conflicts
MarcoMruz Feb 6, 2024
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
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# now we add what we want to be not-ignored
!/provoke.txt
!/package.json
!/yarn.lock
!/package-lock.json
!/src
!/tsconfig.json
!/tsconfig.production.json
Expand Down
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,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
14 changes: 7 additions & 7 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
- story-new-graphql-proxy

# Publish `v1.2.3` tags as releases.
tags:
Expand All @@ -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 All @@ -41,21 +41,21 @@ jobs:
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
# Use Docker `graphql_proxy` tag convention
[ "$VERSION" == "story-new-graphql-proxy" ] && VERSION=graphql_proxy
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
# Add latest tag if we are on master and github.ref points to a tag
# Add graphql_proxy tag if we are on story-new-graphql-proxy and github.ref points to a tag
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
MASTER=$(git show-ref --hash origin/master)
MASTER=$(git show-ref --hash origin/story-new-graphql-proxy)
echo "master: $MASTER"
HEAD=$(git rev-parse HEAD)
echo "head: $HEAD"
echo "github.ref ${{ github.ref }}"
if [[ $MASTER == $HEAD ]]; then
VERSION=latest
VERSION=graphql_proxy
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/hive-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Hive Publish

on:
push:
branches: [story-new-graphql-proxy]

jobs:
hive-publish:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: schema publish
env:
HIVE_TOKEN: ${{ secrets.HIVE_TOKEN_DEVELOPMENT }}
# HIVE_ENDPOINT: ${{ secrets.HIVE_ENDPOINT }}
SCHEMA_PATH: "src/schema/api.graphql"
run: |
curl -sSL https://graphql-hive.com/install.sh | sh
hive schema:publish "${{ env.SCHEMA_PATH }}" \
--registry.accessToken ${{ env.HIVE_TOKEN }} \
--github
22 changes: 22 additions & 0 deletions .github/workflows/hive-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Hive Check

on:
pull_request:
branches: [story-new-graphql-proxy]

jobs:
hive-check:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: checkout
uses: actions/checkout@v3
- name: schema check
env:
HIVE_TOKEN: ${{ secrets.HIVE_TOKEN_DEVELOPMENT }}
SCHEMA_PATH: "src/schema/api.graphql"
run: |
curl -sSL https://graphql-hive.com/install.sh | sh
hive schema:check "${{ env.SCHEMA_PATH }}" \
--registry.accessToken ${{ env.HIVE_TOKEN }} \
--github
19 changes: 11 additions & 8 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
pull_request:
branches:
- master
- story-new-conductor-api
- story-new-graphql-proxy
jobs:
pr-check:
runs-on: ubuntu-latest
Expand All @@ -24,14 +26,12 @@ jobs:
uses: actions/checkout@v3
- name: Install apt deps
run: apt-get update && apt-get install -y openssl
- name: Copy yarn.lock file
run: cp yarn.lock yarn.lock.orig
- name: Install dependencies
run: yarn install --immutable
run: npm ci
- name: Generate prisma client
run: yarn run prisma:generate
run: npm run prisma:generate
- name: Test the code
run: yarn run test
run: npm test
env:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/frinx
HOST: localhost
Expand All @@ -42,9 +42,12 @@ 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
run: npm run formatter:check
- name: Run eslint check
run: yarn run lint
run: npm run lint
- name: Run TS typecheck
run: yarn run type-check
run: npm run type-check
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
Empty file added .graphqlrc.yml
Empty file.
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__
15 changes: 10 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@ RUN apt-get install -y openssl
RUN mkdir /app

# We need to set production for Node.js
# first we copy things that are needed for yarn-install
# first we copy things that are needed for npm-install
COPY . /app/

WORKDIR /app
RUN yarn install --immutable
RUN npm ci
ENV NODE_ENV production
RUN yarn run prisma:generate
RUN yarn run build
RUN npm run prisma:generate
RUN npm 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 All @@ -39,10 +43,11 @@ COPY --from=build /app/build /app
COPY --from=build /app/prisma /app/prisma
COPY --from=build /app/sample.csv /app/sample.csv
COPY --from=build /app/package.json /app
COPY --from=build /app/package-lock.json /app

WORKDIR /app
USER root
RUN yarn install --production
RUN npm install --production
USER node

CMD ["node", "index.js"]
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,26 @@
## Running development version

```bash
$ docker compose up
$ yarn run prisma:generate
$ yarn run dev
docker compose up
yarn run prisma:generate
yarn run dev
```

`docker compose up` will initialize a database along with some sample development data. Run `docker compose down` to start fresh.
`docker compose up` will initialize a database along with some sample development data.
Run `docker compose down` to start fresh.

## Enviroment variables

Example values are stored in `.env.example` in the root of the repository. These are required values:

```
```bash
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 All @@ -35,22 +39,22 @@ X_TENANT_ID="frinx"
To seed postgre data:

```bash
$ yarn prisma:seed
$ yarn prisma:seed -z <uniconfig_zone> # with optional uniconfigZone parameter
yarn prisma:seed
yarn prisma:seed -z <uniconfig_zone> # with optional uniconfigZone parameter
```

### Production

Both script are compiled and included in running docker. So you can connect to running docker and run the script inside:

```bash
$ docker exec -it <inventory-container-id> sh
$ node prisma/seed.js
docker exec -it <inventory-container-id> sh
node prisma/seed.js
```

Or you can run it directly using:

```bash
$ docker exec <inventory-container-id> node prisma/seed.js
docker exec <inventory-container-id> node prisma/seed.js

```
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
Loading
Loading