Skip to content

Datasance Improvements #770

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

Open
wants to merge 163 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
af61b70
initial commits and worfflow
emirhandurmus Dec 22, 2023
c38b994
packake name
emirhandurmus Dec 22, 2023
4998873
version
emirhandurmus Dec 22, 2023
b0b0d0e
worfklow build image
emirhandurmus Dec 22, 2023
79a1e06
workflow node-version
emirhandurmus Dec 22, 2023
3d859d9
package versions
emirhandurmus Jan 2, 2024
9d4f5f9
workflow
emirhandurmus Jan 2, 2024
7915821
pack
emirhandurmus Jan 2, 2024
f835f80
pack
emirhandurmus Jan 2, 2024
5a2b3ab
pack
emirhandurmus Jan 2, 2024
5160f05
workflow
emirhandurmus Jan 2, 2024
cf70e3a
workflow
emirhandurmus Jan 2, 2024
7f875e9
publish config
emirhandurmus Jan 2, 2024
81d7daa
npmrc
emirhandurmus Jan 2, 2024
7a8a314
npmrc
emirhandurmus Jan 2, 2024
2403f1a
npmrc
emirhandurmus Jan 2, 2024
f8c4b24
workflow
emirhandurmus Jan 2, 2024
d63ded2
workflow
emirhandurmus Jan 2, 2024
300b509
registry
emirhandurmus Jan 2, 2024
8c17f29
pkg repo edit
emirhandurmus Jan 2, 2024
6eb4f13
npm publish
emirhandurmus Jan 2, 2024
95eba20
workflow and dockerfile
emirhandurmus Jan 2, 2024
d3a9e5c
dockerfile update
emirhandurmus Jan 2, 2024
1e4c055
add subscription_key to userprofile
emirhandurmus Jan 26, 2024
5b4e629
makefile and create-user data type fix
emirhandurmus Jan 26, 2024
de61380
commit
emirhandurmus Jan 26, 2024
7912ced
subscriptionKey modification
emirhandurmus Jan 27, 2024
e21f031
swagger aut edit
emirhandurmus Jan 27, 2024
14cc78a
commit
emirhandurmus Jan 28, 2024
9a2a999
swagger yaml agentToken auth edit
emirhandurmus Jan 28, 2024
ecbb298
api version editing
emirhandurmus Feb 3, 2024
5615346
Merge pull request #1 from Datasance/emo-user-subskey
emirhandurmus Feb 3, 2024
efd917a
.nsprc execption edited
emirhandurmus Feb 3, 2024
14fd399
Merge branch 'main' of https://github.com/Datasance/Controller
emirhandurmus Feb 3, 2024
9efd708
workflow tests removed
emirhandurmus Feb 3, 2024
0650182
release version edited
emirhandurmus Feb 3, 2024
8936b27
ecn viewer package update test
emirhandurmus Feb 16, 2024
40e7411
workflow nprmc edit
emirhandurmus Feb 16, 2024
24d8a60
workflow edit
emirhandurmus Feb 16, 2024
376ecc3
workflow and nsprc edit
emirhandurmus Feb 16, 2024
e54314e
workflow docker build argument edited
emirhandurmus Feb 16, 2024
5dcf7b6
dockerfile updated
emirhandurmus Feb 16, 2024
b75b31f
dockerfile edited
emirhandurmus Feb 16, 2024
6d3274a
dockerfile edited
emirhandurmus Feb 16, 2024
cfd8e25
public port range edited
emirhandurmus Feb 17, 2024
8f1e8de
mysql adapter created
emirhandurmus Mar 1, 2024
da26c53
configs and mysql adapter updated
emirhandurmus Mar 1, 2024
b59131e
mysql adapter and sequalize model
emirhandurmus Mar 1, 2024
53dbf6f
mysql provider updated
emirhandurmus Mar 1, 2024
4cd802f
mysql provider updated
emirhandurmus Mar 1, 2024
1f87e52
mysql2 added to package.json
emirhandurmus Mar 1, 2024
102768f
provider updated
emirhandurmus Mar 1, 2024
66cea4a
migration notes and controlplane model
emirhandurmus Mar 7, 2024
3763b6c
condif data model associated with controlplane, timestamps for contro…
emirhandurmus Mar 9, 2024
2c1d423
commit
emirhandurmus Mar 9, 2024
3f56ab6
keycloak connect adapter added, user removed from controller
emirhandurmus Mar 17, 2024
1b124d0
authdecorator removed
emirhandurmus Mar 17, 2024
fb672f0
indentations fixied
emirhandurmus Mar 17, 2024
c33a68e
builtin auth decorator for users removed
emirhandurmus Mar 18, 2024
e637ebb
removed missing builtin auth decorator
emirhandurmus Mar 18, 2024
de5c600
axios ssl self signed issue fixed
emirhandurmus Mar 18, 2024
c75c93b
listCatalogItemsEndPoint edited for keycloak test
emirhandurmus Mar 18, 2024
7f3e78c
keycloak protect added to server.js
emirhandurmus Mar 18, 2024
ea9c538
test keycloak.protect
emirhandurmus Mar 18, 2024
be8baf5
keycloak protection added to all endpoints, old migration and seeder …
emirhandurmus Mar 19, 2024
1e9b7aa
user service for profile endpoint edited
emirhandurmus Mar 19, 2024
4e2930a
user profile route edited
emirhandurmus Mar 19, 2024
fe69c33
user routes updated
emirhandurmus Mar 19, 2024
7354248
user profile service edited for extracting token from endpoint request
emirhandurmus Mar 19, 2024
0bd03cc
user login kc totp and user logout added
emirhandurmus Mar 22, 2024
84157f7
user logout fixed
emirhandurmus Mar 22, 2024
c5f2503
ecn viewer version updated
emirhandurmus Mar 25, 2024
cf88aeb
viewer keycloak variables and version updated
emirhandurmus Mar 25, 2024
6288948
edgeresource service fixed
emirhandurmus Mar 27, 2024
e0fa248
user removed from endpoint's controller and service
emirhandurmus Mar 28, 2024
ef5771f
Revert "user removed from endpoint's controller and service"
emirhandurmus Mar 28, 2024
4a2603b
iofog service user check fixed
emirhandurmus Mar 28, 2024
ae02754
microservice-service module's traction decorator edited
emirhandurmus Mar 28, 2024
30d19f3
revert edgeresource service changes
emirhandurmus Mar 28, 2024
10ea1c6
Revert "revert edgeresource service changes"
emirhandurmus Mar 28, 2024
9329fd4
Revert "microservice-service module's traction decorator edited"
emirhandurmus Mar 28, 2024
cc487ed
Revert "Revert "user removed from endpoint's controller and service""
emirhandurmus Mar 28, 2024
744c9ba
listEdgeResources and listEdgeResourcesEndpoint modified
emirhandurmus Mar 28, 2024
a7ec8e0
ecn-viewer version updated
emirhandurmus Mar 30, 2024
b5b66c4
release version and microservice port service update
emirhandurmus Apr 2, 2024
9a38a42
audit fix
emirhandurmus Apr 2, 2024
327ca48
Merge pull request #2 from Datasance/feature/db-adapter
emirhandurmus Apr 2, 2024
f457044
node and node moduls updated.
alpanet May 20, 2024
03d1ec3
worflow edited
emirhandurmus May 21, 2024
cb7ee0e
workflow updated
emirhandurmus May 21, 2024
3ce2f1d
workflow fixed
emirhandurmus May 21, 2024
005ce6f
pacakge version updated
emirhandurmus May 21, 2024
94acf33
buildx platfrom edited on workflow
emirhandurmus May 21, 2024
821a714
workflow multi arch platform edited
emirhandurmus May 21, 2024
89211b4
req username info inserted into logger and all keycloak protected end…
emirhandurmus May 25, 2024
a298a7e
cli config dev-mode fixed and package version updated for release
emirhandurmus May 27, 2024
90f2be1
swagger yaml edited
emirhandurmus Jun 15, 2024
e612aaa
Merge pull request #3 from Datasance/feature/node-update
emirhandurmus Jun 15, 2024
a60eb01
viewer update
emirhandurmus Jun 15, 2024
2eb4e76
package updates
emirhandurmus Jun 15, 2024
c101d8e
commit
emirhandurmus Jun 15, 2024
3950202
commit
emirhandurmus Jun 15, 2024
d962e94
package updates
emirhandurmus Jun 15, 2024
cfc92de
package versions updated
emirhandurmus Jun 29, 2024
843bab7
package version updated
emirhandurmus Jul 2, 2024
96f4f9e
version naming fixed
emirhandurmus Jul 2, 2024
82c149d
router and proxy created as a system application
emirhandurmus Jul 13, 2024
4ad05ce
createPortMappingEndPoint fixed
emirhandurmus Jul 14, 2024
aa4f5e8
swagger yaml update
emirhandurmus Jul 15, 2024
341a3ac
proxxy msvc default log size added
emirhandurmus Jul 15, 2024
6c760c5
microservice definition modified for WasmEdge integration
emirhandurmus Jul 16, 2024
e227432
ecn viewer updated and microservice/system endpoint fixed
emirhandurmus Jul 16, 2024
72ee86e
Merge pull request #4 from Datasance/feature/router-proxy-as-systemapp
emirhandurmus Jul 16, 2024
1d8e089
microservices updated
emirhandurmus Jul 18, 2024
7eff03d
version updated
emirhandurmus Jul 18, 2024
617f73e
Merge pull request #5 from Datasance/feature/router-proxy-as-systemapp
emirhandurmus Jul 18, 2024
c86c40e
release
emirhandurmus Jul 18, 2024
f8f411f
version updated
emirhandurmus Jul 18, 2024
4e6afe3
microservice cdi devices table name fixed
emirhandurmus Jul 18, 2024
0cdd809
microservice response and get agent microservice edited
emirhandurmus Jul 20, 2024
5235421
release name
emirhandurmus Jul 22, 2024
a1de6f9
viewer version updated
emirhandurmus Jul 24, 2024
e3fd85b
viewer updated
emirhandurmus Jul 24, 2024
4bd27f2
viewer updated
emirhandurmus Jul 29, 2024
195ba62
version updated
emirhandurmus Jul 29, 2024
52ce828
viewer updated to 0.2.3
emirhandurmus Jul 29, 2024
012e85e
viewer updated
emirhandurmus Aug 20, 2024
78e40a1
postgres db provider added and viewer version updated
emirhandurmus Aug 22, 2024
25db5be
vulnerable packages fixed
emirhandurmus Aug 23, 2024
f91472c
viewer version updated
emirhandurmus Aug 23, 2024
945d007
Merge branch 'main' into feature/db-postgres
emirhandurmus Aug 23, 2024
f463010
Merge pull request #6 from Datasance/feature/db-postgres
emirhandurmus Aug 23, 2024
862ac4c
viewer version upgraded
emirhandurmus Aug 27, 2024
204ba5c
viewer upgraded to 0.3.5
emirhandurmus Aug 27, 2024
2d8b010
api version updated to be in line with iofog community
emirhandurmus Nov 6, 2024
fe15a5a
Merge pull request #7 from Datasance/feature/api-update
emirhandurmus Nov 6, 2024
7b58480
docker base image updated ubi with nonroot user, old version codebase…
emirhandurmus Nov 8, 2024
c6e86cd
Merge pull request #8 from Datasance/feature/api-update
emirhandurmus Nov 8, 2024
56fed80
docker base image updated and starting of 1st phase of sqlite scripts
emirhandurmus Nov 13, 2024
40b5b87
docker base image updated
emirhandurmus Nov 13, 2024
509636e
version updated
emirhandurmus Nov 13, 2024
b9a8876
isconsumer fixed, old version data models cleaning
emirhandurmus Nov 14, 2024
14493aa
Swagger feature added.
alpanet Nov 14, 2024
c48a29e
sqli migration and seeder scripts added, user refresh token endpoint …
emirhandurmus Nov 27, 2024
3a5d122
custom swagger ui x custom baseurl
alpanet Dec 5, 2024
5a0a4d0
release prep and ecn viewer version updated. system apps endpoint rol…
emirhandurmus Dec 5, 2024
e8b11b3
Merge branch 'main' into feature/sqlite-scripts
emirhandurmus Dec 5, 2024
04c92ef
Merge pull request #9 from Datasance/feature/sqlite-scripts
emirhandurmus Dec 5, 2024
bc64280
swagger ui removed controller side.
alpanet Dec 10, 2024
e2296e2
viewer updated
emirhandurmus Dec 10, 2024
7eeaa54
Merge pull request #10 from Datasance/feature/sqlite-scripts
emirhandurmus Dec 10, 2024
a5884ea
ecn viewer version updated
emirhandurmus Dec 11, 2024
eae6f88
Merge pull request #11 from Datasance/feature/sqlite-scripts
emirhandurmus Dec 11, 2024
b982e93
iofog service system agen query fixed, db colum altering for mscv status
emirhandurmus Dec 27, 2024
2710c7b
logoptions and cli fixed
emirhandurmus Dec 29, 2024
3a4f2f7
catalog updated
emirhandurmus Jan 5, 2025
174d5e7
Merge pull request #12 from Datasance/feature/catalog-update
emirhandurmus Jan 5, 2025
0b3b6e6
Update README.md
emirhandurmus Jan 5, 2025
21efbe2
hal and restble catalog edited
emirhandurmus Jan 11, 2025
376dd1b
agent router ssl configuration options added, public extrahosts fixed…
emirhandurmus Feb 3, 2025
1f32cbe
Merge pull request #13 from Datasance/feature/ms-routes
emirhandurmus Feb 3, 2025
1ae53c7
added rebild option for router updateconfig
emirhandurmus Mar 6, 2025
2e5f6ab
Merge pull request #14 from Datasance/feature/ms-routes
emirhandurmus Mar 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ node_modules
*.pid
/src/data/providers/*
!/src/data/providers/sqlite.js
!/src/data/providers/mysql.js
!/src/data/providers/postgres.js
!/src/data/providers/database-*.js
/src/config/*-config.json
.DS_Store
Expand Down
15 changes: 0 additions & 15 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

186 changes: 91 additions & 95 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,100 +1,93 @@
name: CI
on:
push:
push:
branches:
- develop
- release*
- main
tags: [v*]
paths-ignore:
- README.md
- CHANGELOG.md
- LICENSE
pull_request:
# Sequence of patterns matched against refs/heads
branches:
- develop
- release*
# Sequence of patterns matched against refs/heads
branches:
- main
paths-ignore:
- README.md
- CHANGELOG.md
- LICENSE

env:
project: 'focal-freedom-236620'
image: 'controller'
IMAGE_NAME: 'controller'



jobs:
Build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
contents: 'read'
id-token: 'write'
packages: 'write'
actions: write
checks: write
contents: write
deployments: write
id-token: write
issues: write
discussions: write
packages: write
pages: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write
name: Preflight
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- run: npm ci
node-version: 20
- name: Replace values
shell: bash
env:
PAT: ${{ secrets.PAT }}
run: |
sed -i.back "s|PAT|${PAT}|g" .npmrc
- run: npm config set @datasance:registry https://npm.pkg.github.com/
- run: npm install --build-from-source --force
- run: npm run standard
- run: |
npm i -g better-npm-audit
npx better-npm-audit audit -p

Tests:
needs: Build
runs-on: ubuntu-latest
Publish:
needs: [Build]
runs-on: ubuntu-22.04
permissions:
contents: 'read'
id-token: 'write'
packages: 'write'
issues: read
actions: write
checks: write
contents: write
deployments: write
id-token: write
issues: write
discussions: write
packages: write
pages: write
pull-requests: write
strategy:
matrix:
node: [ 16, 17, 16, 19 ]
name: Node ${{ matrix.node }} Test
steps:
- uses: actions/checkout@v3
- name: Setup Node ${{ matrix.node }} Test
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Cache Node Modules
uses: actions/cache@v3
with:
path: |
node_modules
key: ${{ runner.os }}-controller-node_modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-controller-node_modules-
- run: npm ci
- run: npm run test -- junit
- run: npm run postman_test
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
*-results.xml

Publish:
needs: [Build, Tests]
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
packages: 'write'
repository-projects: write
security-events: write
statuses: write
name: Publish Controller
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- run: npm ci
node-version: 20
- name: Replace values
shell: bash
env:
PAT: ${{ secrets.PAT }}
run: |
sed -i.back "s|PAT|${PAT}|g" .npmrc
- run: npm config set @datasance:registry https://npm.pkg.github.com/
- run: npm install --build-from-source --force

- name: npm version
id: package-version
Expand All @@ -112,47 +105,50 @@ jobs:

- name: npm pack with version from package version
run: |
npm --no-git-tag-version version ${{ steps.version.outputs.pkg_version }}
npm pack
npm publish --registry=https://npm.pkg.github.com/

- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: 0.0.0
- name: Set image tag
shell: bash
id: tags
run: |
if [[ ${{ github.ref_name }} =~ ^v.* ]] ; then
VERSION=${{ github.ref_name }}
echo "VERSION=${VERSION:1}" >> "${GITHUB_OUTPUT}"
else
VERSION=${{ steps.previoustag.outputs.tag }}
echo "VERSION=${VERSION:1}-${{ github.run_number }}" >> "${GITHUB_OUTPUT}"
fi

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3


- name: Login to Github Container Registry
uses: docker/login-action@v2
with:
registry: "ghcr.io"
username: ${{ github.actor }}
password: ${{ github.token }}

password: ${{ secrets.PAT }}
- name: Build and Push to ghcr
uses: docker/build-push-action@v3
id: build_push_ghcr
with:
file: Dockerfile.dev
file: Dockerfile
context: .
platforms: linux/amd64, linux/arm64
push: true
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Controller
build-args: GITHUB_TOKEN=${{ secrets.PAT }}
tags: |
ghcr.io/eclipse-iofog/controller:${{ steps.version.outputs.pkg_version }}
ghcr.io/eclipse-iofog/controller:latest
build-args: PKG_VERSION=${{ steps.version.outputs.pkg_version }}

- name: Build and Push to GCR
id: build_push_gcr
uses: RafikFarhad/push-to-gcr-github-action@v5-beta
with:
gcloud_service_key: ${{ secrets.GCLOUD_SERVICE_KEY }}
registry: gcr.io
project_id: ${{ env.project }}
image_name: ${{ env.image }}
image_tag: latest,${{ steps.version.outputs.pkg_version }}
dockerfile: Dockerfile.dev
build_args: PKG_VERSION=${{ steps.version.outputs.pkg_version }}

- run: ls

- name: Publish package to packagecloud
if: ${{ steps.build_push_gcr.outcome }} == 'success'
uses: danielmundi/upload-packagecloud@v1
with:
PACKAGE-NAME: iofog-iofogcontroller-${{ steps.version.outputs.pkg_version }}.tgz
PACKAGECLOUD-USERNAME: iofog
PACKAGECLOUD-REPO: iofog-controller-snapshots
PACKAGECLOUD-DISTRIB: node
PACKAGECLOUD-TOKEN: ${{ secrets.packagecloud_token }}
ghcr.io/datasance/${{ env.IMAGE_NAME }}:${{ steps.tags.outputs.VERSION }}
ghcr.io/datasance/${{ env.IMAGE_NAME }}:latest
ghcr.io/datasance/${{ env.IMAGE_NAME }}:main
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ node_modules
*.pid
/src/data/providers/*
!/src/data/providers/sqlite.js
!/src/data/providers/mysql.js
!/src/data/providers/postgres.js
!/src/data/providers/database-*.js
/src/config/*-config.json
.DS_Store
iofogcontroller-*.tgz
diagnostic/
iofog-iofogcontroller-*.tgz
iofog-iofogcontroller-*.tgz
.npmrc
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//npm.pkg.github.com/:_authToken=PAT
@Datasance:registry=https://npm.pkg.github.com/
9 changes: 2 additions & 7 deletions .nsprc
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
{
"1091459": {
"notes": ""
},
"1091725": {
"notes": ""
}
}

}
68 changes: 68 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
FROM node:iron-bookworm AS builder

ARG PKG_VERSION
ARG GITHUB_TOKEN

WORKDIR /tmp

RUN npm i -g npm

COPY package.json .

COPY . .

# Set GitHub npm registry with authentication token
RUN sed -i.back "s|PAT|${GITHUB_TOKEN}|g" .npmrc

RUN npm config set @datasance:registry https://npm.pkg.github.com/

RUN npm i --build-from-source --force

RUN npm version $PKG_VERSION --allow-same-version --no-git-tag-version

RUN npm pack


FROM registry.access.redhat.com/ubi9/nodejs-20-minimal:latest

USER root
# Install dependencies for logging and development
RUN microdnf install -y logrotate g++ make && microdnf clean all

COPY logrotate.conf /etc/logrotate.d/iofog-controller

# Install Python and pip
RUN microdnf install -y python3 && \
ln -sf python3 /usr/bin/python && \
python3 -m ensurepip && \
pip3 install --no-cache --upgrade pip setuptools && \
microdnf install shadow-utils && \
microdnf clean all
RUN microdnf reinstall -y tzdata && microdnf clean all
RUN microdnf -y remove microdnf
RUN useradd --uid 10000 --create-home runner
RUN mkdir -p /var/log/iofog-controller && \
chown runner:runner /var/log/iofog-controller && \
chmod 755 /var/log/iofog-controller
USER 10000
WORKDIR /home/runner

ENV NPM_CONFIG_PREFIX=/home/runner/.npm-global
ENV NPM_CONFIG_CACHE=/home/runner/.npm
ENV PATH=$PATH:/home/runner/.npm-global/bin

COPY --from=builder /tmp/datasance-iofogcontroller-*.tgz /home/runner/iofog-controller.tgz

ENV PID_BASE=/home/runner

RUN npm i -g /home/runner/iofog-controller.tgz && \
rm -rf /home/runner/iofog-controller.tgz && \
iofog-controller config dev-mode --on

RUN rm -rf /home/runner/.npm-global/lib/node_modules/@datasance/iofogcontroller/src/data/sqlite_files/*

COPY LICENSE /licenses/LICENSE
LABEL org.opencontainers.image.description=controller
LABEL org.opencontainers.image.source=https://github.com/datasance/controller
LABEL org.opencontainers.image.licenses=EPL2.0
CMD [ "node", "/home/runner/.npm-global/lib/node_modules/@datasance/iofogcontroller/src/server.js" ]
Loading