LilPoppy / cobnet

A simple polyglot server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cobnet

CI License versionjava versionspringboot versionspringcloud versiongraalvm versionspring-graalvm fork this repo GitHub issues

This is a spring-native polyglot server that can be quickly deployed.

Getting Started

JVM

This project is developed in GraalVM environment, so please configure the corresponding environment when you want to run this project as SVM, see Get Started with GraalVM.

This project can be easily build with maven, run the following goal:

mvn clean package

Then run the followings to start the server:

sh ./bin/start.sh

or

java -jar target/cobnet.jar

Spring Native

This project has been configured to let you generate either a lightweight container or a native executable.

Configuration

Default source is already configured good to be build native or container. But if you have other modified we can use agent and some tool to help for configuration needs, to use these options the following needs to be setup:

Native image agent

Native images are built ahead of runtime and their build relies on a static analysis of which code will be reachable.

First build a jvm mirror

mvn clean package

Then run with the agent

java -agentlib:native-image-agent=config-merge-dir=src/main/java/ -jar target/cobnet.jar agent
Auto proxy script

A script which written in Python3 to help you append Graal Native needed proxy into extra-proxy-config.json.

From project root directory run:

cd script

Then run the script:

python3 ProxyHelper.py

Lightweight Container with Cloud Native Buildpacks

If you're already familiar with Spring Boot container images support, this is the easiest way to get started with Spring Native. Docker should be installed and configured on your machine prior to creating the image, see the Getting Started section of the reference guide.

####To create the docker image and container by compose, there is two options.

#####JVM:

mvn -Dredis-host=redis -Ddb-host=db clean install -Pdocker -Ddocker-target=jvm

#####Native:

mvn -Dredis-host=redis -Ddb-host=db clean install -Pdocker -Ddocker-target=native

To start the app you can run as follows:

docker start -a cobnet

Executable with Native Build Tools

Use this option if you want to explore more options such as running your tests in a native image. The GraalVM native-image compiler should be installed and configured on your machine, see the Getting Started section of the reference guide.

To create the executable, run the following goal:

mvn clean package -Pnative

Then, you can run the app as follows:

sh ./bin/start.sh

or

target/cobnet

Reference Documentation

For further reference, please consider the following sections:

Guides

The following guides illustrate how to use some features concretely:

Additional Links

These additional references should also help you:

About

A simple polyglot server.


Languages

Language:Java 94.8%Language:Python 3.2%Language:Dockerfile 0.6%Language:HTML 0.5%Language:JavaScript 0.5%Language:Shell 0.4%