dargoner / bios

Business Informatization OS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WIP ! BIOS(Business Informatization OS)

In a word: BIOS is a new form of low-intrusive, high-adaptation, and fast output to enable digital transformation of enterprises.

Tip
For the Chinese description see: http://www.idealworld.group/2021/06/09/bios/
Tip
For a performance version of the service framework see: https://github.com/ideal-world/tardis
Tip
For a generic version of the service framework see: https://github.com/gudaoxuri/dew/

Introduction

BIOS can serve the digital transformation of enterprises independently or be integrated with the mainstream middle platform. As the core capability of the middle platform, it can realize higher-level R&D collaboration and capability reuse by pulling through the organizational structure of the middle platform.

In the form of BIOS, enterprises can deploy it on different (public or private) cloud platforms with low cost (software and hardware). BIOS itself provides basic functions such as user rights, user reach, process decision, and more reusable functions in the material market, providing rich service support for our product development. At the same time, the low-code build capability also provides a strong guarantee for the rapid build and secondary development of the product. Enterprises only need to focus on business implementation, and the complexity of software development is absorbed by BIOS itself. And all of this is scalable and can be integrated with existing enterprise systems and can be integrated by the middle platform.

Technical Architecture

The core requirements of Bios from a technical perspective are:

  • Security and reliability: As the core platform, security and reliability must be the most basic requirements. Technically, we focus on using memory/type-safe language, avoiding reflection, reducing three-party dependency, using stateless services, and improving testing, etc.

  • High performance: performance is the eternal pursuit, core interface TPS more than 1w/per node, technical attention to the introduction of Reactive model, the use of distributed architecture, reasonable cache architecture, reduce or avoid GC, etc.

  • Low cost: reduce the cost of deployment and use, verification environment resources control within 8C32G, technically concerned about Docker deployment, reduce the use of heavy frameworks such as Spring, services can be split and combined.

  • Scalable: support secondary development and integration, technically concerned about the design of functional extension points, model abstraction, etc.

architecture

Quick experience

Tip
Environmental requirements

Docker, MySQL, Redis, RabbitMQ services installed.

  1. Configuration services(E.g. /opt/config/conf-default.toml)

    [fw]
    [fw.app]
    id = "bios-serv-all"
    name = "BIOS All Services"
    desc = "BIOS All Services"
    version = "0.1.0"
    
    [fw.web_server]
    # Service port
    port = 8080
    [fw.web_server.modules.iam]
    title = "IAM Component"
    # Change to the corresponding IP
    doc_urls = [["test env", "http://x.x.x.x:8080/"]]
    
    [fw.db]
    # Change to the corresponding MySQL connection information
    url = "mysql://root:123456@x.x.x.x:3306/test"
    
    [fw.cache]
    # Change to the corresponding Redis connection information
    url = "redis://:123456@x.x.x.x:6379"
    
    [fw.mq]
    # Change to the corresponding Rabbit connection information
    url = "amqp://user:123456@x.x.x.x:5672/%2f"
  2. Name the configuration file conf-default.toml and store it in the config directory

  3. Start the service

    # Change the volume to the corresponding directory
    docker run --name bios-serv-all -d -p 8080:8080 -v /opt/bios/config:/bios/config ghcr.io/ideal-world/bios-serv-all:latest
  4. Obtain system administrator username and password

    docker logs -f bios-serv-all | grep "Initial password"
  5. Test the service

    Open http://x.x.x.x:8080/iam/ui
  6. Start the gateway

    # Change the volume to the corresponding directory
    docker run --name bios-gateway -d -p 9080:9080 ghcr.io/ideal-world/bios-gateway:latest
  7. Configuration gateway

    # Add the service address (modify it to the corresponding IP and port)
    curl "http://127.0.0.1:9080/apisix/admin/upstreams/1" -H "X-API-KEY: edd1c9f034335f136f87ad84b625c8f1" -X PUT -d '
    {
      "type": "roundrobin",
      "nodes": {
        "x.x.x.x:8080": 1
      }
    }'
    curl "http://127.0.0.1:9080/apisix/admin/routes/1" -H "X-API-KEY: edd1c9f034335f136f87ad84b625c8f1" -X PUT -d '
    {
      "uri": "/*",
      "upstream_id": "1"
    }'
    
    # Add permission plugin (modified to have the same Redis information as the service)
    curl "http://127.0.0.1:9080/apisix/admin/global_rules/1" -H "Content-Type: application/json" -H "X-API-KEY: edd1c9f034335f136f87ad84b625c8f1" -X PUT -d '
    {
      "plugins": {
        "auth-bios": {
          "redis_host": "x.x.x.x",
          "redis_password": "123456",
          "redis_database": 0
        }
      }
    }'
  8. Launching tests from the gateway

    # Login, replace ak and sk with the above username and password
    curl -H 'Content-Type: application/json' -X PUT \
        -d '{"ak":"bios",
             "sk":"xxx"}' \
        http://x.x.x.x:9080/iam/cp/login/userpwd
    
    # Successful login returns a message similar to the following
    
    {
        "code": "200",
        "data":{
            "account_id": "NeL1HCHKqMhHZRhWai3BC",
            "account_name": "bios",
            "apps":[],
            "groups":{},
            "roles":{
                "iU8IFtIHPsmDPGNV_3-Bx": "sys_admin"
            },
            "token": "tkwVf5J2y4XIjjwwpfnjiBt"
        },
        "msg": ""
    }

About

Business Informatization OS

License:Apache License 2.0


Languages

Language:Rust 93.0%Language:Perl 2.5%Language:Raku 2.1%Language:Lua 1.5%Language:Shell 0.8%Language:Dockerfile 0.1%