Skip to content

Commit c72309e

Browse files
committed
Update readme
1 parent 7a1e87b commit c72309e

File tree

1 file changed

+54
-46
lines changed

1 file changed

+54
-46
lines changed

README.md

+54-46
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ See the [ServicePulse documentation](https://docs.particular.net/servicepulse/)
88

99
## Setting up the project for development
1010

11-
ServicePulse is in the proces of migrating from AngularJS to Vue.js, during which both frameworks are used to serv parts of the application. In development environment process AngularJS and Vue.js http servers are run side-by-side behind a reverse proxy. This enables accessing both applications from the same domain i.e. `localhost:1331` where uri prefixed with `/a/` are served by AngularJS and rest is handled by Vue.js. This mimics the production deployment where the Vue.js application is deployed in the main folder and AngularJS in `/a/` subfolders.
11+
ServicePulse is in the process of migrating from AngularJS to Vue.js, during which both frameworks are used to serve parts of the application. In development environment process AngularJS and Vue.js http servers are run side-by-side behind a reverse proxy. This enables accessing both applications from the same domain i.e. `localhost:1331` where uri prefixed with `/a/` are served by AngularJS and rest is handled by Vue.js. This mimics the production deployment where the Vue.js application is deployed in the main folder and AngularJS in `/a/` subfolders.
1212

1313
```mermaid
1414
graph LR
@@ -32,6 +32,7 @@ graph LR
3232
VueJs --> ScMonitoring
3333
VueJs --> ScError
3434
```
35+
3536
### Setting up ServiceControl Main and ServiceControl Monitoring instances
3637

3738
ServicePulse mostly presents data provided by [ServiceControl](https://docs.particular.net/servicecontrol) and [ServiceControl Monitoring](https://docs.particular.net/servicecontrol/monitoring-instances/) instances.
@@ -46,72 +47,79 @@ ServicePulse uses [npm](https://www.npmjs.com/) and [Bower](https://bower.io/) a
4647

4748
Install the following dependencies if you don't have them installed yet
4849

49-
- [Node.js](https://nodejs.org/en/download/)
50-
- [Git for Windows](https://gitforwindows.org/)
51-
- [Docker](https://docs.docker.com/get-docker/)
52-
- Note that, if running docker for windows, the current user needs to be in the docker-users local group. If your windows account is different to the installation (admin) account, then you will need to manually add your user to the group. See https://docs.docker.com/desktop/faqs/windowsfaqs/#why-do-i-see-the-docker-desktop-access-denied-error-message-when-i-try-to-start-docker-desktop
53-
- Chutzpah
54-
- [Test Adapter for the Test Explorer](https://marketplace.visualstudio.com/items?itemName=vs-publisher-2795.ChutzpahTestAdapterfortheTestExplorer)
55-
- [Test Runner Context Menu Extension](https://marketplace.visualstudio.com/items?itemName=vs-publisher-2795.ChutzpahTestRunnerContextMenuExtension)
50+
- [Git for Windows](https://gitforwindows.org/)
51+
- [Node.js](https://nodejs.org/en/download/)
52+
- **NOTE:** It is good practice when installing or updating node.js on your local environment to also check and make sure that the node.js version for the `ci.yml` and `release.yml` workflows match the version of your local environment. Look for the step `name: Set up Node.js`
53+
- [Docker](https://docs.docker.com/get-docker/)
54+
- **NOTE:** If running docker for windows, the current user needs to be in the docker-users local group. If your windows account is different to the installation (admin) account, then you will need to manually add your user to the group. See https://docs.docker.com/desktop/faqs/windowsfaqs/#why-do-i-see-the-docker-desktop-access-denied-error-message-when-i-try-to-start-docker-desktop
55+
- Chutzpah
56+
- [Test Adapter for the Test Explorer](https://marketplace.visualstudio.com/items?itemName=vs-publisher-2795.ChutzpahTestAdapterfortheTestExplorer)
57+
- [Test Runner Context Menu Extension](https://marketplace.visualstudio.com/items?itemName=vs-publisher-2795.ChutzpahTestRunnerContextMenuExtension)
5658

5759
### Set development environment
5860

61+
> [!TIP]
62+
> Using the `ServicePulse\src\run-dev.cmd` batch file will execute steps 1 - 3.
63+
5964
#### Step 0 - Using a suitable IDE for frontend development
6065

6166
Even though Visual Studio or Rider seem to be adequate IDE for frontend development, they don't tend to do a good job with the latest frontend frameworks, linting and formatting.
6267
Because of that, we have [extra recommendations](/docs/frontend/frontend-ide.md) for you to be even more successful at frontend development.
6368

6469
#### Step 1 - run Nginx reverse proxy
65-
70+
6671
Open a command window and navigate to `ServicePulse\src\ServicePulse.Host` path (NOTE: ensure [cmd](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cmd) is being used, not [PowerShell](https://learn.microsoft.com/en-us/powershell/)). Run `nginx` that is a reverse proxy for AngularJS and Vue.js applications:
6772

6873
```cmd
6974
docker run -it --rm -p 1331:1331 -v %cd%/nginx.conf:/etc/nginx/nginx.conf:ro --name service-pulse-dev nginx
7075
```
7176

72-
#### Step 2 - run AngularJS development server
77+
#### Step 2 - run AngularJS development server
7378

7479
Navigate to `ServicePulse\src\ServicePulse.Host\angular` and:
75-
- run `npm install` to install all the npm dependencies
76-
- run the following command `npm run dev`. This will host a dev server on port 5174 and start watching for changes in `/angular` directory
7780

78-
_Note: If you receive an error similar to `Error: error:0308010C:digital envelope routines::unsupported` when Webpack attempts to execute `LoadRunner.js`, it means that you need to configure Node to use a legacy SSL provider. You can do this by setting an environment variable called `NODE_OPTIONS` to the value `--openssl-legacy-provider`. E.g. Run `export NODE_OPTIONS=--openssl-legacy-provider` from a bash shell.
79-
80-
#### Step 3 - run Vue.js development server
81+
- run `npm install` to install all the npm dependencies
82+
- run the following command `npm run dev`. This will host a dev server on port 5174 and start watching for changes in `/angular` directory
83+
84+
> [!NOTE]
85+
> For compatibility with Node.js versions 17 and higher, it's essential to set the `NODE_OPTIONS` environment variable to `--openssl-legacy-provider` when loading and running the angularJS app. This configuration is specified in the `.npmrc` file located at the root of the Angular folder `ServicePulse\src\ServicePulse.Host\angular`. Any npm command executed from the Angular directory, including those in CI/Release workflows, will automatically have the necessary environment variable set.
86+
87+
#### Step 3 - run Vue.js development server
8188

8289
Navigate to `ServicePulse\src\ServicePulse.Host\vue` and:
83-
- run `npm install` to install all the npm dependencies
84-
- run the following command `npm run dev` (this will host a dev server on port 5173 and start watching for changes in `/vue` directory)
90+
91+
- run `npm install` to install all the npm dependencies
92+
- run the following command `npm run dev` (this will host a dev server on port 5173 and start watching for changes in `/vue` directory)
8593

8694
In case `npm run dev` fails with an error related to git submodule not properly configured, run the `npm install` command again to ensure all required dependencies are available, and then run `npm run dev`.
8795

8896
#### Step 4 - open the browser
8997

9098
After doing the above steps, navigate to `http://localhost:1331` to see the ServicePulse application.
9199

92-
### Provided npm scripts
100+
### Provided npm scripts
93101

94102
#### Vue.js
95103

96-
- `dev` - runs `vite` that starts development server doing hot reload over source files
97-
- `build` - runs build script that outputs files to `..\app` folder
98-
- `lint` - checks with eslint all vue, ts and js files
99-
- `type-check` - runs TypeScript in no emit mode
104+
- `dev` - runs `vite` that starts development server doing hot reload over source files
105+
- `build` - runs build script that outputs files to `..\app` folder
106+
- `lint` - checks with eslint all vue, ts and js files
107+
- `type-check` - runs TypeScript in no emit mode
100108

101109
#### AngularJS
102110

103-
- `test` - runs js tests in ServicePulse.Host.Test project
104-
- `setup` - this command runs few commands
105-
- installs the npm packages
106-
- runs `webpack`
107-
- `load` - this command does the same thing that `setup` but webpack is run only once to produce artifacts. This command is used by the builder
108-
- `serve` - serves js artifacts using `http-server`
109-
- `webpack` - runs webpack command, which does the following things for the given modules (monitoring, configuration)
110-
- joins js together
111-
- runs babel transpiler
112-
- has a file watcher to run the above whenever file is saved
113-
- `lint` - checks with eslint all js files
114-
- `dev` - runs in parallel two scripts `webpack` and `serve`
111+
- `test` - runs js tests in ServicePulse.Host.Test project
112+
- `setup` - this command runs few commands
113+
- installs the npm packages
114+
- runs `webpack`
115+
- `load` - this command does the same thing that `setup` but webpack is run only once to produce artifacts. This command is used by the builder
116+
- `serve` - serves js artifacts using `http-server`
117+
- `webpack` - runs webpack command, which does the following things for the given modules (monitoring, configuration)
118+
- joins js together
119+
- runs babel transpiler
120+
- has a file watcher to run the above whenever file is saved
121+
- `lint` - checks with eslint all js files
122+
- `dev` - runs in parallel two scripts `webpack` and `serve`
115123

116124
NOTE:
117125
Webpack observes files and updates the artifacts whenever they are changed, however at the moment not every bit of code is processed by webpack. Only monitoring and configuration is.
@@ -128,7 +136,7 @@ It is possible to run ServicePulse directly via `ServicePulse.Host.exe`.
128136

129137
ServicePulse.Host.exe depends on a self-hosted webserver. In order to start the project a URL ACL reservation needs to be setup. Either run Visual Studio with Administrative privileges or run the following command to add the required URL ACL reservation:
130138

131-
### Step 2 - build ServicePulse site
139+
### Step 2 - build ServicePulse site
132140

133141
Execute build script from commandline:
134142

@@ -155,30 +163,30 @@ ServicePulse is supported on the following desktop browser versions:
155163

156164
Dockerfiles for ServicePulse reside within the [`src`](https://github.com/Particular/ServicePulse/tree/master/src) folder. There are 2 docker files:
157165

158-
* 1 for a [Windows image](https://github.com/Particular/ServicePulse/blob/master/src/dockerfile.iis)
159-
* 1 for a [Linux image](https://github.com/Particular/ServicePulse/blob/master/src/dockerfile.nginx)
166+
- 1 for a [Windows image](https://github.com/Particular/ServicePulse/blob/master/src/dockerfile.iis)
167+
- 1 for a [Linux image](https://github.com/Particular/ServicePulse/blob/master/src/dockerfile.nginx)
160168

161169
### Building & staging docker images
162170

163171
The docker files are all built as part of the [release workflow](https://github.com/Particular/ServicePulse/blob/master/.github/workflows/release.yml), pushed to dockerhub, and tagged with the version of ServicePulse being deployed.
164172

165173
E.g. If we were deploying version 1.30.1 of ServicePulse, the build configurations after the Deploy step will build the following 2 containers for ServicePulse and tag them `1.30.1`:
166174

167-
* `particular/servicepulse:1.30.1`
168-
* `particular/servicepule-windows:1.30.1`
175+
- `particular/servicepulse:1.30.1`
176+
- `particular/servicepule-windows:1.30.1`
169177

170178
These images are tagged with the specific version of ServicePulse being built and pushed to the corresponding public `particular/servicepulse{-os}` repositories. At this point, the docker images are considered staged. This means that if someone is watching the feed directly, they can install the staged images by explicitly specifying the exact tag, e.g. `docker pull particular/servicepulse:1.30.1`.
171179

172180
### Promoting docker images to production
173181

174182
When a ServicePulse release is promoted to production, one of the steps is to take the staged images and to re-tag them as the following:
175183

176-
* `particular/servicepulse:1.30.1` => `particular/servicepulse:1`
177-
* This is so that customers who are only interested in updates within a major can install the specific major only and not worry about breaking changes between major versions being automatically rolled out. Useful for auto upgrading containers in a *production* environment.
178-
* `particular/servicepulse:1.30.1` => `particular/servicepulse:latest`
179-
* Primarily for developers wanting to use the latest version (`docker-compose up -d --build --force-recreate --renew-anon-volumes`
180-
* This is only in the case where the release's major version is the same as the current latest major version.
181-
* If a fix is being backported to a previous major then the `:latest` tag will not be updated.
182-
* If a release targets the current latest major or is a new major after the previous latest then the `:latest` tag is updated to match the version being released.
184+
- `particular/servicepulse:1.30.1` => `particular/servicepulse:1`
185+
- This is so that customers who are only interested in updates within a major can install the specific major only and not worry about breaking changes between major versions being automatically rolled out. Useful for auto upgrading containers in a _production_ environment.
186+
- `particular/servicepulse:1.30.1` => `particular/servicepulse:latest`
187+
- Primarily for developers wanting to use the latest version (`docker-compose up -d --build --force-recreate --renew-anon-volumes`
188+
- This is only in the case where the release's major version is the same as the current latest major version.
189+
- If a fix is being backported to a previous major then the `:latest` tag will not be updated.
190+
- If a release targets the current latest major or is a new major after the previous latest then the `:latest` tag is updated to match the version being released.
183191

184192
Once the tagging has been completed, the images are considered to be publicly released.

0 commit comments

Comments
 (0)