You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+54-46
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ See the [ServicePulse documentation](https://docs.particular.net/servicepulse/)
8
8
9
9
## Setting up the project for development
10
10
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.
12
12
13
13
```mermaid
14
14
graph LR
@@ -32,6 +32,7 @@ graph LR
32
32
VueJs --> ScMonitoring
33
33
VueJs --> ScError
34
34
```
35
+
35
36
### Setting up ServiceControl Main and ServiceControl Monitoring instances
36
37
37
38
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
46
47
47
48
Install the following dependencies if you don't have them installed yet
48
49
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)
56
58
57
59
### Set development environment
58
60
61
+
> [!TIP]
62
+
> Using the `ServicePulse\src\run-dev.cmd` batch file will execute steps 1 - 3.
63
+
59
64
#### Step 0 - Using a suitable IDE for frontend development
60
65
61
66
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.
62
67
Because of that, we have [extra recommendations](/docs/frontend/frontend-ide.md) for you to be even more successful at frontend development.
63
68
64
69
#### Step 1 - run Nginx reverse proxy
65
-
70
+
66
71
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:
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
77
80
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
81
88
82
89
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)
85
93
86
94
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`.
87
95
88
96
#### Step 4 - open the browser
89
97
90
98
After doing the above steps, navigate to `http://localhost:1331` to see the ServicePulse application.
91
99
92
-
### Provided npm scripts
100
+
### Provided npm scripts
93
101
94
102
#### Vue.js
95
103
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
100
108
101
109
#### AngularJS
102
110
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`
115
123
116
124
NOTE:
117
125
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`.
128
136
129
137
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:
130
138
131
-
### Step 2 - build ServicePulse site
139
+
### Step 2 - build ServicePulse site
132
140
133
141
Execute build script from commandline:
134
142
@@ -155,30 +163,30 @@ ServicePulse is supported on the following desktop browser versions:
155
163
156
164
Dockerfiles for ServicePulse reside within the [`src`](https://github.com/Particular/ServicePulse/tree/master/src) folder. There are 2 docker files:
157
165
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)
160
168
161
169
### Building & staging docker images
162
170
163
171
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.
164
172
165
173
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`:
166
174
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`
169
177
170
178
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`.
171
179
172
180
### Promoting docker images to production
173
181
174
182
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:
* 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.
* 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.
- 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.
- 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.
183
191
184
192
Once the tagging has been completed, the images are considered to be publicly released.
0 commit comments