-
Notifications
You must be signed in to change notification settings - Fork 8
docs: add NMS setup workflow guide #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Heiliger4
wants to merge
3
commits into
magma:main
Choose a base branch
from
Heiliger4:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,204 @@ | ||
# Easy Git and Docker Setup for Contributing to Magma's NMS | ||
|
||
Magma is an open-source platform that helps network operators build flexible and modern mobile networks. This guide focuses on setting up the NMS (Network Management System) part of Magma for development using Git and Docker. | ||
|
||
## Introduction | ||
|
||
This guide breaks it down into simple steps, including: | ||
- Forking and cloning the repo | ||
- Keeping your code up to date | ||
- Building and running backend services with Docker | ||
- Accessing the NMS portals | ||
|
||
|
||
## Step 1: Fork and Clone the Repository | ||
|
||
The first step is straightforward but essential. | ||
You should have already forked the Magma repository to your own GitHub account. For example: | ||
```bash | ||
https://github.com/username/magma.git | ||
``` | ||
|
||
Now, clone your fork locally: | ||
|
||
```bash | ||
git clone https://github.com/username/magma.git | ||
cd magma | ||
``` | ||
|
||
## Step 2: Keep Your Fork Updated | ||
|
||
To pull in the latest changes from the official Magma repo, add the main repository as an upstream remote: | ||
|
||
```bash | ||
git remote add upstream https://github.com/magma/magma.git | ||
``` | ||
|
||
Verify your remotes: | ||
|
||
```bash | ||
git remote -v | ||
``` | ||
|
||
This setup helps you sync your fork with the original repository regularly. | ||
|
||
## Step 3: Build the Orc8r Backend Docker Artifacts | ||
|
||
Magma's backend (Orc8r) requires a specific build step involving Docker containers. | ||
|
||
### Important Note on Ruby Gem Compatibility | ||
|
||
You might encounter compatibility errors with Ruby gems during this step. | ||
Here's a recommended fix: | ||
- Navigate to the Fluentd Dockerfile path: | ||
|
||
```bash | ||
cd magma/orc8r/cloud/docker/fluentd | ||
``` | ||
- Modify the Dockerfile from: | ||
|
||
```dockerfile | ||
FROM fluent/fluentd:v1.14.6-debian-1.0 | ||
USER root | ||
RUN gem install \ | ||
elasticsearch:7.13.0 \ | ||
fluent-plugin-elasticsearch:5.2.1 \ | ||
fluent-plugin-multi-format-parser:1.0.0 \ | ||
--no-document | ||
USER fluent | ||
``` | ||
|
||
- To this updated version: | ||
|
||
```dockerfile | ||
FROM fluent/fluentd:v1.14.6-debian-1.0 | ||
USER root | ||
RUN gem install rubygems-update -v 3.2.33 --no-document && \ | ||
update_rubygems && \ | ||
gem install multi_json -v 1.15.0 --no-document && \ | ||
gem install elasticsearch -v 7.13.0 --no-document && \ | ||
gem install fluent-plugin-elasticsearch -v 5.2.1 --no-document && \ | ||
gem install fluent-plugin-multi-format-parser -v 1.0.0 --no-document | ||
USER fluent | ||
``` | ||
|
||
|
||
Then run the build script from the orc8r/cloud/docker directory: | ||
|
||
```bash | ||
cd orc8r/cloud/docker | ||
./build.py --all | ||
``` | ||
|
||
**Image 1: Successful Orc8r build output** | ||
 | ||
*Caption: Terminal output confirming the successful build of Orc8r Docker artifacts.* | ||
|
||
|
||
## Step 4: Start Orc8r Backend Containers | ||
|
||
From the `orc8r/cloud/docker/` directory, start the containers: | ||
|
||
```bash | ||
./run.py --metrics | ||
``` | ||
|
||
Or use Docker Compose: | ||
|
||
```bash | ||
docker-compose up -d | ||
``` | ||
|
||
**Image 2: Orc8r containers running** | ||
 | ||
*Caption: Terminal output showing active Orc8r services (e.g., controller, nginx, postgres).* | ||
|
||
## Step 5: Build and Run the NMS Docker Containers | ||
|
||
Navigate to the NMS directory: | ||
|
||
```bash | ||
cd ../../../nms | ||
``` | ||
|
||
Build the NMS Docker image: | ||
|
||
```bash | ||
COMPOSE_PROJECT_NAME=magmalte docker compose --compatibility build magmalte | ||
``` | ||
**Image 3: NMS Docker image build** | ||
 | ||
*Caption: Terminal output confirming the successful build of the NMS Docker image.* | ||
|
||
Start the NMS containers: | ||
|
||
```bash | ||
docker compose --compatibility up -d | ||
``` | ||
|
||
**Image 4: NMS containers running** | ||
 | ||
*Caption: Terminal output confirming the NMS containers are up and running.* | ||
|
||
## Step 6: Set the Admin User Password (First-Time Setup) | ||
|
||
Configure the admin password for the NMS: | ||
|
||
```bash | ||
docker compose exec magmalte yarn setAdminPassword host [email protected] password1234 | ||
``` | ||
You can modify the email and password as needed later. | ||
|
||
**Image 5: Admin user password setup** | ||
 | ||
*Caption: Terminal output confirming the successful setup of the NMS admin user password.* | ||
|
||
## Step 7: Verify Orc8r is Running | ||
|
||
Check the status of Orc8r containers: | ||
|
||
```bash | ||
cd orc8r/cloud/docker | ||
docker-compose ps | ||
``` | ||
You should see active containers like nginx, controller, fluentd, and postgres. | ||
|
||
## Step 8: (Optional) Start Prometheus and Grafana for Metrics | ||
|
||
Start Prometheus and Grafana: | ||
|
||
```bash | ||
docker-compose -f docker-compose.metrics.yml up -d | ||
``` | ||
|
||
Ensure the `docker-compose.metrics.yml` includes: | ||
|
||
```yaml | ||
networks: | ||
default: | ||
external: | ||
name: orc8r_default | ||
``` | ||
|
||
**Image 6: Prometheus and Grafana metrics** | ||
 | ||
*Caption: Terminal output confirming the Prometheus and Grafana containers are up and running.* | ||
|
||
## Step 9: Access the Web Portals | ||
|
||
- **Host Portal**: Manage organizations at `http://host.localhost:8081/host` | ||
Credentials: | ||
- Email: `[email protected]` | ||
- Password: `password1234` | ||
|
||
- **Admin Portal**: Manage users at `http://magma-test.localhost:8081/admin` | ||
Credentials (after creating a superuser): | ||
- Email: `[email protected]` | ||
- Password: `pass1234` | ||
|
||
## Final Notes | ||
|
||
- Monitor metrics at `http://localhost:9090/targets`. | ||
- Regularly sync your fork with `git fetch upstream` and `git merge upstream/main` to avoid conflicts. | ||
- Customize credentials for security in production-like setups. | ||
 | ||
|
||
--- |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is the official documentation, do you think this is necessary?