1.1.30 • Published 3 years ago

msp2 v1.1.30

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

MSP

Folder Structure

A top-level directory layout

    .
    ├── apps                    # Related sub-applications / microservices
    │   ├── user                # User (end-user)/Reader related apps
    │   └── publisher           # Publisher/Our client related apps
    │       ├── api             #
    │       └── ...             #
    │           ├── src             # Source files
    │           └── test            # Automated tests
    │           └── ...	        # Same folder structure as the top-level layout in `/apps`
    │   ├── consumers           # Consumers from kafka topics
    ├── lib                     # Tools, utilities and 3rd party connections
    ├── infra                   # Configurations and scripts for infrastructure environment
    │   └── ...	                # Same folder structure as the top-level layout in `/apps`
    └── README.md

Getting Started

Before you start

To ensure you have file permissions in order to perform actions, and to have proper integration for git commands

  • Make sure you clone this project from GitHub using SSH (and not using git clone with user/password, or downloading a zip file manually). More information about GitHub SSH integration

  • For a first time installation, make sure to run every command you can as the regular user, and without elevated privileges (sudo root user).

Yarn

MSP project is using yarn as its package manager tool.

Make sure yarn is installed on your development environment npm install -g yarn.

Then verify that yarn was installed correctly by running the following command yarn -v expect version 2.3.2.

First time installation

To install all project dependencies and create a complete local environment (steps 1-7):

  1. Install Pulsar C++ client libraries Pulsar C++ client
sudo apt install ./infra/extra/apache-pulsar-client*.deb
  1. Install the following packages (Prerequisite installations before running)
  1. Navigate to /infra/charts folder

NOTE: When running Minikube on Ubuntu a docker driver must be specified:

  • minikube config set driver docker

  • sudo usermod -aG docker $USER && newgrp docker

Run the 2 commands specified in the start.sh script file, one after the other:

  • minikube start... followed by helm...
  1. Run the following commands to validate everything is up and running:

  • minikube status - will print minikube current status

  • minikube dashboard - will open k8s dashboard for MSP development server (it is recommended to wait for all resources to turn 'green' (ready) before moving on to the next step)

  1. Navigate to /apps folder
  2. Run the following command
yarn install
  1. Test
  • To run all tests in MSP project simply run yarn test:all from root folder.

Build MSP packages

yarn install on /apps folder will install all project dependencies.

To install specific package (aka workspace) navigate to the package folder and run yarn workspaces focus.

You can also install a package from the root folder using yarn workspace <workspaceName> install (e.g. yarn workspace @msp/user-api install).

After restart

  • After restarting the computer you must run minikube start under the /infra/charts folder
  • Make sure to give everything some time to load and run. You can use the minikube dashboard, and some database client to make sure everything is ready

Run tests

MSP unit tests are working with a local storage installations (such as PostgresDB, Redis and Apache Pulsar). There a quickstart setup to deploy all required storage component using a k18s cluster.

Prerequisite installations before running unit tests:

NOTE: When running Minikube on Ubuntu a docker driver must be specified:
minikube config set driver docker
sudo usermod -aG docker $USER && newgrp docker

Start minikube

  1. navigate to 'apps' folder
  2. run the following commands:
  • yarn minikube:start will install MSP development server dependencies (On the first time all dependencies will be installed)
  • yarn minikube:status will print minikube current status
  • yarn minikube:stop will stop MSP development server
  • yarn minikube:delete will clean and delete local k8s server
  • yarn minikube:dashboard will open k8s dashboard for MSP development server
  • yarn minikube:pause will pause MSP development server
  • yarn minikube:unpause will cancel pause (unpause) MSP development server

To run all tests in MSP project simply run yarn test:all from root folder.

In order to run specific package tests run yarn workspace <workspaceName> test (e.g. yarn workspace @msp/user-api test).

Add dependencies

To add a package dependency to a package (aka workspace), navigate to the package directory and run yarn add <dependencyPackageName --cached.

e.g. yarn add -D mocha --cached will add mocha package as a devDependency while checking the highest available mocha version in the entire MSP project.

More details about yarn add command can be found here.

Remove dependencies

To remove a package dependency from a package (aka workspace), navigate to the package directory and run yarn remove <dependencyPackageName>. e.g. yarn remove 'jeeng-redis' will remove jeeng-redis package. More details about yarn remove command can be found here.

Add a new application

To add a new application into msp, navigate to apps/package.json and add to the 'workspaces' section the name of your application. e.g. "admin/*" NOTE - make sure you don't have extra spaces at the name of the application (it will raise an error of yarn issue).

Common issues

  • Problem: Unexpected reserved word in 'msp/apps/.yarn/releases/yarn-2.3.2.cjs'

    Solution: run nvm use v12

Read application specific information

Publisher:

User

1.0.29

3 years ago

1.0.28

3 years ago

1.0.27

3 years ago

1.1.30

3 years ago

1.0.30

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago