Skip to content
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

Release.1.2 #164

Merged
merged 226 commits into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
226 commits
Select commit Hold shift + click to select a range
fa052dd
Check if we can run the script gen-dhcpd.py which reads a YAML file a…
krihal Sep 7, 2020
5772bbb
Merge pull request #132 from SUNET/release.1.1
indy-independence Sep 7, 2020
be7d928
Merge pull request #134 from SUNET/feature.dhcpd-config-templates
denniswa Sep 7, 2020
9e03914
Make get_settings read settings from device model specific defaults i…
indy-independence Sep 8, 2020
0996b2c
Perform syntax checks for model specific default interface config files
indy-independence Sep 8, 2020
f5347cf
Add docs for interface settings files
indy-independence Sep 8, 2020
c4467da
Clarify docs for interfaces
indy-independence Sep 8, 2020
2438453
Merge branch 'develop' into feature.dist_default_ifconf
indy-independence Sep 9, 2020
3330406
Break out API argument parsing for device_init to separate method. Ad…
indy-independence Sep 9, 2020
a689c1b
Make create linknet work for both ACCESS and CORE/DIST devices. Make …
indy-independence Sep 9, 2020
f0a37e7
Remove unused ifclass uplink, and add new ifclass 'fabric' for links …
indy-independence Sep 9, 2020
ec7adb0
Make update_linknets verify that correct ifclasses are configured for…
indy-independence Sep 9, 2020
d556bac
Add neighbor argument to device_initcheck API call. Make initcheck ve…
indy-independence Sep 10, 2020
ac558ce
Don't try check_neighbors if linknet update failed
indy-independence Sep 15, 2020
fc6f6f9
Add simple unit test for API device_initcheck
indy-independence Sep 15, 2020
6db796c
Add docs for device_initcheck
indy-independence Sep 15, 2020
859501f
Merge pull request #135 from SUNET/feature.dist_default_ifconf
indy-independence Sep 15, 2020
c30471c
Bugfix for access init
indy-independence Sep 15, 2020
0c1bb48
Stop websocket threads after standalone server finishes to avoid havi…
indy-independence Sep 15, 2020
17ebd2c
Move generation of device variables for template rendering from push_…
indy-independence Sep 15, 2020
2547364
Only populate linknet data for interfaces configured as fabric. Popul…
indy-independence Sep 16, 2020
75174c7
Move template secret variable insertion into populate_device_vars
indy-independence Sep 16, 2020
f53d2ef
Make access_init use populate_device_vars()
indy-independence Sep 16, 2020
229b75b
Make sure to return device to managed state even if some test fails
indy-independence Sep 16, 2020
d49c7af
Set device type in init step1 instead of step2, and make step2 work f…
indy-independence Sep 16, 2020
7504425
settings and secret vars are already populated via populate_device_va…
indy-independence Sep 16, 2020
58f045a
Make push_base_management work for all device types
indy-independence Sep 17, 2020
879657c
Bugfix rename init_access_device_step2 -> init_device_step2
indy-independence Sep 17, 2020
5f05484
Make find_free_mgmt_lo_ip check for reserved IP addresses. Needed for…
indy-independence Sep 18, 2020
78df2de
Return list of verified neighbors in device_initcheck API call
indy-independence Sep 18, 2020
bffcf66
Allow nornir inventory_selector and sync_devices to use list of hostn…
indy-independence Sep 18, 2020
c08e9e8
Mark devices as unsynced after adding linknet
indy-independence Sep 18, 2020
c27a112
Add init_fabric_device_step1, which also triggers resync of neighbor …
indy-independence Sep 18, 2020
b52d87f
Update call for update_linknet in unit test
indy-independence Sep 18, 2020
4dde4c8
Allow specifying of CORE and DIST as device_type in device_init API call
indy-independence Sep 18, 2020
7938644
Bugfix device variable generation for DIST/CORE during init
indy-independence Sep 18, 2020
4931ccd
Merge pull request #136 from SUNET/feature.device_initcheck
krihal Sep 22, 2020
92b36e6
If no evpn_peers were specified in settings return a list of all CORE…
indy-independence Sep 22, 2020
c69726f
Merge branch 'develop' into feature.dist_ztp
indy-independence Sep 22, 2020
c0e4a98
Update docs for evpn_peers
indy-independence Sep 22, 2020
2117878
Update docs for ZTP/init and ifclass fabric
indy-independence Sep 22, 2020
737ecea
Send device model to get_settings when using settings API call with h…
indy-independence Sep 23, 2020
7d841db
Make init/update_linknets use target hostname instead of temporary ho…
indy-independence Sep 24, 2020
28aaa07
Pass both current and target hostname from initcheck
indy-independence Sep 24, 2020
26e64a8
Don't verify device type in create linknet on dry_run since it will b…
indy-independence Sep 24, 2020
efcb28e
Send device_type as string instead of DeviceType object since the obj…
indy-independence Sep 24, 2020
265d616
Mark device as state INIT and set devtype before creating linknets an…
indy-independence Sep 24, 2020
b8a43e5
If device init is already in progress, reschedule a new step2 (connec…
indy-independence Sep 24, 2020
71a54f2
Schedule re-check of init step2 right away, no use of waiting here
indy-independence Sep 25, 2020
6b0b2c8
Fix issue where uwsgi/gevent does not work correctly causing websocke…
indy-independence Sep 25, 2020
454107a
Remove redundant git update/fetch
indy-independence Sep 25, 2020
29c07b4
Merge pull request #138 from SUNET/bugfix.websocket_uwsgi_threading
krihal Sep 25, 2020
0f3fad5
Merge branch 'develop' into feature.dist_ztp
indy-independence Sep 25, 2020
fe2b3c8
Try to make jenkins build master branch as well
indy-independence Sep 25, 2020
3addcde
Add a post_flight option where we will udpate facts about devices aft…
krihal Oct 17, 2020
c76dbe3
Added API documentation for the new post_flight option.
krihal Oct 17, 2020
d272270
Some minor documentation fixes.
krihal Oct 18, 2020
b56c82f
Include old OS version in job log.
krihal Oct 19, 2020
e9164f9
Set the default value for post_waittime to 600 (10 minutes).
krihal Oct 20, 2020
c699aef
Make sure we run post_flight after the device have been rebooted.
krihal Oct 20, 2020
1e0b58e
Ignore neighbors that are not MANAGED or UNMANAGED during update_link…
indy-independence Oct 22, 2020
9c9c61a
Previus commit cased some issues for MLAG init. Check device state be…
indy-independence Oct 22, 2020
2372dbf
Ignore mlag peer device type check during INIT when one device might …
indy-independence Oct 22, 2020
a021933
Wait longer before doing step2 init when part of MLAG pair to account…
indy-independence Oct 22, 2020
f154ca8
remove old evpn_spines default setting
indy-independence Oct 23, 2020
56357e2
Merge branch 'develop' into feature.dist_ztp
indy-independence Oct 26, 2020
e80b78e
Add indexnum to access interfaces
indy-independence Oct 26, 2020
7feea05
Fix neighbor ifconfigtype filter so access switches will find access …
indy-independence Oct 26, 2020
fc1d620
Sort interface list from API by indexnum
indy-independence Oct 26, 2020
81ca298
Update docs for groups API to contain the call for getting a single g…
indy-independence Oct 26, 2020
0e76230
Add groups/<string:group_name>/os_version API call to get os versions…
indy-independence Oct 26, 2020
3b60bab
Add API docs for groups/<group_name>/os_version. Add link to settings…
indy-independence Oct 26, 2020
33a3e53
Sort devices in groups/<groupname>/os_version by hostname to make it …
indy-independence Oct 27, 2020
aedd53d
Merge pull request #137 from SUNET/feature.dist_ztp
indy-independence Oct 28, 2020
1cd1be4
Merge pull request #141 from SUNET/bugfix.access_downlink
indy-independence Oct 28, 2020
e577416
Resolve merge conflict in reporef docs
indy-independence Oct 28, 2020
d718547
Add tests for groups API
indy-independence Oct 28, 2020
58ed8f2
Merge pull request #140 from SUNET/feature.groupby_osversion
indy-independence Oct 28, 2020
2c47d1d
Merge branch 'develop' into feature.post_flight_check
indy-independence Oct 28, 2020
256381f
Add X-Total-Count header in response from firmware upgrade POST call
indy-independence Oct 28, 2020
896eaac
Fix X-Total-Count for groups
indy-independence Oct 28, 2020
320f38b
Check if firmware was already activated. Raise exception if OS versio…
indy-independence Oct 28, 2020
4640b86
Bump dev version
indy-independence Oct 28, 2020
4894d8f
Merge branch 'develop' into feature.post_flight_check
indy-independence Oct 28, 2020
41a269a
Make logging print job id on each line so it can be filtered
indy-independence Oct 29, 2020
bab110c
Normalize log messages for webUI log
indy-independence Oct 29, 2020
ea94a83
Log selected upgrade tasks
indy-independence Oct 29, 2020
2059fb3
Fix device_upgrade_task() arg types
indy-independence Oct 29, 2020
6148a05
Check for errors on copy firmware command
indy-independence Oct 29, 2020
3eec27f
Show firmware command on error
indy-independence Oct 30, 2020
91d99fe
Add option to remove scheduled job, will ask apscheduler to remove an…
indy-independence Oct 30, 2020
809a536
Move population of job data like function_name and comment/ticket ref…
indy-independence Oct 30, 2020
f2132c1
Fix function split separator
indy-independence Oct 30, 2020
46f396a
Add scheduled_by value at job schedule time
indy-independence Oct 30, 2020
73b57c5
Bugfix, use total seconds and not just the secord _part_ of the diff …
indy-independence Oct 30, 2020
e247b34
use UTC time for start_at
indy-independence Oct 30, 2020
53dfcaa
Add API call to abort SCHEDULED jobs
indy-independence Oct 30, 2020
d811bc7
Add ABORTING state to jobs which represents a running job that is cur…
indy-independence Nov 2, 2020
1d248f5
Add integration tests for abort running and scheduled jobs
indy-independence Nov 2, 2020
b71b5f3
Check for aborting jobs at every step of firmware upgrade
indy-independence Nov 2, 2020
8394167
Merge pull request #139 from SUNET/feature.post_flight_check
indy-independence Nov 2, 2020
e1f406c
Merge branch 'develop' into feature.abort_job
indy-independence Nov 2, 2020
8916f26
bump version to dev2 since we have new alembic revision
indy-independence Nov 2, 2020
ed3bf5a
Add comment and ticket_ref to firmware upgrade POST call
indy-independence Nov 6, 2020
0ef20b2
Fix kwargs in add_onetime_job
indy-independence Nov 6, 2020
f184323
Merge pull request #142 from SUNET/feature.abort_job
indy-independence Nov 9, 2020
77429ce
Add dns_servers setting
indy-independence Nov 9, 2020
c1330e8
Merge pull request #143 from SUNET/feature.dns_servers_setting
indy-independence Nov 9, 2020
2404b19
If os_version changed then reset config hash and mark unsynchronized.…
indy-independence Nov 10, 2020
701ca26
More verbose error output if nornir subtask fails on download. Show t…
indy-independence Nov 10, 2020
011d702
Force netmiko to not use fast_cli since it causes issues with firmwar…
indy-independence Nov 12, 2020
1d80623
Try to catch already active firmware exception from subtask
indy-independence Nov 12, 2020
b71737a
Fix logging levels for firmware activate
indy-independence Nov 12, 2020
6a1921b
Stop integration test script on all errors
lunkwill42 Nov 16, 2020
4746ee7
Stop failing when coverage dir already exists
lunkwill42 Nov 16, 2020
f8564a5
Use correct Postgres password argument
lunkwill42 Nov 16, 2020
df2d72d
Make supervisorctl usable in api container
lunkwill42 Nov 16, 2020
3a34fc3
Fix broken file permissions in API container
lunkwill42 Nov 16, 2020
5c22196
Update .gitignore
katsel Nov 16, 2020
38d54b1
integrationtests.sh: Create volumes, add JWT certificate
katsel Nov 16, 2020
05c96b7
Update file permissions on container
katsel Nov 17, 2020
5926737
API Dockerfile: Remove some redundancy, code formatting
katsel Nov 17, 2020
0e2dd63
Merge pull request #144 from Uninett/bugfix/startup-issues
indy-independence Nov 18, 2020
4dc7898
Merge branch 'develop' into bugfix.post_upgrade_confhash
indy-independence Nov 18, 2020
140e786
Remove nornir print_result to avoid possible ioblocking errors
indy-independence Nov 20, 2020
487789c
Merge pull request #145 from SUNET/bugfix.post_upgrade_confhash
indy-independence Nov 24, 2020
780a97f
Add some settings for external routing to firewall clusters etc
indy-independence Nov 27, 2020
734f08d
Bugfix for local changes that does not show up in diff output
indy-independence Nov 27, 2020
cee46b1
graceful_restart, next_hop_self, update_source, maximum_routes for bg…
indy-independence Nov 30, 2020
abedf6b
Default to empty list instead of none for bgp neighbors
indy-independence Nov 30, 2020
14b85d6
Bugfix permission for inital sql import to postgres
indy-independence Nov 30, 2020
5aa0295
Docs for bgp neighbors
indy-independence Nov 30, 2020
b8d1bf7
Update to nornir 3 in pip requirements
indy-independence Dec 1, 2020
3de9206
Update inventory plugin to work with nornir 3
indy-independence Dec 1, 2020
740818c
Update nornir imports to use nornir3 syntax with plugins for napalm etc
indy-independence Dec 2, 2020
76703be
Add host groups as Group() objects instead of strings
indy-independence Dec 2, 2020
2dd8894
Fix KeyError exception if when is not specified to scheduler
indy-independence Dec 2, 2020
36f2aef
Try using ParenGroups in nornir plugin
indy-independence Dec 2, 2020
5c73535
Make sure host adds the exact same group object that has been created…
indy-independence Dec 3, 2020
55055b6
Revert unintentional commit on dockerfile
indy-independence Dec 3, 2020
96a241e
Specify netmiko fast_cli=False just for the download task
indy-independence Dec 4, 2020
4f00b9b
Explain fast_cli, remove global fast_cli
indy-independence Dec 4, 2020
0736487
bump version number for nornir3 stuff
indy-independence Dec 8, 2020
1ceb979
Update to nornir_jinja2 0.1.1 and use lstrip_blocks and keep_trailing…
indy-independence Dec 11, 2020
db70102
Merge pull request #148 from SUNET/feature.nornir_3
indy-independence Dec 14, 2020
e7b8fff
Merge branch 'develop' into feature.extroute_firewall
indy-independence Dec 14, 2020
8adb12a
Docs for ebgp_multihop
indy-independence Dec 14, 2020
3ee77d1
ci.sunet.se changed to use default branch on github for jenkinsfile? …
indy-independence Dec 14, 2020
2232574
Update requirements.txt, hilights: napalm: 3.1.0 -> 3.2.0, Flask-Sock…
indy-independence Dec 14, 2020
934118c
Use enforce_verification=True but still set up unverified context, so…
indy-independence Dec 21, 2020
8eeac94
New nornir task: arista_copy_cert which copies ssl .crt and .key file…
indy-independence Dec 21, 2020
8345914
Add function that generates a key+certificate for a device and signin…
indy-independence Dec 21, 2020
15ab239
API call to renew/install certificate on specified hostname or group
indy-independence Dec 22, 2020
f3516da
Add docs for device_cert renew and config options for certs
indy-independence Dec 22, 2020
6aa2af9
Start work on device cert install during ztp
indy-independence Dec 22, 2020
d18b0d6
Change verify_tls_device to separate config option. Update docker con…
indy-independence Dec 23, 2020
e923ba5
Fix connection options for insecure device states
indy-independence Dec 23, 2020
31124c2
Try different way of handling exception/fail from ztp_device_cert
indy-independence Dec 23, 2020
617c47a
Test workaround for 'no route to host', this helped when testing on c…
indy-independence Dec 23, 2020
aa7d524
Make init_device add timeout option to current connection options ins…
indy-independence Dec 23, 2020
597b410
Try moving ztp_device_cert to subtask within push_base_management
indy-independence Dec 23, 2020
b92372a
Bugfix hostname var
indy-independence Dec 23, 2020
cf75cdf
Fix some unit tests for cert
indy-independence Jan 4, 2021
7f5b704
export credentials in nosetest script as well
indy-independence Jan 4, 2021
a589ac3
Use separate docker volume for cacert
indy-independence Jan 12, 2021
e1ddfb7
Make sure ipv4 address has right type when sending to generate_device…
indy-independence Jan 12, 2021
e48e1f1
Remove device cert at factory_default
indy-independence Jan 13, 2021
3860c39
Merge pull request #149 from SUNET/feature.napalm_ssl_verify
indy-independence Jan 13, 2021
c2576a8
Allow duplicate discovery job for same mac, but not for same ip
indy-independence Jan 13, 2021
4d5e0e1
Fix iteration counter for discovery jobs
indy-independence Jan 13, 2021
bbe0085
Merge pull request #151 from SUNET/bugfix.discover_device_iteration
indy-independence Jan 13, 2021
1383095
Allow specifying of internal_vlans in settings
indy-independence Jan 13, 2021
82f24e3
Merge pull request #152 from SUNET/feature.internal_vlan_settings
denniswa Jan 13, 2021
96e966e
Merge pull request #146 from SUNET/feature.extroute_firewall
indy-independence Jan 18, 2021
83b183a
Trim output from get facts so it will fit in sqlalchemy fields
indy-independence Jan 18, 2021
def5c33
Merge pull request #153 from SUNET/bugfix.get_facts_trim
indy-independence Jan 18, 2021
94d18f8
Set devices as unsynchronized after adding/deleting/updating mgmtdoma…
indy-independence Jan 18, 2021
6de6c4c
Merge pull request #154 from SUNET/bugfix.mgmtdomain_sync
indy-independence Jan 18, 2021
1341867
Log to pid specific logfile so there's no conflict when manually star…
indy-independence Jan 19, 2021
d782f56
Make get_uplinks() return existing uplinks by default, option to rech…
indy-independence Jan 19, 2021
1197cb3
Add API to update interface of access device: device_update_interfaces
indy-independence Jan 19, 2021
792e816
Add integrationtest for update_interfaces
indy-independence Jan 19, 2021
3e8d0c2
Make update_interface delete_all really delete everything in the data…
indy-independence Jan 19, 2021
2abbef1
Fix bug in removing things from unmatched interfaces. Allow passing o…
indy-independence Jan 19, 2021
74998e4
Add docs for device_update_interfaces
indy-independence Jan 19, 2021
db076ed
Make some neighbor initchecks for access devices
indy-independence Jan 20, 2021
2824eed
Get linknets for mlag peer during initcheck
indy-independence Jan 20, 2021
c71bdec
Fix dev_mlag_peer undefined
indy-independence Jan 20, 2021
e7d5424
Only check access/dist devices as uplink candidates
indy-independence Jan 20, 2021
3cbde40
Fix merging of lists. Better error messages.
indy-independence Jan 20, 2021
21b0ad2
Accept linknets to mlag peer
indy-independence Jan 20, 2021
9638f1a
No further execution in loop if skipped neighbor
indy-independence Jan 20, 2021
8bca89a
Don't add loopback cables as neighbors
indy-independence Jan 20, 2021
4957b52
Check for mlag peer in neighbors
indy-independence Jan 20, 2021
221e09a
Add mlag_compatible to summarized compatability status
indy-independence Jan 20, 2021
d85aed7
Fix error message
indy-independence Jan 20, 2021
a05d821
Merge pull request #155 from SUNET/feature.update_interfacedb
indy-independence Jan 21, 2021
bad6578
Improve error message
indy-independence Jan 21, 2021
e8b8904
Merge branch 'develop' into feature.access_initcheck
indy-independence Jan 21, 2021
fd8cb63
Update init docs
indy-independence Jan 22, 2021
3aa35f0
Refactor update_linknets, move from get -> update module
indy-independence Jan 22, 2021
dabf83d
Normalize update_facts code
indy-independence Jan 22, 2021
297fa1f
Fix integration test for new getfacts output
indy-independence Jan 22, 2021
3c99e49
Allow adding of linknets between non-fabric devices via API (can help…
indy-independence Jan 22, 2021
6bbec9e
do device_initcheck before ztp in integrationtest
indy-independence Jan 28, 2021
67fb4da
Temp disable compatible=true check for initcheck
indy-independence Jan 28, 2021
1dfdf4e
Merge pull request #156 from SUNET/feature.access_initcheck
indy-independence Jan 28, 2021
92a8cf7
Automatically reset docker env before start
indy-independence Jan 28, 2021
afe104b
Remove old websocket test client
indy-independence Jan 28, 2021
068f53b
pre-script to start/reset vms etc
indy-independence Feb 1, 2021
13cf442
Trying to fix 'I/O operation on closed file', https://github.com/acti…
indy-independence Feb 2, 2021
bc9dcda
Try prevent docker from caching git branch checkout
indy-independence Feb 2, 2021
0d07f87
add branch setup script
indy-independence Feb 2, 2021
4934cc4
Wait for auto-push step 2 to finish before proceeding to be more cons…
indy-independence Feb 3, 2021
4aa4c4d
Merge pull request #157 from SUNET/feature.integrationtestsh_improvem…
indy-independence Feb 10, 2021
e69e8b6
Update changelog for v1.2.0
indy-independence Feb 12, 2021
d76636e
Docs and ipv6 fixes
indy-independence Feb 12, 2021
43fde4f
Update issue templates
indy-independence Feb 12, 2021
7547c4a
Update issue templates
indy-independence Feb 12, 2021
8a6c48f
Version bump
indy-independence Feb 12, 2021
86871c8
Merge branch 'develop' into release.1.2
indy-independence Feb 12, 2021
a2c751c
Fix python warning
indy-independence Feb 16, 2021
b263d3b
Allow setting ipv6 addresses at host_schema (dns_servers, ntp_servers…
indy-independence Feb 18, 2021
001ef2e
fix host_regex, v4 and v6 not v4 and v4..
indy-independence Feb 18, 2021
a7ff627
Release v1.2.0
indy-independence Feb 23, 2021
b0757fc
Merge branch 'master' into release.1.2
indy-independence Feb 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Add devices x,y,z , configure settings a,b,c
2. Do API-call to URL x with data y
3. See error in job output / syslog output

**Expected behavior**
A clear and concise description of what you expected to happen.

**Outputs**
If applicable, add JSON outputs and logs. Also include relevant parts of git settings or templates if needed.

**Environment:**
- Setup [eg docker or standalone]
- Version [e.g. v1.1]
- Client [e.g. curl, webui]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ downloads/
eggs/
.eggs/
lib/
lib64
lib64/
parts/
sdist/
Expand All @@ -36,6 +37,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
bin/

# PyInstaller
# Usually these files are written by a python script from a template
Expand All @@ -59,6 +61,7 @@ coverage.xml
*.cover
.hypothesis/
.pytest_cache/
docker/coverage/

# Translations
*.mo
Expand Down Expand Up @@ -106,6 +109,7 @@ venv/
ENV/
env.bak/
venv.bak/
pyvenv.cfg

x# Spyder project settings
.spyderproject
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""add job status ABORTING and start_arguments field to job to save starting arguments in history

Revision ID: 9d01bce3c835
Revises: 8a635012afa7
Create Date: 2020-11-02 10:03:03.293297

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '9d01bce3c835'
down_revision = '8a635012afa7'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('job', sa.Column('start_arguments', postgresql.JSONB(astext_type=sa.Text()), nullable=True))
op.execute("COMMIT")
op.execute("ALTER TYPE jobstatus ADD VALUE 'ABORTING' AFTER 'ABORTED'")
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('job', 'start_arguments')
# ### end Alembic commands ###
56 changes: 30 additions & 26 deletions docker/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,54 @@ FROM debian:buster
ARG BUILDBRANCH=develop

# Create directories
RUN mkdir -p /opt/cnaas
RUN mkdir /opt/cnaas/templates
RUN mkdir /opt/cnaas/settings
RUN mkdir /etc/cnaas-nms
RUN mkdir -p /opt/cnaas/templates/
RUN mkdir /opt/cnaas/settings/
RUN mkdir /etc/cnaas-nms/

# Copy configuration files
COPY config/db_config.yml /etc/cnaas-nms/db_config.yml
COPY config/api.yml /etc/cnaas-nms/api.yml
COPY config/repository.yml /etc/cnaas-nms/repository.yml
COPY config/plugins.yml /etc/cnaas-nms/plugins.yml
# db_config.yml, api.yml, repository.yml, plugins.yml
COPY config/*.yml /etc/cnaas-nms/

# Setup script
COPY cnaas-setup.sh /opt/cnaas/cnaas-setup.sh
RUN /opt/cnaas/cnaas-setup.sh $BUILDBRANCH
COPY cnaas-setup.sh /opt/cnaas/
COPY cnaas-setup-branch.sh /opt/cnaas/
RUN /opt/cnaas/cnaas-setup.sh

# Prepare for supervisord, uwsgi, ngninx
COPY nosetests.sh /opt/cnaas/
COPY exec-pre-app.sh /opt/cnaas/
COPY config/uwsgi.ini /opt/cnaas/venv/cnaas-nms/
COPY createca.sh /opt/cnaas/
COPY --chown=root:www-data config/uwsgi.ini /opt/cnaas/venv/cnaas-nms/
COPY config/supervisord_app.conf /etc/supervisor/supervisord.conf
COPY config/nginx_app.conf /etc/nginx/sites-available/
COPY config/nginx.conf /etc/nginx/
COPY cert/* /etc/nginx/conf.d/

# Websocket test client
RUN mkdir /opt/cnaas/static
COPY client.html /opt/cnaas/static

# Give nginx some special treatment
RUN unlink /etc/nginx/sites-enabled/default
RUN ln -s /etc/nginx/sites-available/nginx_app.conf /etc/nginx/sites-enabled/default
RUN chown www-data:www-data /var/log/nginx
RUN chown www-data:www-data /etc/cnaas-nms/repository.yml
RUN chown -R www-data:www-data /var/log/nginx/
RUN chown -R www-data:www-data /var/lib/nginx
RUN chown www-data:www-data /var/lib/nginx/
RUN chown www-data:www-data /etc/cnaas-nms/*.yml
RUN chown -R www-data:www-data /var/log/nginx/
RUN chown -R www-data:www-data /var/lib/nginx/
RUN chown -R root:www-data /etc/nginx/ && \
chmod -R u=rwX,g=rX,o= /etc/nginx/
# Give permission for API to clone/sync repos
RUN chown www-data:www-data /opt/cnaas
RUN chown -R www-data:www-data /opt/cnaas/templates
RUN chown -R www-data:www-data /opt/cnaas/settings
RUN chown -R root:www-data /opt/cnaas/ && \
chmod -R u=rwX,g=rX,o= /opt/cnaas/
RUN chown -R www-data:www-data /opt/cnaas/templates/
RUN chown -R www-data:www-data /opt/cnaas/settings/
# Give permission for devicecert store
RUN mkdir /tmp/devicecerts
RUN chown -R www-data:www-data /tmp/devicecerts && \
chmod -R u=rwX,g=,o= /tmp/devicecerts
# Give permission for unittests
RUN chown root:www-data /opt/cnaas/nosetests.sh
RUN chmod g+rx /opt/cnaas/nosetests.sh
RUN chown -R www-data:www-data /opt/cnaas/venv/cnaas-nms/src
RUN chown root:www-data /opt/cnaas/*.sh && \
chmod g+rx /opt/cnaas/*.sh
RUN chown -R www-data:www-data /opt/cnaas/venv/cnaas-nms/src/

# Branch specific, don't cache
ADD "https://api.github.com/repos/SUNET/cnaas-nms/git/refs/heads/" latest_commit
RUN /opt/cnaas/cnaas-setup-branch.sh $BUILDBRANCH


# Expose HTTPS
Expand Down
17 changes: 0 additions & 17 deletions docker/api/client.html

This file was deleted.

11 changes: 11 additions & 0 deletions docker/api/cnaas-setup-branch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -e
set -x

# Temporary for testing new branch
if [ "$1" != "develop" ] ; then
cd /opt/cnaas/venv/cnaas-nms/
git checkout --track origin/$1
python3 -m pip install -r requirements.txt
fi
9 changes: 0 additions & 9 deletions docker/api/cnaas-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,6 @@ cd cnaas-nms/
git checkout master
python3 -m pip install -r requirements.txt

# Temporary for testing new branch
if [ "$1" != "develop" ] ; then
cd /opt/cnaas/venv/cnaas-nms/
git remote update
git fetch
git checkout --track origin/$1
python3 -m pip install -r requirements.txt
fi

chown -R www-data:www-data /opt/cnaas/settings
chown -R www-data:www-data /opt/cnaas/templates
#rm -rf /var/lib/apt/lists/*
Expand Down
4 changes: 4 additions & 0 deletions docker/api/config/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ host: 0.0.0.0
httpd_url: "https://cnaas_httpd:1443/api/v1.0/firmware"
verify_tls: False
jwtcert: /opt/cnaas/jwtcert/public.pem
verify_tls_device: False
cafile: /opt/cnaas/cacert/rootCA.crt
cakeyfile: /opt/cnaas/cacert/rootCA.key
certpath: /tmp/devicecerts/
9 changes: 9 additions & 0 deletions docker/api/config/supervisord_app.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ loglevel=debug
pidfile=/tmp/supervisord.pid
childlogdir=/tmp

[inet_http_server]
port=127.0.0.1:9001

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=http://127.0.0.1:9001

[program:uwsgi]
command = /usr/local/bin/uwsgi --ini /opt/cnaas/venv/cnaas-nms/uwsgi.ini
autorestart=true
Expand Down
14 changes: 14 additions & 0 deletions docker/api/createca.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

if [ -f /opt/cnaas/cacert/rootCA.key ] || [ -f /opt/cnaas/cacert/rootCA.crt ]
then
exit 0
fi

cd /opt/cnaas/cacert
umask 077
openssl genrsa -out rootCA.key 4096
openssl req -subj /C=/ST=/L=/O=/CN=cnaasNMSrootCA -x509 -new -nodes -key rootCA.key -sha256 -out rootCA.crt -days 7300
chown root:www-data rootCA.*
chmod 640 rootCA.*

9 changes: 9 additions & 0 deletions docker/api/nosetests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ source venv/bin/activate

cd venv/cnaas-nms/src

export USERNAME_DHCP_BOOT="admin"
export PASSWORD_DHCP_BOOT="abc123abc123"
export USERNAME_DISCOVERED="admin"
export PASSWORD_DISCOVERED="abc123abc123"
export USERNAME_INIT="admin"
export PASSWORD_INIT="abc123abc123"
export USERNAME_MANAGED="admin"
export PASSWORD_MANAGED="abc123abc123"

nosetests --collect-only --with-id -v
nosetests --with-coverage --cover-package=cnaas_nms -v
cp .coverage /coverage/.coverage-nosetests
Expand Down
2 changes: 1 addition & 1 deletion docker/dhcpd/cnaas-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ cd cnaas-nms/
git checkout develop
#python3 -m pip install -r requirements.txt
#minimal requirements for just dhcp-hook:
python3 -m pip install requests pyyaml netaddr
python3 -m pip install requests pyyaml netaddr jinja2

8 changes: 8 additions & 0 deletions docker/dhcpd/dhcpd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ then
fi
fi

if [ -e "/opt/cnaas/etc/dhcpd/gen-dhcpd.py" ] && \
[ -e "/opt/cnaas/etc/dhcpd/dhcpd.j2" ] && \
[ -e "/opt/cnaas/etc/dhcpd/dhcpd.yaml" ]; then
source /opt/cnaas/venv/bin/activate
cd /opt/cnaas/etc/dhcpd/
python3 gen-dhcpd.py > /opt/cnaas/dhcpd.conf
fi

#cd /opt/cnaas/venv/cnaas-nms
#git pull

Expand Down
7 changes: 6 additions & 1 deletion docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ services:
- type: volume
source: cnaas-jwtcert
target: /opt/cnaas/jwtcert
- type: volume
source: cnaas-cacert
target: /opt/cnaas/cacert

cnaas_httpd:
image:
Expand Down Expand Up @@ -78,7 +81,7 @@ services:
- 5432:5432
environment:
- POSTGRES_USER=cnaas
- POSTGRES_PASSWD=cnaas
- POSTGRES_PASSWORD=cnaas
- POSTGRES_DB=cnaas
ports:
- 5432:5432
Expand Down Expand Up @@ -118,3 +121,5 @@ volumes:
external: true
cnaas-jwtcert:
external: true
cnaas-cacert:
external: true
4 changes: 4 additions & 0 deletions docker/jwt-cert/public.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPW8bkkVIq4BX8eWwlUOUYbJhiGDv
K/6xY5T0BsvV6pbMoIUfgeThVOq5I3CmXxLt+qyPska6ol9fTN7woZLsCg==
-----END PUBLIC KEY-----
1 change: 1 addition & 0 deletions docker/postgres/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM postgres:11

COPY nms.sql /docker-entrypoint-initdb.d/
RUN chown postgres:postgres /docker-entrypoint-initdb.d/*.sql

EXPOSE 5432
Loading