GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - kernelci/kernelci-api: KernelCI API - Database - Pub/Sub

BranchesTags
Open more actions menu

Latest commit

 

History

929 Commits
929 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
api
api
 
 
doc
doc
 
 
docker
docker
 
 
kube/aks
kube/aks
 
 
migrations
migrations
 
 
scripts
scripts
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
COPYING
COPYING
 
 
README.md
README.md
 
 
dev-docker-compose.yaml
dev-docker-compose.yaml
 
 
docker-compose.yaml
docker-compose.yaml
 
 
env.sample
env.sample
 
 
pyproject.toml
pyproject.toml
 
 
test-docker-compose.yaml
test-docker-compose.yaml
 
 

Repository files navigation

KernelCI project logo

KernelCI API

This repository is a work-in-progress implementation of a new API and database interface for KernelCI, to replace kernelci-backend. It's mainly based on FastAPI, Mongo DB and Redis.

Please refer to the architecture for more details.

Getting started with docker-compose

Please refer to start Docker containers of all the services.

Note that the FastAPI server is running on port 8000 inside the container, but it's exposed to the host via port 8001 to avoid conflicts with other services. This can be adjusted for each setup in docker-compose.yaml.

Authentication

Generate a new key for Authentication ). After that, please refer to create and add a user in Mongo DB. The user can also generate an API token to use API endpoints.

For simple user management (invite, accept, login, whoami), use the helper script scripts/usermanager.py. It accepts an optional usermanager.toml config file (including multiple instances) or KCI_API_URL / KCI_API_TOKEN / KCI_API_INSTANCE environment variables.

Ultimately, there will be a web frontend to provide a login form. We don't have that yet as this new KernelCI API implementation is still in its early stages.

API Documentation

The FastAPI server will automatically generate documentation for the API itself and serve it directly: http://localhost:8001/latest/docs

To use the generated documentation, first open it with a web browser. Then click on "Authorize 🔓", enter the user name and password and click on the new "Authorize" button.

This is based on OpenAPI, and you can also download the openapi.json file to use it with other tools: http://localhost:8001/latest/openapi.json

API Testing

Please follow the below instructions to test API endpoints.

Install Python requirements with additional packages for testing:

pip install -r docker/api/requirements-dev.txt

We have already created .env file from Authentication section. Export the file with SECRET_KEY environment variable in it:

export $(cat .env)

Run the below command from kernelci-api directory:

pytest -v tests/unit_tests/

This will start running unit test cases from kernelci-api/test directory and display results.

In addition to the unit tests, end-to-end tests for API has been developed. A Github action check test is running on every push and pull to execute the end-to-end tests.

In order to ease the execution of the tests locally, a shell script run_e2e_tests.sh has been introduced.

Run the below command from kernelci-api directory:

./run_e2e_tests.sh

This will start running e2e test cases in a docker-compose environment from kernelci-api/e2e_tests directory and display results.

About

KernelCI API - Database - Pub/Sub

Resources

Readme
LGPL-2.1 license

Code of conduct

Code of conduct
Activity
Custom properties

Stars

10 stars

Watchers

15 watching

Forks

22 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.