clixon/docker/main
Olof hagsand 19e21be0bc Very large commit for upcoming 4.4 release
Major New features

* New and updated search functions using xpath, api-path and instance-id
  * New search functions using api-path and instance_id:
    * C search functions: `clixon_find_instance_id()` and `clixon_find_api_path()`
  * Binary search optimization in lists for indexed leafs in all three formats.
    * This improves search performance to O(logN) which is drastical improvements for large lists.
  * You can also register explicit indexes for making binary search (not only list keys)
  * For more info, see docs at [paths](https://clixon-docs.readthedocs.io/en/latest/paths.html) and
[search](https://clixon-docs.readthedocs.io/en/latest/xml.html#searching-in-xml)

API changes on existing features (you may need to change your code)
* On failed validation of leafrefs, error message changed from: `No such leaf` to `No leaf <name> matching path <path>`.
* CLI Error message (clicon_rpc_generate_error()) changed when backend returns netconf error to be more descriptive:
  * Original: `Config error: Validate failed. Edit and try again or discard changes: Invalid argument`
  * New (example): `Netconf error: application operation-failed Identityref validation failed, undefined not derived from acl-base . Validate failed. Edit and try again or discard changes"

Minor changes

* Test framework
  * Added `-- -S <file>` command-line to main example to be able to return any state to main example.
  * Added `test/cicd` test scripts for running on a set of other hosts
* C-code restructuring
  * clixon_yang.c partitioned and moved code into clixon_yang_parse_lib.c and clixon_yang_module.c and move back some code from clixon_yang_type.c.
    * partly to reduce size, but most important to limit code that accesses internal yang structures, only clixon_yang.c does this now.
2020-02-02 15:52:30 +01:00
..
cleanup.sh * A new "hello world" example is added 2019-04-17 11:26:05 +02:00
Dockerfile Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
Makefile.in Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
README.md * A new "hello world" example is added 2019-04-17 11:26:05 +02:00
start.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00
startsystem.sh Very large commit for upcoming 4.4 release 2020-02-02 15:52:30 +01:00

Clixon example test container

This directory show how to build a "monolithic" clixon docker container exporting port 80 and contains the example application with both restconf, netconf, cli and backend. It also includes packages to be able to run the Clixon tests.

The directory contains the following files: cleanup.sh kill containers Dockerfile Docker build instructions Makefile.in "make docker" builds the container README.md This file start.sh Start containers startsystem.sh Internal start script copied to inside the container (dont run from shell)

How to build and start the container (called clixon-system):

  $ make docker
  $ ./start.sh 

The start.sh has a number of environment variables to alter the default behaviour:

  • PORT - Nginx exposes port 80 per default. Set PORT=8080 for example to access restconf using 8080.
  • DBG - Set debug. The clixon_backend will be shown on docker logs.
  • CONFIG - Set XML configuration file other than the default example.
  • STORE - Set running datastore content to other than default.

Example:

  $ DBG=1 PORT=8080 ./start.sh

Once running you can access it in different ways as follows: As CLI:

  $ sudo docker exec -it clixon-system clixon_cli

As netconf via stdin/stdout:

  $ sudo docker exec -it clixon-system clixon_netconf

As restconf using curl on exposed port 80:

  $ curl -G http://localhost/restconf

Or run tests:

  $ sudo docker exec -it clixon-system bash -c 'cd /usr/local/bin/test && ./all.sh'

To check status and then kill it:

  $ sudo docker ps --all
  $ ./cleanup.sh 

You trigger the test scripts inside the container using make test.

Changing code

If you want to edit clixon code so it runs in the container? You either (1) "persistent": make your changes in the actual clixon code and commit; make clean to remove the local clone; make test again (2) "volatile" edit the local clone; make test.