-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Loadcore agent (#24) * Add Keysight LoadCore Agent Component * Delete Middleware IP as input variable * Nokia xrext uma (#25) * Add Nokia XRext Component * Initial release of the 6G Library XRext component * Removed “input_file.yaml”, the only required file is "sample_input_file.yaml" * Updates to TN_DEPLOY and TN_DESTROY * Merged last changes in .global from main branch * Merge last changes in '.global' from branch 'v0.2.2' of https://github.com/6G-SANDBOX/6G-Library into nokia_xrext_uma * Merge last changes in 'tn_init', 'tn_vxlan' and 'tn_bastion' from branch 'v0.2.2' of https://github.com/6G-SANDBOX/6G-Library into nokia_xrext_uma * Debugging config files * Debugging config files * Remove references to site_jenkins_* variables * Variable tn_ssh_public_key renamed succesfully in the rest of the components * Debugging config files * Add Nokia XRext Component * Initial release of the 6G Library XRext component * Removed “input_file.yaml”, the only required file is "sample_input_file.yaml" * Updates to TN_DEPLOY and TN_DESTROY from v0.2.2 * Merged last changes in .global from main branch * Merge last changes in '.global' from branch 'v0.2.2' of https://github.com/6G-SANDBOX/6G-Library into nokia_xrext_uma * Debugging config files * Debugging config files * Remove references to site_jenkins_* variables * Variable tn_ssh_public_key renamed succesfully in the rest of the components * Debugging config files * Remove references to site_jenkins_* variables --------- Co-authored-by: joaquin <[email protected]> Co-authored-by: Álvaro Curto Merino <[email protected]> * Campaign manager client (#26) * Initial untested draft * Update README.md Better layout * Update README.md * Naming cleaned up * Reworked to use ansible modules instead of shell commands * Getting image from site packages reference as recommended. Will need site access before i can actually create the image --------- Co-authored-by: Torsten Iversen <[email protected]> Co-authored-by: TorstenIversen <[email protected]> * Fokus open5gcore (#27) * Initial WIP import of the Open5Gcore component * add ip and vm id to output remove ref to oneKE --------- Co-authored-by: Bjoern Riemer <[email protected]> * Opensand (#28) * Initial Commit of OpenSAND component * Initial Commit of OpenSAND Component --------- Co-authored-by: theonidou <[email protected]> Co-authored-by: confragkos <[email protected]> * Upf p4 sw (#29) * Added UPF-P4 SW component. WIP * Added UPF-P4 config files * Modified public.yaml file * Changed name file to fix bug * Fixed name issue * Fixed bug in upf_p4_install.yaml * Changed mongodb-clients packet for mongosh packet for compatibility * Fixed and Testing indentation * Testing * More testing... * Changed struct upf_p4_install.yaml * Used include_task instead of include * Fixed become permissions * Add become permission to install apk packets * Removed mongosh installation * Testing to ensure variable availability * Testing variables availability * More Testing * More Testing * More Testing... * Delegate facts true * Testing to send vars between stages with different hosts * Testing to fix synchronize issue * Changed module synchronize for copy * Testing.. * Testing 2.. * Testing persist variables between different hosts * Using hostvars and Testing * Changed permissions when config folder is copied * Fixed bug in copy module * Fixed copy config folder * Working on the outputs and the execution results * Fixed bug in outputs name --------- Co-authored-by: rafagarciaUMA <[email protected]> * Open5gs vm (#30) * Initial WIP import of the Open5Gcore component * add ip and vm id to output remove ref to oneKE * VM version of Open5GS; WIP * update component name for open5gs vm * fix variable names for componnets * fix variable name --------- Co-authored-by: Bjoern Riemer <[email protected]> * Ntn backhaul (#31) * Add NTN backhaul component * Add ericsson_radio files (#32) Adding the initialization files for enabling Athens site's ericsson radio Co-authored-by: George P. <[email protected]> * V0.2.2 (#33) * tn_init bastion can modify its networks again * Reunify IaC between tn_init and tn_bastion and tn_vxlan * V0.2.2 (#34) * tn_init bastion can modify its networks again * Reunify IaC between tn_init and tn_bastion and tn_vxlan * Trailing * Changelog * ocf quickfix * Fix private variable ocf (#35) * tn_init bastion can modify its networks again * Reunify IaC between tn_init and tn_bastion and tn_vxlan * Minor fix and readme completion --------- Co-authored-by: Jorge Moratinos Salcines <[email protected]> * tnuser login fix * fix component name in readme * Change sample_input_file in ocf to avoid confusion * ocf component tnlcm descriptor uploaded (#36) * Trying to fix VM instantiation * Add ELCM component (#37) * First version ELCM component * Minor change * Quickfix * Minor change * Uncomment private variables * Add elcm component to changelog * Remove broken component * Wait for OneKE VMs * Remove v0.2.2 references --------- Co-authored-by: Jesus Macias Portela <[email protected]> Co-authored-by: joaquin <[email protected]> Co-authored-by: Torsten Iversen <[email protected]> Co-authored-by: TorstenIversen <[email protected]> Co-authored-by: Bjoern Riemer <[email protected]> Co-authored-by: theonidou <[email protected]> Co-authored-by: confragkos <[email protected]> Co-authored-by: rafagarciaUMA <[email protected]> Co-authored-by: George P. <[email protected]> Co-authored-by: Jorge Moratinos Salcines <[email protected]> Co-authored-by: Jorge Moratinos <[email protected]> Co-authored-by: Carlos Andreo <[email protected]>
- Loading branch information
1 parent
340a885
commit dae8219
Showing
52 changed files
with
1,072 additions
and
63 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,65 @@ | ||
###################################################### | ||
## | ||
## Component public variables | ||
## | ||
## Variables accesible to the experimenter. | ||
## | ||
## They are contained inside 3 global variables | ||
## with all required info: | ||
## | ||
## 1. metadata: General information like mantainers, | ||
## component dependencies and allowed platforms | ||
## | ||
## 2. input: Customizable variables for each | ||
## deployment to be filled by the experimenter | ||
## or the TNLCM | ||
## | ||
## 3. output: Values sent to the TNLCM callback to | ||
## keep track of the TN deployments | ||
## | ||
###################################################### | ||
|
||
|
||
#################################### | ||
## Component metadata | ||
#################################### | ||
metadata: | ||
maintainers: | ||
- Carlos Andreo López <[email protected]> | ||
short_description: Deploys a virtual machine with the ELCM backend and frontend. | ||
long_description: | | ||
Ubuntu 22.04 LTS virtual machine with the ELCM installed. | ||
It also contains OpenTAP, InfluxDB and Grafana services installed. | ||
hypervisors: [one] | ||
|
||
#################################### | ||
## Component input | ||
#################################### | ||
input: | ||
one_elcm_influxdb_user: | ||
description: Username used to login into the InfluxDB | ||
type: str | ||
default_value: "admin" | ||
required_when: false | ||
one_elcm_influxdb_password: | ||
description: Password used to login into the InfluxDB | ||
type: str | ||
default_value: "admin" | ||
required_when: false | ||
one_elcm_influxdb_database: | ||
description: Database name | ||
type: str | ||
default_value: "elcmdb" | ||
required_when: false | ||
one_elcm_grafana_password: | ||
description: Password used to login into the Grafana | ||
type: str | ||
default_value: "admin" | ||
required_when: false | ||
|
||
#################################### | ||
## Component output | ||
#################################### | ||
output: | ||
ips: "Dictionary of VM addresses: key='VNet ID in OpenNebula', value='the IP address'" | ||
id: VM ID in OpenNebula |
This file contains 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,7 @@ | ||
# ELCM | ||
|
||
More info in the official documentation: | ||
|
||
- Backend: https://github.com/6G-SANDBOX/ELCM | ||
|
||
- Frontend: https://github.com/6G-SANDBOX/portal |
This file contains 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,33 @@ | ||
# Changelog | ||
|
||
## [v3.6.3] | ||
### Fixed | ||
|
||
- Add first implementation ELCM component to 6G-Library. | ||
|
||
<!-- FIELDS PER VERSION --> | ||
<!-- | ||
### Added | ||
- New features | ||
### Changed | ||
- Changes in existing functionality | ||
### Deprecated | ||
- Soon-to-be removed features | ||
### Removed | ||
- Removed features | ||
### Fixed | ||
- Bug fixes | ||
### Security | ||
- Vulnerability warnings | ||
--> |
This file contains 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,100 @@ | ||
--- | ||
- name: "STAGE 1: Apply IaC to deploy the component" | ||
hosts: localhost | ||
gather_facts: false | ||
connection: local | ||
tasks: | ||
- name: Load enviromental variables from different sources | ||
ansible.builtin.include_tasks: "{{ workspace }}/.global/cac/load_variables.yaml" | ||
|
||
- name: Prepare terraform working directory | ||
ansible.builtin.include_tasks: "{{ workspace }}/.global/cac/terraform_workdir.yaml" | ||
|
||
- name: Overwrite defaults with correct values | ||
ansible.builtin.include_tasks: "{{ workspace }}/{{ component_type }}/code/{{ site_hypervisor }}/cac/01_pre/vm_resources.yaml" | ||
|
||
- name: Terraform apply | ||
ansible.builtin.include_tasks: "{{ workspace }}/.global/cac/terraform_apply.yaml" | ||
|
||
|
||
- name: "STAGE 2: Prepare to access the component" | ||
hosts: localhost | ||
gather_facts: false | ||
connection: local | ||
tasks: | ||
- name: Retrieve terraform outputs | ||
ansible.builtin.shell: | ||
args: | ||
chdir: "{{ workspace }}/.terraform/" | ||
cmd: "set -o pipefail && terraform output --json | jq 'with_entries(.value |= .value)'" | ||
executable: /bin/bash | ||
register: terraform_outputs | ||
changed_when: false | ||
|
||
- name: Set Terraform outputs as playbook facts | ||
ansible.builtin.set_fact: | ||
bastion_ip: "{{ (terraform_outputs.stdout | from_json)['tn_bastion-ips'][site_networks_id.default | string] }}" | ||
tn_ssh_public_key: "{{ (terraform_outputs.stdout | from_json)['tn_ssh_public_key'] }}" | ||
ips: "{{ (terraform_outputs.stdout | from_json)[entity_name + '-ips'] }}" | ||
id: "{{ (terraform_outputs.stdout | from_json)[entity_name + '-id'] }}" | ||
vnet_id: "{{ (terraform_outputs.stdout | from_json)[one_elcm_networks[0] + '-id'] | string }}" | ||
|
||
- name: Add new VM to Ansible Inventory | ||
ansible.builtin.add_host: | ||
hostname: "elcm" | ||
ansible_host: "{{ ips[vnet_id] }}" | ||
ansible_ssh_common_args: "-J jenkins@{{ bastion_ip }}" | ||
ansible_user: "jenkins" | ||
|
||
- name: Create SSH config file in the Jenkins-master for debugging purposes | ||
ansible.builtin.include_tasks: "{{ workspace }}/{{ component_type }}/code/{{ site_hypervisor }}/cac/01_pre/ssh_config.yaml" | ||
|
||
|
||
- name: "STAGE 3: Apply CaC to prepare the component" | ||
hosts: "elcm" | ||
gather_facts: false | ||
tasks: | ||
- name: Wait for system to become reachable | ||
ansible.builtin.wait_for_connection: | ||
connect_timeout: 5 | ||
timeout: 200 | ||
|
||
- name: Set site ssh key as authorized in jenkins user | ||
ansible.posix.authorized_key: | ||
user: jenkins | ||
state: present | ||
key: "{{ item }}" | ||
loop: | ||
- "{{ hostvars['localhost'].get('site_admin_ssh_public_key', '') }}" | ||
when: item != '' | ||
|
||
- name: Create new user for experimenter access | ||
become: true | ||
ansible.builtin.user: | ||
name: tnuser | ||
shell: /bin/bash | ||
groups: sudo | ||
password: '' | ||
- name: Set TN ssh key as authorized in new user | ||
become: true | ||
ansible.posix.authorized_key: | ||
user: tnuser | ||
state: present | ||
key: "{{ item }}" | ||
loop: | ||
- "{{ hostvars['localhost']['tn_ssh_public_key'] }}" | ||
|
||
|
||
- name: "STAGE 4: Publish execution results" | ||
hosts: localhost | ||
gather_facts: false | ||
connection: local | ||
tasks: | ||
- name: Merge all component component outputs into one "output" variable | ||
ansible.builtin.set_fact: | ||
output: | ||
ips: "{{ ips | b64encode }}" | ||
id: "{{ id | b64encode }}" | ||
|
||
- name: Publish execution results to TNLCM | ||
ansible.builtin.include_tasks: "{{ workspace }}/.global/cac/publish_ok_results.yaml" |
This file contains 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,9 @@ | ||
--- | ||
- name: Append new commponent's name and IP into a .ssh/config.d/ file | ||
community.general.ssh_config: | ||
host: "{{ tn_id }}-{{ entity_name }}" | ||
hostname: "{{ ips[vnet_id] | default('ERROR_ASSIGNING_IP') }}" | ||
proxyjump: "{{ tn_id }}-tn_bastion" | ||
remote_user: "jenkins" | ||
ssh_config_file: "/var/lib/jenkins/.ssh/config.d/{{ tn_id }}" | ||
state: present |
This file contains 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,10 @@ | ||
--- | ||
- name: "Set VM Resources needed for component" | ||
ansible.builtin.set_fact: | ||
one_elcm_cpu: "{{ one_elcm_cpu }}" | ||
one_elcm_memory: "{{ one_elcm_memory }}" | ||
one_elcm_disk: "{{ one_elcm_disk }}" | ||
|
||
- name: Overwrite again with explicit values from the input file | ||
ansible.builtin.include_vars: | ||
file: "{{ workspace }}/{{ component_type }}/variables/input_file.yaml" |
This file contains 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,46 @@ | ||
# https://registry.terraform.io/providers/OpenNebula/opennebula/latest/docs/resources/virtual_machine | ||
# https://docs.opennebula.io/6.8/management_and_operations/references/template.html#context-section | ||
resource "opennebula_virtual_machine" "{{ entity_name }}" { | ||
name = "{{ tn_id }}-{{ entity_name }}" | ||
template_id = {{ site_available_components.elcm.template_id }} | ||
cpu = {{ one_elcm_cpu }} | ||
vcpu = {{ one_elcm_cpu }} | ||
memory = {{ one_elcm_memory }} | ||
|
||
context = { | ||
NETWORK = "YES" | ||
SET_HOSTNAME = "$NAME" | ||
USERNAME = "jenkins" | ||
ONEAPP_ELCM_INFLUXDB_USER = "{{ one_elcm_influxdb_user }}" | ||
ONEAPP_ELCM_INFLUXDB_PASSWORD = "{{ one_elcm_influxdb_password }}" | ||
ONEAPP_ELCM_INFLUXDB_DATABASE = "{{ one_elcm_influxdb_database }}" | ||
ONEAPP_ELCM_GRAFANA_PASSWORD = "{{ one_elcm_grafana_password }}" | ||
} | ||
|
||
{# ### Disabled the possibility to modify VM's size due to a Terraform OpenNebula Provider's error | ||
disk { | ||
image_id = {{ site_available_components.elcm.image_id }} | ||
size = {{ one_elcm_disk }} | ||
target = "vda" | ||
driver = "qcow2" | ||
} #} | ||
|
||
{% for network in one_elcm_networks %} | ||
nic { | ||
model = "virtio" | ||
network_id = opennebula_virtual_network.{{ network }}.id | ||
} | ||
{% endfor %} | ||
|
||
depends_on = [ opennebula_virtual_network_address_range.tn_vxlan ] | ||
} | ||
|
||
output "{{ entity_name }}-id" { | ||
description = "OpenNebula VM ID" | ||
value = opennebula_virtual_machine.{{ entity_name }}.id | ||
} | ||
|
||
output "{{ entity_name }}-ips" { | ||
description = "OpenNebula VM Network Assignments" | ||
value = { for nic in opennebula_virtual_machine.{{ entity_name }}.nic[*] : nic.network_id => nic.computed_ip } | ||
} |
This file contains 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,5 @@ | ||
There was an error. Detailed info: | ||
|
||
``` | ||
{{ terraform_apply.stderr }} | ||
``` |
This file contains 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,3 @@ | ||
# {{ tn_id }}-{{ entity_name }} | ||
|
||
The component `{{ tn_id }}-{{ entity_name }}` has been succesfully created. |
This file contains 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,12 @@ | ||
# THIS IS AN INPUT FILE EXAMPLE. Values may not be valid for your enviroment | ||
|
||
#one_elcm_cpu: 2 | ||
#one_elcm_memory: 2048 | ||
#one_elcm_disk: 3072 | ||
#one_elcm_networks: | ||
# - tn_vxlan | ||
|
||
# one_elcm_influxdb_user: "admin" | ||
# one_elcm_influxdb_password: "admin" | ||
# one_elcm_influxdb_database: "elcmdb" | ||
# one_elcm_grafana_password: "admin" |
Oops, something went wrong.