Skip to content

Commit

Permalink
Merge pull request React-Automation-Studio#127 from React-Automation-…
Browse files Browse the repository at this point in the history
…Studio/addcodespacesdemo

Add Codespaces Demo
  • Loading branch information
wduckitt authored Feb 13, 2024
2 parents b61c3a5 + c6c9bd9 commit 0d9cba0
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ If you wish to create a standalone AlarmHandler project you should clone this pr

https://github.com/React-Automation-Studio/React-Automation-Studio-Alarm-Handler-Standalone

**Or try it out on Codespaces (Experimental):**

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/React-Automation-Studio/codespaces-demo?quickstart=1)


Each of the Docker containers are deployed as micro services and environment variables can be configured to deploy the system on different ports, or to enable user authentication and authorisation or to serve the application on a unique URL or on the localhost. Separate Docker commands exist to load the development and production version. These containerised environments allows for precise versioning of packages used and prevents deployment dependency issues.

Expand Down Expand Up @@ -117,7 +121,7 @@ As of Release 3.0.0 the RAS AlarmHandler component is considered production read

The alarm handler is seeded through JSON files that populate the MongoDB alarm handler database. This database is also used to persist all alarm events and activity logs.

The alarm handler front end UI allows users to configure all aspects of the alarms and search through the entire alarm log. Alarm areas, subAreas and pvs can also be added/removed from the front end by alarmAdmin role users.
The alarm handler front end UI allows users to configure all aspects of the alarms and search through the entire alarm log. Alarm areas, subAreas and pvs can also be added/removed from the front end by alarmAdmin role users.

A user notification platform has also been created for the alarm handler. This platform allows a user to target specific pvs to be notified about using javascript regular expressions. At present users can be notified via email and Signal messenger. In future we hope to expand this to SMS and WhatsApp.

Expand All @@ -133,7 +137,7 @@ The development and production versions of React Automation Studio have been con
It is advised to only use the containerized version with a Linux environment. (See the FAQ section on other operating systems).


Prerequisites: git, latest version of docker-ce and docker compose
Prerequisites: git, latest version of docker-ce and docker compose

( At the time of writing the system used Docker V25.0.2 and docker compose V2.24.5 )

Expand All @@ -158,7 +162,7 @@ git clone https://github.com/React-Automation-Studio/React-Automation-Studio.git
```
or

```bash
```bash
git clone [email protected]:React-Automation-Studio/React-Automation-Studio.git
```

Expand Down Expand Up @@ -310,7 +314,7 @@ The built client will be then served https://(hostname or ip):SERVER_PORT/, the

## 3.2 Enabling login and authentication

After enabling HTTPS
After enabling HTTPS

Set up the .env to enable login:
```bash
Expand Down Expand Up @@ -349,9 +353,9 @@ Set VITE_EnableGoogleLogin=true
VITE_EnableGoogleLoginId= xxxxx
```
Set VITE_EnableGoogleLoginId to your google client id for your domain
at https://console.developers.google.com/apis/credentials/
at https://console.developers.google.com/apis/credentials/
click create new credentials and the create a new oAuth id for the web app
It needs an https domain.
It needs an https domain.
you can enter multiple domains:
for example: https://mydomain
https://mydomain:5000
Expand Down Expand Up @@ -384,20 +388,20 @@ The table display in the user interface allows one ot edit the access rights in

*Fig 3.3.1. The administrator access control page showing the default UAG*

To enable write access for everyone one could check the write access check boxes. To disable read access and therefore prevent access by anyone by default one could deselect the read checkboxes. The username set in DEFAULT UAG is '*' and by setting any of the UAG usernames to '*' implies that all users will get the rules defined in the UAG.
To enable write access for everyone one could check the write access check boxes. To disable read access and therefore prevent access by anyone by default one could deselect the read checkboxes. The username set in DEFAULT UAG is '*' and by setting any of the UAG usernames to '*' implies that all users will get the rules defined in the UAG.
In the pvServer, the read and write access of the rules in the UAG are applied if the username is defined in the UAG and the following match function is satisfied:<br/><br/>
match=re.search(rule,pv)
<br/>
<br/>
If the match is true, then the rule is applied.
<br/>

<br/>
In theory, all regular expression searches allowed by Python regex can be used although this has not been tested. More examples are available at:<br/>
<br/>
https://www.w3schools.com/python/python_regex.asp


<br/>
<br/>
In the two examples shown below in Fig 3.3.2 and 3.3.3, the ENGINEERS UAG, with roles as 'engineers' and user name user1 get read and write access to every pv, whilst the OPERATORS UAG, with roles as operators and username operator1 only gets read access for all pvs and write access for the two setpoint pvs.
Expand All @@ -406,7 +410,7 @@ https://www.w3schools.com/python/python_regex.asp
<br/>
<img src="./ReactApp/img/UAGengineers.png" alt="drawing" width="60%"/>
<br/>

*Fig 3.3.2. An example UAG for Engineers*
<br/>
<br/>
Expand All @@ -427,7 +431,7 @@ https://www.w3schools.com/python/python_regex.asp
By default, unless a user logs out the refresh token will keep as user logged in for 1 week. And whilst the user is logged in the access tokens and refresh tokens are refreshed once a minute.
<br/>
<br/>
The token expiry is controlled by the following variables in the .env file.
The token expiry is controlled by the following variables in the .env file.

<br/>
<br/>
Expand Down Expand Up @@ -564,7 +568,7 @@ or: https://doi.org/10.18429/JACoW-ICALEPCS2023-FR2BCO01
We currently only build and test on Ubuntu and Chrome. We unfortunately don't have the time to test on the other systems. In theory all up to date Linux systems should be supported.

### 2. Are other systems such as Windows or Mac OS supported?

The docker containers for RAS run in network mode host. This is done to enable EPICS to communicate seamlessly with any IOC's on the same subnet as the host. Other OSes such as Windows may not support the host mode and will run in the bridged mode. This may break the communication between the micro services. It is therefore recommended to run the RAS containers on a Linux VM that is minimally running Ubuntu Server. Please ensure the the VM network interface is assigned an IP on the same subnet as your EPICS network in order for communication with the IOC's to occur seamlessly.


Expand All @@ -578,7 +582,7 @@ or: https://doi.org/10.18429/JACoW-ICALEPCS2023-FR2BCO01
<li>Package updates to all Node modules</li>
<li>Updated to the latest Node LTS</li>
<li>MUI has been updated to the latest packages</li>

</ul>
New Features:
<ul>
Expand Down Expand Up @@ -625,7 +629,7 @@ V4.0.2 Thursday 13 July 2023 Minor Updates:
<li>Package updates to all Node modules</li>
<li>Updated to the latest Node LTS</li>
<li>MUI has been updated to the latest packages</li>

</ul>
Minor Bug Fixes and Updates:
<ul>
Expand All @@ -648,12 +652,12 @@ V4.0.1 Friday 24 March 2023 Minor Updates:
Minor Bug Fixes and Updates:
<ul>
<li>A few minor bug fixes to the slider and the context menu</li>

</ul>
Minor Breaking Changes:
<ul>
<li>Previous version of google sign in is being deprecated (see https://developers.googleblog.com/2021/08/gsi-jsweb-deprecation.html )Solution is to replace "react-google-login" with @react-oauth/google</li>

</ul>
<br />

Expand Down Expand Up @@ -756,14 +760,14 @@ Improvements and new features:
</li>
<li>Package updates</li>
<li>Minor Bug Fixes</li>

</ul>
Breaking changes:
<ul>
<li>Removal of the old file based administration</li>
<li>Environment variable names have been simplified</li>
<li>GraphY and GraphXY background now defaults to the theme.palette.background.default value</li>

</ul>


Expand Down

0 comments on commit 0d9cba0

Please sign in to comment.