Skip to content

Commit

Permalink
Merge pull request #31 from Juniper/main
Browse files Browse the repository at this point in the history
Rebasing 22.8
  • Loading branch information
aburston authored Sep 28, 2022
2 parents e189046 + 536e284 commit 36b0849
Show file tree
Hide file tree
Showing 45 changed files with 40 additions and 1,038 deletions.
17 changes: 0 additions & 17 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,6 @@ For the building purpose of a **Package** or **Docker Image** it is recommended
git clone <repo_url>
```

# Package Build

## Debian/Ubuntu Package

To generate a .deb package file for the instalation of the NITA webapp on a Debian based system you can run the *build-nita-webapp-21.7-1.sh* script file found under the *packaging* folder:
```bash
cd packaging
./build-nita-webapp-21.7-1.sh
```

## Centos/RedHat Package
To generate a .rpm package file for the instalation of the NITA webapp on a Centos based system you can run the *build-webapp-21.7-1.sh* script file found under the *packaging_redhat* folder:
```bash
cd packaging_redhat
./build-webapp-21.7-1.sh
```

# Docker Image Build
To build the webapp docker image you can simply run the *build_container.sh* also found on the root folder of this repo:
```bash
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ RUN apt-get install gcc default-mysql-client default-libmysqlclient-dev wget unz

#COPY nita-yaml-to-excel/ yaml-to-excel/

RUN wget --no-check-certificate https://github.com/Juniper/nita-yaml-to-excel/archive/refs/heads/21.7.zip
RUN unzip 21.7.zip
RUN wget --no-check-certificate https://github.com/Juniper/nita-yaml-to-excel/archive/refs/heads/22.8.zip
RUN unzip 22.8.zip
COPY requirements.txt .
RUN pip install -r requirements.txt

Expand Down
67 changes: 14 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# NITA Web Application 21.7
# NITA Web Application 22.8

Welcome to NITA 21.7.
Welcome to NITA 22.8.

Packages built from this branch will be nita-*-21.7-x where x is the packaging release.
Packages built from this branch will be nita-*-22.8-x where x is the packaging release.
This branch also contains patches from other branches or minor modifications as required to support the stability and usability of the release.
There are also some backwards compatibility packages here for ansible and robot that allow projects written for NITA 3.0.7 to work without having to make any changes.

Note that NITA 21.7 backward compatible with NITA 20.10 projects, provided the correct ansible and robot containers are installed.
Note that NITA 22.8 backward compatible with NITA 20.10 projects, provided the correct ansible and robot containers are installed.

# Copyright

Expand All @@ -33,23 +33,10 @@ It allows NITA projects to declare exactly which version of NITA they are compat
Projects must explicitly use the versions of the containers provided by this package in order to avoid docker attempting to download from the registry.
No containers tagged as "latest" are provided by the package.

## Current Version
## 22.8 New Features and Bug Fixes

The release has been broken up into multiple packages, see the list bellow:

* Ubuntu 18.04
* nita-jenkins-21.7-1
* nita-webapp-21.7-1
* nita-ansible-2.9.18-21.7-1
* nita-robot-4.1-21.7-1
* yaml-to-excel-21.7.0-1

* Centos 7
* nita-jenkins-21.7-1
* nita-webapp-21.7-1
* nita-ansible-2.9.18-21.7-1
* nita-robot-4.1-21.7-1
* yaml-to-excel-21.7.0-1
* Loads of security advisories, please use this version to avoid security problems in 21.7.
* Upgraded Jenkins

## 21.7 New Features and Bug Fixes

Expand Down Expand Up @@ -137,7 +124,7 @@ Once you have docker-ce and docker-compose installed do the following steps as *
```bash
git clone https://github.com/Juniper/nita-webapp
cd nita-webapp
git checkout 21.7
git checkout 22.8
mkdir nginx/certificates
openssl req -batch -x509 -nodes -days 365 -newkey rsa:2048 -keyout nginx/certificates/nginx-certificate-key.key -out nginx/certificates/nginx-certificate.crt
docker network create nita-network
Expand All @@ -150,7 +137,7 @@ In order for NITA to work you also need to run jenkins:
apt-get install -y openjdk-11-jre-headless
git clone https://github.com/Juniper/nita-jenkins
cd nita-jenkins
git checkout 21.7
git checkout 22.8
mkdir certificates
keytool -genkey -keyalg RSA -alias selfsigned -keystore certificates/jenkins_keystore.jks -keypass nita123 -storepass nita123 -keysize 4096 -dname "cn=, ou=, o=, l=, st=, c="
docker compose up -d
Expand All @@ -169,12 +156,12 @@ cd nita-jenkins
cd ..
git clone https://github.com/Juniper/nita-ansible
cd nita-ansible
git checkout 21.7
git checkout 22.8
( cd cli_scripts && install -m 0755 * /usr/local/bin )
cd ..
git clone https://github.com/Juniper/nita-robot
cd nita-robot
git checkout 21.7
git checkout 22.8
( cd cli_scripts && install -m 0755 * /usr/local/bin )
cd ..
exec bash
Expand All @@ -199,33 +186,7 @@ chgrp 1000 /var/nita_project

Note: Verify that the group section of the permissions is writable as well. In some instances the linux permissions 755 are seen after this step and need to modified by ```sudo chmod 775 /var/nita_project```

### Ubuntu packages
If you have been provided with or built the .deb package files, then follow the instructions provided in the [Dependencies](##Dependencies) section above and then run the following command:

```bash
sudo apt-get install <path-to-deb-file>
```

Example:
```bash
sudo apt-get install ./nita-jenkins-21.7-1.deb ./nita-webapp-21.7-1.deb ./yaml-to-excel-21.7.0-1.deb
```

### Centos packages
If you have been provided with or built the .rpm package files, then follow the instructions provided in the [Dependencies](##Dependencies) section above and then run the following command:

```bash
sudo yum install <patch-to-rpm-file>
```

Example:
```bash
sudo yum install ./nita-jenkins-21.7-1.noarch.rpm ./nita-webapp-21.7-1.noarch.rpm ./yaml-to-excel-21.7.0-1.noarch.rpm
```

NOTE: make sure you disable SELinux during the instalation process. Refer to [`Known Bugs and irritations`](#Known-Bugs-and-irritations) for more details.

##
## Vagrant

For users of vagrant, here is a handy "Vagrantfile" that will get you a working ubuntu 18.04 box quickly and forward the relevant ports:

Expand Down Expand Up @@ -363,12 +324,12 @@ ExecStart=/usr/bin/dockerd -H tcp://192.168.49.2 -H fd:// --containerd=/run/cont
The examples included with nita-webapp assume a local installation of Jenkins. The shell commands configured in the ``project.yaml`` file and loaded as Jenkins jobs to build the network environments are written for local installation. In order for the Jenkins to execute the jobs properly, the shell commands will need to be modified for remote execution. For example, in the DC build example, the file https://github.com/wildsubnet/nita-webapp/blob/main/examples/evpn_vxlan_erb_dc/project.yaml contains the following line:
```
configuration:
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.3-1 /bin/bash -c "cd ${WORKSPACE}; bash build.sh ${build_dir}"'
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash build.sh ${build_dir}"'
```
This would be modified for remote execution via TCP (as configured in the previous section) by adding ``-H tcp://docker-IP`` to the ``docker run`` command:
```
configuration:
shell_command: 'write_yaml_files.py; docker run -H tcp://docker-IP -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.3-1 /bin/bash -c "cd ${WORKSPACE}; bash build.sh ${build_dir}"'
shell_command: 'write_yaml_files.py; docker run -H tcp://docker-IP -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash build.sh ${build_dir}"'
```
### nita-jenkins on a separate docker network

Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
21.7
22.8
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,8 @@ def deleteCampusTypeView(request):

action_url = 'network_type_validator';
current_build_number = server.get_job_info(action_url)['nextBuildNumber']
Jenkins(JENKINS_SERVER_URL, username=JENKINS_SERVER_USER, password=JENKINS_SERVER_PASS).get_job(action_url).invoke(build_params={'file_name': campusType.app_zip_name,
crumb=CrumbRequester(baseurl=JENKINS_SERVER_URL, username=JENKINS_SERVER_USER, password=JENKINS_SERVER_PASS)
Jenkins(JENKINS_SERVER_URL, username=JENKINS_SERVER_USER, password=JENKINS_SERVER_PASS, requester=crumb).get_job(action_url).invoke(build_params={'file_name': campusType.app_zip_name,
'operation':'delete',
'project_workspace_path': ServerProperties.getWorkspaceLocation()},
)
Expand Down
2 changes: 1 addition & 1 deletion build_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

set -e

docker build -t juniper/nita-webapp:22.7-1 .
docker build -t juniper/nita-webapp:22.8-1 .
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
version: "2.0"
services:
webapp:
image: juniper/nita-webapp:22.7-1
image: juniper/nita-webapp:22.8-1
command: ./build-and-test-webapp/wait-for-db.sh
networks:
- nita-network
Expand All @@ -38,7 +38,7 @@ services:
# extra_hosts:
# - "jenkins:192.168.X.y"
db:
image: mariadb:latest
image: mariadb:10.4.12
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_DATABASE: Sites
Expand Down
14 changes: 7 additions & 7 deletions examples/ebgp_wan/project.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
description: Simple IPCLOS based WAN setup to link two data centers
name: ebgp_wan_0.2
name: ebgp_wan_0.3

action:
- name: Build
jenkins_url: build_vmx_wan
#must be one of NOOB, BUILD or TEST
category: BUILD
configuration:
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash build.sh ${build_dir}"'
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash build.sh ${build_dir}"'

- name: Dump configuration
jenkins_url: dump_vmx_wan
#must be one of NOOB, BUILD or TEST
category: BUILD
configuration:
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash dump.sh ${build_dir}"'
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash dump.sh ${build_dir}"'

- name: Test
jenkins_url: test_vmx_wan
#must be one of NOOB, BUILD or TEST
category: TEST
configuration:
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash test_setup.sh ${build_dir}"
write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name robot -e ROBOT_OPTIONS="-d ${PWD}/test/outputs" juniper/nita-robot:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash test.sh"'
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash test_setup.sh ${build_dir}"
write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name robot -e ROBOT_OPTIONS="-d ${PWD}/test/outputs" juniper/nita-robot:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash test.sh"'
output_path: test/outputs/

- name: Netbox Population
jenkins_url: netbox_population
#must be one of NOOB, BUILD or TEST
category: BUILD
configuration:
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash netbox.sh ${build_dir}"'
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash netbox.sh ${build_dir}"'

- name: HealthBot Population
jenkins_url: healthbot_population
#must be one of NOOB, BUILD or TEST
category: BUILD
configuration:
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash healthbot.sh ${build_dir}"'
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash healthbot.sh ${build_dir}"'
18 changes: 9 additions & 9 deletions examples/evpn_vxlan_erb_dc/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,55 +12,55 @@
#
# ********************************************************
description: EVPN VLXAN ERB Data Center
name: evpn_vxlan_erb_dc_1.2
name: evpn_vxlan_erb_dc_1.3
action:
- name: Build
jenkins_url: build_qfx_fabric
#must be one of NOOB, BUILD or TEST
category: BUILD
configuration:
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash build.sh ${build_dir}"'
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash build.sh ${build_dir}"'

- name: Build server interfaces
jenkins_url: build_server_interfaces
#must be one of NOOB, BUILD or TEST
category: BUILD
configuration:
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash configure_bms.sh ${build_dir}"'
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash configure_bms.sh ${build_dir}"'

- name: Build base config
jenkins_url: base_qfx_fabric
#must be one of NOOB, BUILD or TEST
category: BUILD
configuration:
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash base.sh ${build_dir}"'
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash base.sh ${build_dir}"'

- name: Dump configuration
jenkins_url: dump_qfx_fabric
#must be one of NOOB, BUILD or TEST
category: BUILD
configuration:
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash dump.sh ${build_dir}"'
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash dump.sh ${build_dir}"'

- name: Test
jenkins_url: test_qfx_fabric
#must be one of NOOB, BUILD or TEST
category: TEST
configuration:
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash test_setup.sh ${build_dir}"
write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name robot -e ROBOT_OPTIONS="-d ${PWD}/test/outputs" juniper/nita-robot:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash test.sh"'
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash test_setup.sh ${build_dir}"
write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name robot -e ROBOT_OPTIONS="-d ${PWD}/test/outputs" juniper/nita-robot:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash test.sh"'
output_path: test/outputs/

- name: Netbox Population
jenkins_url: netbox_population
#must be one of NOOB, BUILD or TEST
category: BUILD
configuration:
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash netbox.sh ${build_dir}"'
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash netbox.sh ${build_dir}"'

- name: HealthBot Population
jenkins_url: healthbot_population
#must be one of NOOB, BUILD or TEST
category: BUILD
configuration:
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash healthbot.sh ${build_dir}"'
shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash healthbot.sh ${build_dir}"'
3 changes: 0 additions & 3 deletions nita-cmd/packaging/.gitignore

This file was deleted.

37 changes: 0 additions & 37 deletions nita-cmd/packaging/build-nita-cmd-21.7-1.sh

This file was deleted.

11 changes: 0 additions & 11 deletions nita-cmd/packaging/nita-cmd-21.7-1/DEBIAN/control

This file was deleted.

3 changes: 0 additions & 3 deletions nita-cmd/packaging_redhat/.rpmmacros

This file was deleted.

Loading

0 comments on commit 36b0849

Please sign in to comment.