Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 76b47f83 authored by SAUCEZ Damien's avatar SAUCEZ Damien
Browse files

Merge branch 'develop' into 'main'

First version with new structure

See merge request !1
parents 4cd7af4b 570c4217
No related branches found
No related tags found
1 merge request!1First version with new structure
Showing
with 518 additions and 80 deletions
5g.yaml 0 → 100644
- name: Deploy Core, RAN, and UE
hosts: masters[0]
roles:
- role: 5g/base
- role: 5g/core
when: GCN.core.present | default(false)
- role: 5g/flexric
when: GCN.flexric.present | default(false)
- role: 5g/ran
when: GCN.RAN.present | default(false)
- role: 5g/ue
when: GCN.UE.present | default(false)
\ No newline at end of file
FROM ubuntu:24.04
RUN apt update && apt install -y python3-pip git rsync vim nano emacs
RUN python3 -m pip install --break-system-packages --user ansible-core==2.17.2
RUN echo "export PATH=$PATH:~/.local/bin" >> ~/.bashrc
RUN mkdir /reqs/
COPY collections/requirements.yml /reqs/ansible-galaxy.yml
COPY requirements.txt /reqs/python3.txt
RUN ~/.local/bin/ansible-galaxy install -r /reqs/ansible-galaxy.yml
RUN pip3 install --break-system-packages -r /reqs/python3.txt
WORKDIR /blueprint
\ No newline at end of file
# reference_implementation # Deploy the environment
## Deployment node
```console
## Getting started docker build -t deployment_node -f Dockerfile .
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://gitlab.inria.fr/slices-ri/blueprints/post-5g/reference_implementation.git
git branch -M main
git push -uf origin main
``` ```
## Integrate with your tools ```console
docker run --rm -it -v "$(pwd)":/blueprint -v ${HOME}/.ssh/id_rsa:/private_key deployment_node
- [ ] [Set up project integrations](https://gitlab.inria.fr/slices-ri/blueprints/post-5g/reference_implementation/-/settings/integrations) ```
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation ## Create secrets file
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage We recommand to encryp the secrets file, for that, we use Ansible vault. To
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. create the file and vault it, use the following command:
## Support ```console
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. EDITOR=nano ansible-vault edit secrets.yaml
```
## Roadmap In this secret file you have to define
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing ```yaml
State if you are open to contributions and what your requirements are for accepting them. secrets:
prometheus_basic_auth_password: REDACTED
grafana_password: REDACTED
```
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. This will create the encrypted file `secrets.yaml` that we can use later to
access to critical data.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. ## deploy the monitoring collector
```console
ansible-playbook -i inventories/staging --extra-vars "@params.yaml" --extra-vars "@secrets.yaml" --ask-vault-pass lpg.yaml
```
## Authors and acknowledgment > If you don't want to type the vault password, you can write you vault
Show your appreciation to those who have contributed to the project. > password in a file (e.g., `a_password_file`) and get it from there by
> replacing `--ask-vault-pass` by `--vault-id dev@a_password_file`.
## License ## deploy the cluster
For open source projects, say how it is licensed. ```console
ansible-playbook -i inventories/staging --extra-vars "@params.yaml" --extra-vars "@secrets.yaml" --ask-vault-pass k8s-cluster.yaml
```
## Project status ## Deploy 5G network
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. ```console
ansible-playbook -i inventories/staging --extra-vars "@params.yaml" --extra-vars "@params.5g.yaml" --extra-vars "@secrets.yaml" --ask-vault-pass 5g.yaml
```
\ No newline at end of file
- name: Install cluster monitoring
hosts: masters[0]
vars:
remote_write_address: "{{ k8s['cluster_monitoring']['prometheus']['remote_write_address'] }}"
remote_write_port: "{{ k8s['cluster_monitoring']['prometheus']['remote_write_port'] }}"
remote_write_user: "{{ k8s['cluster_monitoring']['prometheus']['remote_write_user'] }}"
remote_write_pass: "{{ k8s['cluster_monitoring']['prometheus']['remote_write_pass'] }}"
remote_data_label: "{{ k8s['cluster_monitoring']['prometheus']['remote_data_label'] }}"
loki_address: "{{ k8s['cluster_monitoring']['promtail']['loki_address'] }}"
loki_port: "{{ k8s['cluster_monitoring']['promtail']['loki_port'] }}"
loki_label: "{{ k8s['cluster_monitoring']['promtail']['loki_label'] }}"
roles:
- post-5g-bp-cluster-monitoring/prometheus
- post-5g-bp-cluster-monitoring/promtail
- post-5g-bp-cluster-monitoring/cadvisor
- post-5g-bp-cluster-monitoring/node-exporter
- post-5g-bp-cluster-monitoring/kube-state-metrics
\ No newline at end of file
...@@ -5,4 +5,5 @@ collections: ...@@ -5,4 +5,5 @@ collections:
- name: kubernetes.core - name: kubernetes.core
- name: community.crypto - name: community.crypto
- name: community.general - name: community.general
- name: community.docker - name: community.docker
\ No newline at end of file - name: community.grafana
\ No newline at end of file
---
- name: Deploy FlexRIC
hosts: masters[0]
roles:
- role: 5g/flexric
\ No newline at end of file
ansible_ssh_common_args: '-o StrictHostKeyChecking=no -oKexAlgorithms=+diffie-hellman-group1-sha1'
ansible_ssh_private_key_file: /private_key
ansible_user: dsaucezi
install_custom_kernel: true
tcp_rmem: "4096 87380 {{ 67108864 if ansible_memtotal_mb >= 64000 else 33554432 if ansible_memtotal_mb >= 32000 else 16777216 }}"
tcp_wmem: "4096 87380 {{ 67108864 if ansible_memtotal_mb >= 64000 else 33554432 if ansible_memtotal_mb >= 32000 else 16777216 }}"
kernel:
image: lowlatency
GRUB_CMDLINE_LINUX_DEFAULT: quiet splash elevator=bfq
attributes:
- option: vm.swappiness
value: 1
- option: net.core.somaxconn
value: 65535
- option: net.ipv4.tcp_tw_reuse
value: 1
- option: net.ipv4.tcp_fin_timeout
value: 30
- option: net.ipv4.tcp_keepalive_time
value: 1200
- option: net.ipv4.ip_local_port_range
value: '1024 65000'
- option: net.ipv4.tcp_syncookies
value: 1
- option: net.ipv4.tcp_synack_retries
value: 2
- option: net.ipv4.tcp_timestamps
value: 1
- option: net.ipv4.tcp_max_syn_backlog
value: 65535
- option: net.core.netdev_max_backlog
value: 65535
- option: net.ipv4.tcp_rmem
value: '{{ tcp_rmem }}'
- option: net.ipv4.tcp_wmem
value: '{{ tcp_wmem }}'
- option: net.core.rmem_max
value: '{{ tcp_rmem.split()[-1] }}'
- option: net.core.wmem_max
value: '{{ tcp_wmem.split()[-1] }}'
limits:
- domain: '*'
type: 'hard'
item: 'nofile'
value: '4194304'
- domain: '*'
type: 'soft'
item: 'nofile'
value: '4194304'
\ No newline at end of file
all:
hosts:
192.168.0.1:
name: node0
apiserver_advertise_address: 192.168.0.1
192.168.0.3:
name: node1
apiserver_advertise_address: 192.168.0.3
192.168.0.2:
name: node2
apiserver_advertise_address: 192.168.0.2
192.168.0.4:
name: node3
apiserver_advertise_address: 192.168.0.4
192.168.0.5:
name: io
apiserver_advertise_address: 192.168.0.5
KUBELET_EXTRA_ARGS:
cpu-manager-policy: "static"
kube-reserved=cpu: "2"
children:
workers:
hosts:
192.168.0.4:
masters:
hosts:
192.168.0.3:
192.168.0.2:
lowlatency_kernel:
hosts:
# 192.168.0.:
flexric:
hosts:
# 192.168.0.:
ha:
hosts:
192.168.0.1:
central_monitor:
hosts:
192.168.0.1:
ansible_ssh_common_args: '-o StrictHostKeyChecking=no -oKexAlgorithms=+diffie-hellman-group1-sha1'
ansible_ssh_private_key_file: /private_key
ansible_user: ubuntu
install_custom_kernel: true
tcp_rmem: "4096 87380 {{ 67108864 if ansible_memtotal_mb >= 64000 else 33554432 if ansible_memtotal_mb >= 32000 else 16777216 }}"
tcp_wmem: "4096 87380 {{ 67108864 if ansible_memtotal_mb >= 64000 else 33554432 if ansible_memtotal_mb >= 32000 else 16777216 }}"
kernel:
image: lowlatency
GRUB_CMDLINE_LINUX_DEFAULT: quiet splash elevator=bfq
attributes:
- option: vm.swappiness
value: 1
- option: net.core.somaxconn
value: 65535
- option: net.ipv4.tcp_tw_reuse
value: 1
- option: net.ipv4.tcp_fin_timeout
value: 30
- option: net.ipv4.tcp_keepalive_time
value: 1200
- option: net.ipv4.ip_local_port_range
value: '1024 65000'
- option: net.ipv4.tcp_syncookies
value: 1
- option: net.ipv4.tcp_synack_retries
value: 2
- option: net.ipv4.tcp_timestamps
value: 1
- option: net.ipv4.tcp_max_syn_backlog
value: 65535
- option: net.core.netdev_max_backlog
value: 65535
- option: net.ipv4.tcp_rmem
value: '{{ tcp_rmem }}'
- option: net.ipv4.tcp_wmem
value: '{{ tcp_wmem }}'
- option: net.core.rmem_max
value: '{{ tcp_rmem.split()[-1] }}'
- option: net.core.wmem_max
value: '{{ tcp_wmem.split()[-1] }}'
limits:
- domain: '*'
type: 'hard'
item: 'nofile'
value: '4194304'
- domain: '*'
type: 'soft'
item: 'nofile'
value: '4194304'
\ No newline at end of file
all:
hosts:
192.168.64.15:
name: node1
# bindPort: 6443
apiserver_advertise_address: 192.168.64.15
192.168.64.16:
name: node2
# bindPort: 6443
apiserver_advertise_address: 192.168.64.16
192.168.64.41:
name: monitor
# bindPort: 6443
apiserver_advertise_address: 192.168.64.41
# KUBELET_EXTRA_ARGS:
# cpu-manager-policy: "static"
# kube-reserved=cpu: "2"
children:
ha:
hosts:
# 192.168.64.92:
masters:
hosts:
192.168.64.15:
workers:
hosts:
192.168.64.16:
lowlatency_kernel:
hosts:
192.168.64.16:
kernel:
image: lowlatency
GRUB_CMDLINE_LINUX_DEFAULT: quiet splash elevator=bfq
central_monitor:
hosts:
192.168.64.41:
---
- name: HA Preparation
hosts: ha
roles:
- ha
- name: Deploy first master
hosts: masters[0]
roles:
- k8s/create
- k8s/auth
post_tasks:
- name: Wait for the node to be ready
ansible.builtin.include_tasks: k8s-ready.yaml
- name: Setup cluster monitoring
hosts: masters[0]
vars:
remote_write_address: "{{ k8s['cluster_monitoring']['prometheus']['remote_write_address'] }}"
remote_write_port: "{{ k8s['cluster_monitoring']['prometheus']['remote_write_port'] }}"
remote_write_user: "{{ k8s['cluster_monitoring']['prometheus']['remote_write_user'] }}"
remote_write_pass: "{{ secrets['prometheus_basic_auth_password'] }}"
remote_data_label: "{{ k8s['cluster_monitoring']['prometheus']['remote_data_label'] }}"
loki_address: "{{ k8s['cluster_monitoring']['promtail']['loki_address'] }}"
loki_port: "{{ k8s['cluster_monitoring']['promtail']['loki_port'] }}"
loki_label: "{{ k8s['cluster_monitoring']['promtail']['loki_label'] }}"
roles:
- cluster_monitoring
- name: Attach masters
hosts: masters[1:]
vars:
token: "{{ hostvars['ansible_dummy_host']['_token'] }}"
ca_cert_hash: "{{ hostvars['ansible_dummy_host']['_ca_cert_hash'] }}"
certificate_key: "{{ hostvars['ansible_dummy_host']['_certificate_key'] }}"
kube_config_local_path: "{{ hostvars['ansible_dummy_host']['_kube_config'] }}"
master: "{{ k8s['apiserver_advertise_address'] }}"
is_control_plane_node: true
environment:
PATH: '{{ansible_env.PATH }}:/usr/local/bin/'
roles:
- role: k8s/join
post_tasks:
- name: Wait for the node to be ready
ansible.builtin.include_tasks: k8s-ready.yaml
- name: Install k8s nodes
hosts: workers:!masters
vars:
token: "{{ hostvars['ansible_dummy_host']['_token'] }}"
ca_cert_hash: "{{ hostvars['ansible_dummy_host']['_ca_cert_hash'] }}"
kube_config_local_path: "{{ hostvars['ansible_dummy_host']['_kube_config'] }}"
master: "{{ k8s['apiserver_advertise_address']"
environment:
PATH: '{{ansible_env.PATH }}:/usr/local/bin/'
roles:
- role: k8s/join
post_tasks:
- name: Wait for the node to be ready
ansible.builtin.include_tasks: k8s-ready.yaml
- name: Install metallb
hosts: masters[0]
roles:
- role: k8s/metallb
when: k8s.metallb is defined
\ No newline at end of file
- name: Wait for the node to be ready
ansible.builtin.shell: 'kubectl wait --timeout=300s --all-namespaces --for=condition=Ready nodes {{ hostvars[inventory_hostname]["name"] }}'
register: node_wait
retries: 10
until: node_wait is succeeded
- name: Wait for the pods to be ready
ansible.builtin.shell: 'kubectl wait --timeout=300s --all-namespaces --for=condition=Ready pods --field-selector spec.nodeName={{ hostvars[inventory_hostname]["name"] }}'
\ No newline at end of file
---
- name: Low Latency kernel
hosts: lowlatency_kernel
roles:
- role: kernel
\ No newline at end of file
lpg.yaml 0 → 100644
- hosts: central_monitor
vars:
prometheus_basic_auth_user: "{{ central_monitor['prometheus']['prometheus_basic_auth_user'] }}"
prometheus_basic_auth_password: "{{ secrets['prometheus_basic_auth_password'] }}"
grafana_password: "{{ secrets['grafana_password'] }}"
roles:
- grafana-loki-prometheus/prometheus
- grafana-loki-prometheus/loki
- grafana-loki-prometheus/grafana
\ No newline at end of file
# 5G config
GCN:
config_files: oai-cn5g-fed/ # make sur the path finished by a `/`
core:
present: true
namespace: core
nrfLoadBalancerIP: "192.0.2.250"
cleanup: true
RAN:
present: true
namespace: ran
cleanup: true
split:
f1: true
e1: true
UE:
present: true
cleanup: false
namespace: ran
flexric:
present: true
multus:
network: "192.0.2.0/24"
hostInterface: 'ran0'
# routes:
# - dst: 69.0.1.0/24
# gw: 192.0.2.1
mcc: '001'
mnc: '01'
tac: '0x0001'
sst: 1
dnns:
- dnn: oai
pdu_session_type: IPV4
ipv4_subnet: 12.1.1.0/24
- dnn: ims
pdu_session_type: IPV4V6
ipv4_subnet: 14.1.1.0/24
slices:
- snssai:
sst: 1
plnms:
- mcc: '001'
mnc: '01'
dnns:
- oai
qos_profile:
5qi: 5
session_ambr_ul: 200Mbps
session_ambr_dl: 400Mbps
- snssai:
sst: 1
sd: "FFFFFF"
plnms:
- mcc: '001'
mnc: '01'
dnns:
- ims
qos_profile:
5qi: 2
session_ambr_ul: 100Mbps
session_ambr_dl: 200Mbps
---
# docker configuration
docker:
# insecure_registries:
# - 192.0.2.1:5000
registry_mirrors:
- http://192.168.0.1:5000
# data_root: "/docker_data"
# k8s configuration
k8s:
clusterName: vwall-production
# runtime: docker
# cni_plugin: calico
podSubnet: 10.244.0.0/16
serviceSubnet: 10.96.0.0/16
dnsDomain: cluster.local
bindPort: 6443
controlPlaneEndpoint: 192.168.0.69:6443
calico:
nodeAddressAutodetectionV4:
cidrs:
- 192.168.0.0/24
encapsulation: VXLAN
metallb:
addresses:
- 172.29.0.250/32
cluster_monitoring:
prometheus:
remote_write_address: "192.168.0.1"
remote_write_port: "9090"
remote_write_user: "admin"
remote_data_label: "centralhub"
promtail:
loki_address: 192.168.0.1
loki_port: 3100
loki_label: "centralhub"
central_monitor:
prometheus:
prometheus_basic_auth_user: 'admin'
---
# docker configuration
docker:
# insecure_registries:
# - 192.0.2.1:5000
#registry_mirrors:
# - http://192.168.0.1:5000
# data_root: "/docker_data"
# k8s configuration
k8s:
clusterName: sopode-stagging
# runtime: docker
# cni_plugin: calico
podSubnet: 10.244.0.0/16
serviceSubnet: 10.96.0.0/16
dnsDomain: cluster.local
bindPort: 6443
# controlPlaneEndpoint: 192.168.64.92:6443
calico:
nodeAddressAutodetectionV4:
cidrs:
- 192.168.64.0/24
encapsulation: VXLAN
metallb:
addresses:
- 192.0.2.250/32
cluster_monitoring:
prometheus:
remote_write_address: "192.168.64.41"
remote_write_port: "9090"
remote_write_user: "admin"
remote_data_label: "sopnode-stagging"
promtail:
loki_address: 192.168.64.41
loki_port: 3100
loki_label: "sopnode-stagging"
central_monitor:
prometheus:
prometheus_basic_auth_user: 'admin'
netaddr==0.8.0
PyYAML==6.0.1
requests==2.22.0
bcrypt==3.2.2
Jinja2==3.0.3
ipaddr==2.2.0
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment