Changes between Version 1 and Version 2 of Tutorials/Edge Computing/OSCP


Ignore:
Timestamp:
Apr 3, 2022, 10:33:08 PM (2 years ago)
Author:
seskar
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/Edge Computing/OSCP

    v1 v2  
    1212=== Tutorial Setup ===
    1313
     14==== Create Extra Disk Space (if needed) ====
    1415Modify /etc/hosts file to add references for named services. In real deployment, this would require modifying DNS records.
     16
     17Configure extra disk (if applicable)
     18{{{
     19sudo mkfs -t xfs /dev/nvme1n1
     20sudo mkdir /data
     21sudo mount /dev/nvme1n1 /data
     22sudo cp /etc/fstab /etc/fstab.orig
     23sudo lsblk -o +UUID
     24}}}
     25
     26Update /etc/fstab with new line including UUID from above:
     27{{{
     28UUID=4cec62c2-7f6b-4141-86f7-8c2a38e6f3fa  /data  xfs  defaults,nofail  0  2
     29sudo umount /data
     30sudo mount -a
     31sudo chown ubuntu:ubuntu /data
     32}}}
     33
     34==== Install Prerequisite Packages ====
     35
     36Install npm version manager
     37{{{
     38curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o n
     39sudo bash n lts
     40sudo npm install -g n
     41}}}
     42
     43Install nginx and pm2
     44{{{
     45sudo apt update
     46sudo apt install nginx
     47sudo npm install pm2 -g
     48}}}
     49
     50
     51==== Install Spatial Service Discovery ====
     52
     53Create a folder for the code and build files. The path is your choice.
     54{{{
     55mkdir /data/ssddev
     56cd /data/ssddev
     57}}}
     58 
     59Create a folder for data store. The path is your choice, but it should be added in the .env file in variable KAPPA_CORE_DIR later below.
     60
     61{{{
     62mkdir data
     63git clone https://github.com/OpenArCloud/oscp-spatial-service-discovery.git
     64cd oscp-spatial-service-discovery
     65}}}
     66 
     67Disable authentication (optional, not recommended for production deployment):
     68{{{
     69cp src/router-noauth.ts src/router.ts
     70}}}
     71
     72Install the dependencies and build the project:
     73{{{
     74npm install
     75npm run-script build
     76}}}
     77 
     78Add an appropriate .env file:
     79{{{
     80touch .env
     81nano .env
     82}}}
     83 
     84and make sure it contains
     85{{{
     86KAPPA_CORE_DIR="/home/native/dev/ssd_data"
     87SWARM_TOPIC_PREFIX="orbit_ssd"
     88AUTH0_ISSUER=https://ssd-oscp.us.auth0.com/
     89AUTH0_AUDIENCE=https://ssd.orbit-lab.org
     90COUNTRIES=AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GR,HR,HU,IE,IT,LT,LV,LU,MT,NL,PL,PT,RO,SE,SI,SK,US
     91PORT=4100
     92}}}
     93
     94'''WARNING:''' ''having or not having trailing slash in the domain (AUTH0_AUDIENCE) must match the entry in Auth0! In addition, the way we extract username from Java Web Tokens with jwt-decode library assumes that there is no trailing slash in the audience URI.''
     95
     96'''WARNING:''' ''the trailing / in AUTH0_ISSUER seems to be important, otherwise the client’s POST request return with error that https://ssd-oscp.us.auth0.com.well-known is not found.''
     97
     98Start the service:
     99{{{
     100pm2 start dist/server.js --name ssd_orbit
     101}}}
     102 
     103==== Install Spatial Content Discovery Service ====
     104
     105Create a folder for the code and build files. The path is your choice.
     106{{{
     107mkdir /data/scddev
     108cd /data/scddev
     109}}}
     110
     111Create a folder for data store. The path is your choice, but it should be added in the .env file below
     112{{{
     113mkdir data
     114git clone https://github.com/OpenArCloud/oscp-spatial-content-discovery.git
     115cd oscp-spatial-content-discovery
     116}}}
     117
     118Disable authentication (optional, not recommended for production):
     119{{{
     120cp src/router-noauth.ts src/router.ts
     121}}}
     122
     123Install the dependencies and build the project:
     124{{{
     125npm install
     126npm run-script build
     127}}}
     128
     129Add an appropriate .env file:
     130{{{
     131touch .env
     132nano .env
     133}}}
     134 
     135with
     136{{{
     137KAPPA_CORE_DIR="/home/native/dev/scd_data"
     138AUTH0_ISSUER=https://scd-oscp.us.auth0.com/
     139AUTH0_AUDIENCE=https://scd.orbit-lab.org
     140GEOZONE="4671654"
     141TOPICS="transit,history,entertainment,general"
     142PORT=3100
     143}}}
     144 
     145'''WARNING:''' ''having or not having trailing slash in the domain (AUTH0_AUDIENCE) must match the entry in auth0''
     146
     147'''WARNING:''' ''the trailing / in AUTH0_ISSUER seems to be important, otherwise the client’s POST request return with error that https://scd-oscp.us.auth0.com.well-known is not found''
     148
     149Start the service:
     150{{{
     151pm2 start dist/server.js --name scd_orbit
     152}}}
     153 
     154
     155