Code Monkey home page Code Monkey logo

knotx-stack's Introduction

Build Status Vulnerabilities Status Gradle Status

Knot.x Stack

Knot.x Stack is a Knot.x distribution containing all dependencies, configuration files and running scripts. It does not require any external dependencies so it is used to build Knot.x Docker image.

Distribution structure

Structure of the stack is following

├── bin
|   ├── knotx                     // shell script used to run knotx instance
│   └── knotx.bat                 // Windows script used to run knotx instance                      
├── conf                          // contains application and logger configuration files
│   ├── application.conf          // defines / includes all modules that Knot.x instance is running
│   ├── bootstrap.json            // config retriever options, defines application configuration stores (e.g. points to `application.conf` - the main configuration)
│   ├── openapi.yaml              // Open API 3.0 configuration that is loaded via Knot.x HTTP Server
│   ├── server.conf               // Knot.x HTTP server configuration which is included in `application.conf`
│   ├── routes                    // server routes configurations 
│   │   ├── operations.conf       // defines handlers per Open API operation ids
│   │   └── handlers              // handlers configurations used in `operations.conf`
|   │   │   ├── fragmentsHandler.conf
|   │   │   └── httpRepoConnectorHandler.conf
│   ├── knots                     // Knot modules configurations which are included in `application.conf`
│   │   ├── templateEngineStack.conf
│   │   └── templateEngineKnot.conf
│   └── logback.xml          // logger configuration
├── lib                      // contains instance libraries and dependencies, instance classpath
│   ├── list of project dependency libraries
│   ├── ...

Building

Simply run gradlew build to build your version of Knot.x stack or simply use one from the latest release. Knot.x stack artifact is a ZIP file (see the build/distributions folder) with the structure described above.

Knot.x developers support

To develop Knot.x stack and any of its dependencies locally do following steps:

  1. clone all Knot.x stack repositories into one directory (this will be a {KNOTX_ROOT}):
https://github.com/Knotx/knotx-dependencies
https://github.com/Knotx/knotx-commons
https://github.com/Knotx/knotx-junit5
https://github.com/Knotx/knotx-launcher
https://github.com/Knotx/knotx-server-http
https://github.com/Knotx/knotx-repository-connector
https://github.com/Knotx/knotx-fragments
https://github.com/Knotx/knotx-data-bridge
https://github.com/Knotx/knotx-template-engine
https://github.com/Knotx/knotx-stack
  1. create .composite-enabled file in the Knotx/knotx-stack
touch knotx-stack/.composite-enabled
  1. import knotx-stack project in IntelliJ as a Gradle project.

You should see after a while all the Knot.x stack projects in single Idea window. Congratulations! We now wait for your contribution :)

Note: You may use Knot.x aggregator that will do (1) and (2) steps for you.

Running Stack

To start playing with Knot.x stack unzip the archive. From the knotx-stack folder, execute:

bin/knotx run-knotx

or

bin/knotx.bat run-knotx

to run the instance.

By default, Knot.x stack's server will start on localhost:8092.

knotx-stack's People

Contributors

malaskowski avatar marcinczeczko avatar marcinus avatar oskarjerzyk avatar scypio avatar skejven avatar tmaxx avatar tomaszmichalak avatar voycawojka avatar zajcu avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

knotx-stack's Issues

Validate stack configuration with tests

Is your feature request related to a problem? Please describe.
The main configuration files (from src/main/packaging) are not validated by tests. We should start Knot.x with those configs and check if the instance is running. It prevents against simple configuration errors.

Describe the solution you'd like
Tests must validate if Knot.x instance starts correctly.

Replace books and authors scenarios with payments in the functional tests

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
The purpose of this task is to replace former books and authors scenarios with the new one which is payments in every case

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.

Cleanup it-tests

Motivation
IT tests uses currently example templates. Markup is big and it is often hard to understand what happens and what actually is tested.

Describe the solution you'd like
knotx-it-tests example content files and results be simplified.
Files should contain only the thing that is tested in particular unit test.
There may be one big file to test multiple things together.

See some @tomaszmichalak comments from #33

Replace deprecated Eclipse Aether with Apache Maven Artifact Resolver

Eclipse Aether is now Apache Maven Artifact Resolver: https://maven.apache.org/resolver/

There are some hints that new project is backwards binary compatible, so for the most part it should be a matter of switching to new package names.

References:

Create functional tests for http action

The idea of this ticket is to create functional tests regarding http action. We would like to test behavior of this action in real case scenario and test cooperation with for example circuit breaker. In the scope of this ticket we have to create appropriate configs and http actions calling endpoints with mocked data, checking if handling responses, errors and fallbacks work correctly in our system

Complex scenario with Circuit Breaker & HTTP Action & Payload Inline Action

Is your feature request related to a problem? Please describe.
We need an integration test that uses:

The flow should cover:

  • we call book and author services with HTTP Action
  • book service responds with 200 with first call, all next calls end with 500
  • author service responds with 5s delay (we expect to see a page within 3s)
  • the data from book service is used in 3 fragments (we expect that book service is called 2 times, after first 500 response we put it into quarantine (open circuit state in CB))
  • the data from author service is used in 2 fragments
  • there is one fragment that uses both book and author services (think about composite node)
  • book and author services can be decorated with circuit breaker

Scope:

  • configuration
  • content and response HTML files
  • test implementation
  • case description in README file

knotx script issue on docker in Windows

Describe the bug
You cannot build stack and docker image on windows machine without issue.

To Reproduce
Steps to reproduce the behavior run on Windows:

  1. Checkout knotx-aggregator
  2. Go to knotx-aggregator/development
  3. ./pull-all.sh -r ../..
  4. ./build-stack.sh -r ../..
  5. Go to knotx-docker project and build image mvn clean install
  6. Go to knotx-starter-kit
  7. Run ./gradlew build-docker

there will be issue FAILURE: Build failed with an exception.
Logs from knotx:
standard_init_linux.go:211: exec user process caused "no such file or directory"

Expected behavior
Possibility to build own knotx images

Execute tests from all included builds

Describe the bug
Execute all Unit tests during the Gradle composite build execution.

To Reproduce
Steps to reproduce the behavior:

  1. git clone [email protected]:Knotx/knotx-aggregator.git
  2. cd knotx-aggregator/development/
  3. mkdir knotx
  4. sh pull-all.sh -r ./knotx
  5. cd knotx/knotx-stack
  6. ./gradlew test
  7. idea .
  8. modify assertions in io.knotx.fragments.engine.TaskEngineSingleOperationTest
  9. ./gradlew test is success

Expected behavior
9. ./gradlew test should fail

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.