github.com/projecteru2/core@v0.0.0-20240321043226-06bcc1c23f58/README.md (about)

     1  Eru
     2  ====
     3  ![](https://github.com/projecteru2/core/workflows/test/badge.svg)
     4  ![](https://github.com/projecteru2/core/workflows/golangci-lint/badge.svg)
     5  [![Codacy Badge](https://app.codacy.com/project/badge/Grade/69918e0a02ae45c5ae7dfc42bad5cfe5)](https://www.codacy.com/gh/projecteru2/core?utm_source=github.com&utm_medium=referral&utm_content=projecteru2/core&utm_campaign=Badge_Grade)
     6  
     7  Eru is a stateless, flexible, production-ready resource scheduler designed to easily integrate into existing systems. 
     8  
     9  Eru can use multiple engines to run anything for the long or short term. 
    10  
    11  This project is Eru Core. The Core use for resource allocation and manage resource's lifetime.
    12  
    13  Suggest use go 1.20 and above.
    14  
    15  ### Testing
    16  
    17  Run ` make test `
    18  
    19  ### Compile
    20  
    21  * Run ` make build ` if you want binary.
    22  * Run `./make-rpm ` if you want RPM for el7. However we use [FPM](https://github.com/jordansissel/fpm) for packing, so you have to prepare it first.
    23  
    24  ### Developing
    25  
    26  Run `make deps` for generating vendor dir.
    27  
    28  You can use our [footstone](https://hub.docker.com/r/projecteru2/footstone/) image for testing and compiling.
    29  
    30  #### GRPC
    31  
    32  Generate golang grpc definitions.
    33  
    34  ```shell
    35  go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
    36  go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
    37  make grpc
    38  ```
    39  
    40  #### Run it
    41  
    42  ```shell
    43  $ eru-core --config /etc/eru/core.yaml.sample
    44  ```
    45  or
    46  
    47  ```shell
    48  $ export ERU_CONFIG_PATH=/path/to/core.yaml
    49  $ eru-core
    50  ```
    51  
    52  ### Dockerized Core manually
    53  
    54  Image: [projecteru2/core](https://hub.docker.com/r/projecteru2/core/)
    55  
    56  ```shell
    57  docker run -d \
    58    --name eru_core_$HOSTNAME \
    59    --net host \
    60    --restart always \
    61    -v <HOST_CONFIG_DIR_PATH>:/etc/eru \
    62    projecteru2/core \
    63    /usr/bin/eru-core
    64  ```
    65  
    66  ### Build and Deploy by Eru itself
    67  
    68  After we implemented bootstrap in eru, now you can build and deploy eru with [cli](https://github.com/projecteru2/cli) tool.
    69  
    70  1. Test source code and build image
    71  
    72  ```shell
    73  <cli_execute_path> --name <image_name> http://bit.ly/EruCore
    74  ```
    75  
    76  Make sure you can clone code. After the fresh image was named and tagged, it will be auto pushed to the remote registry which was defined in config file.
    77  
    78  2. Deploy core itself
    79  
    80  ```shell
    81  <cli_execute_path> workloads deploy --pod <pod_name> [--node <node_name>] --entry core --network <network_name> --image <projecteru2/core>|<your_own_image> --file <core_config_yaml>:/core.yaml [--count <count_num>] [--cpu 0.3 | --mem 1024000000] http://bit.ly/EruCore
    82  ```
    83  
    84  Now you will find core was started in nodes.