Getting started with ROR development
Prerequisites
- Linux distro or WSL2 for windows
- Docker runtime
- Docker CE: https://docs.docker.com/engine/install/
- WSL2 tips: https://learn.microsoft.com/en-us/windows/wsl/systemd
- Golang SDK (For debugging and changing) https://go.dev
- ROR API: https://github.com/NorskHelsenett/ror-api
- ROR Web: https://github.com/NorskHelsenett/ror-webapp
Optional:
- Docker Desktop (https://www.docker.com/products/docker-desktop/)
- Talosctl (https://www.talos.dev/v1.8/introduction/quickstart/)
- Kind (https://kind.sigs.k8s.io)
- K3d (https://k3d.io/stable/)
- Python for running documentation with mkdocs
- RO Agent: https://github.com/NorskHelsenett/ror-agent
Clone
- Create a folder on you computer where you want to put the code
- Clone the repository
git clone git@github.com:NorskHelsenett/ror.git
git clone https://github.com/NorskHelsenett/ror.git
Hardware requirements:
Recommendations | CPU | Memory |
---|---|---|
Minimum | 2 | 16GB |
Recommended | 4 | 32GB |
Install docker
Linux
Installation steps for Linux: https://docs.docker.com/engine/install Recommended post-installation steps: https://docs.docker.com/engine/install/linux-postinstall/
Fedora
Fedora
### Installations:sudo dnf -y install dnf-plugins-core
sudo dnf-3 config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
- package docker-ce-3:27.3.1-1.fc40.x86_64 from docker-ce-stable conflicts with docker provided by moby-engine-24.0.5-4.fc40.x86_64 from fedora
- package moby-engine-24.0.5-4.fc40.x86_64 from fedora conflicts with docker-ce provided by docker-ce-3:27.3.1-1.fc40.x86_64 from docker-ce-stable
sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl enable --now docker
sudo docker run hello-world
sudo groupadd docker
sudo usermod -aG docker $USER
docker run hello-world
Windows
https://learn.microsoft.com/en-us/windows/wsl/systemd
TODO
Starting ROR
Run with docker
Note Specific environment variables need to be set up for ROR to run, see Environment Variables
To start the ROR infrastructure you can run:
./r.sh
Which will start the Core infrastructure
To include any optional services you can add them as arguments as shown:
./r.sh jaeger opentelemetry-collector
When the containers start you'll note that the following services will keep crashing, This is intended as they're dependent on the API service which has yet to be started:
- dex
- ms-auth
- ms-talos
- ms-kind
ROR API
For ROR to work you require minimum the API, which can be found here: https://github.com/NorskHelsenett/ror-api
Visual Studio Code
- Open the repository in VSCode
- Go to Debugging
- On "Run and debug" select "Debug ROR-Api" or "Debug ROR-Api tests"
Terminal
TODO
ROR WEB
Clone the ror-webapp repository
git clone https://github.com/NorskHelsenett/ror-webapp
Start the core services as mentioned Here
Start the API as mentioned Here
Start the webapp as mentioned Here
VSCode
TODO
Terminal
TODO
Environment Variables
- <repo root>/
.env
has the default settings for docker compose - Env variables used during development are set in
hacks/docker-compose/
- Env variables used in cluster are set with charts in
charts/
Login to ROR-web
Open your favorite browser, and go to http://localhost:11000 Log in with any of these accounts:
Title | Username | Password |
---|---|---|
super admin | superadmin@ror.dev |
S3cret! |
read only admin | readadmin@ror.dev |
S3cret! |
developer 1 | dev1@ror.dev |
S3cret! |
developer 2 | dev2@ror.dev |
S3cret! |
Swagger
To see swagger for ROR Api, go to http://localhost:10000/swagger/index.html
Core infrastructure
Service | What | Url | ReadMe link | Comment |
---|---|---|---|---|
DEX | Authentication | www: http://localhost:5556, grpc api: http://localhost:5557 | dex doc docker hub | Reachable from inside and outside of docker |
Openldap | Mocking users | http://localhost:389 | ||
MongoDB | Document database | mongodb://localhost:27017 | ||
Mongo-Express | Gui for document base | http://localhost:8081 | ||
RabbitMQ | Message bus | GUI: http://localhost:15672, amqp port: localhost:5672 | ||
Vault | Secrets handling | GUI: http://localhost:8200 | ||
Valkey | Cache | GUI: http://localhost:6379 |
Default users
Service | Username | Password |
---|---|---|
MongoDB | someone |
S3cret! |
Mongo-Express | test |
S3cr3t |
RabbitMQ | admin |
S3cret! |
Optional services
Service | What | Url | ReadMe link | Comment |
---|---|---|---|---|
jaeger | ||||
opentelemetry-collector |
ROR services
Service | What | Url | Port | ReadMe link | Comment |
---|---|---|---|---|---|
ROR-Api | Api | http://localhost:10000 | 8080 | ror-api | |
ROR-WebApp | Web | http://localhost:11000 | 8090 | ror-webapp | |
ROR-Agent | K8s Agent | http://localhost:8100 | 8100 | ror-agent | Not run by docker-compose |
Known issues
See Known-issues
Documentation
We pull documentation from code using some go package. Thus all functions should be annotated with a comment describing its use and any caveats. We keep system documentation in cmd/docs/
, some files are copied in from .md files located in other parts of the repo using the cmd/docs/collectdocs.sh
script. If you see any documentation that is out of date or wrong, please update it.