https://clarityventures-my.sharepoint.com/:w:/g/personal/brent_fife_claritymis_com/EUWf1GoHuSNEvH0lG0DB1PcBwVGDZq_rK0lWQ-caOULowQ?e=aI3fsa
(Original source doc above - the below will change over time so please refer to the source doc for all the latest updates!)
Creating an Accessible OpenRails site in the AI server
- Due to the complexity of setting things up in the server it is easier to copy existing client files and make the necessary changes to get the site up-to-date
- If you copy an existing project like viapro, youll just have to check the git changelogs and change the ports there. This makes the process much faster
- site path from the Rhel-19 T drive :
- Client => /RHEL-19T/Data/Projects/OpenRails/clients
- Internal => /RHEL-19T/Data/Projects/OpenRails/internal
- Create new folders for site.
- Clients/{{name}}
- Python -> AI respository
- Phx - > PHX Repository
- Pull latest
- Python -> pull develop
- PHX ->
- OpenRail Plugin -> pull latest
- Client -> openrails/develop -> pull latest
- Core -> Cautiously pull latest
- Note
- BE careful to note places that might he over written in the client and core projects as some of those places will need to me modified to get ports unique
- Setup Phx
- Note
- At the time of writing this docker files have not been committed, so if you use the vanilla docker, there is a chance youll miss important settings. Be sure to copy one from an existing site
- Dev.docker-compose.yml
- Modify names
- A search and replace can speed this long
- => backend_{{new_name}}
- Backend service
- Modify service name
- Change network to match your naming conventions
- Choose your BE api port
- Standard is 8080
- Youll have to change this in a few places
- In the docker -> backend service -> ports
-
- Backend.dockerfile
- Change the port in the last command
-
- Change the core route here to reflect that port:
- /RHEL-19T/Data/Projects/OpenRails/clients/viapro/stg/phx/Core/Phoenix.CoreUI/src/api.ts
-
- Change your connection string for the correct db to be auto generated
- Example : ConnectionStrings:Clarity: "Server=10.100.20.19\\SQL2019;Database=OPENRAILS_VIAPRO_STG;User Id=;Password=! =true;Persist Security Info=True;TrustServerCertificate=true;"
- Change the redisesttings:host name to reflect the redis name you set below
- Set these
- The KEK is used to encrypt and will need to be the same for both python and phx. The python url will be the same but the port will change depending on what y ou set it to
- Front end service
- Modify service name
- Modify network name
- Modify ports in code
- Package.json
- Proxy.js
-
- /api is the port the site will listen on
- The middleware port
- Listen port for the BE -set in the core file
- Redis Service
- Change service, networks, and container name
- Change first port . {{change_port}}:6379
-
- Docker file
- You may need to change some backend and frontend docker ports
- Setup Python
- Note
- At the time of writing this docker files have not been committed, so if you use the vanilla docker, there is a chance youll miss important settings. Be sure to copy one from an existing site
- Docker-compose.yml
- Modify each service name to reflect the site you are standing up
-
- Run.py
- Change port
-
- Ingestor. Configs has an issue with the url. Had to hardcode it
-
- Redis port must be changed
- Set up docker instances
- Python
- sudo docker compose -f docker-compose.yml build –-no-cache
- sudo docker compose -f docker-compose.yml up -d
- -d makes it a background process
- Phx
- sudo docker compose -f dev.docker-compose.yml build –-no-cache
- sudo docker compose -f dev.docker-compose.yml up -d
- -d makes it a background process
- Point Nginx at the new instance
- Create new proxy with opnrls-{{name}}.clairtyclient.com
- Use clairtyclient existing ssl cert
- Set site addres to AI server IP with port the FE is set to listen on
-
- Update docker containers to latest
- Pull latest
- May need to merge latest into a new branch so ports aren’t lost
- Only build FE and BE. If you shut everything down it could cause an issue with indexing
- sudo docker compose -f docker-compose.yml down {{service-name-in compose file}}
- sudo docker compose -f docker-compose.yml build –-no-cache {{service-name-in compose file}}
- sudo docker compose -f docker-compose.yml up -d {{service-name-in compose file}}