All Projects → hhandoko → http4s-graal

hhandoko / http4s-graal

Licence: Apache-2.0 License
An experiment running http4s as native image with Graal (+ Substrate)

Programming Languages

scala
5932 projects
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to http4s-graal

scala-http4s-realworld-example-app
Example of a RealWorld app backend powered by Scala + http4s
Stars: ✭ 35 (+29.63%)
Mutual labels:  http4s, graalvm, graal
mozart-graal
An implementation of Oz on top of Truffle and Graal
Stars: ✭ 37 (+37.04%)
Mutual labels:  graalvm, graal
crunch
Crunch is a command-line interface (CLI) and Matrix Bot to claim staking rewards every Era for Substrate-based chains
Stars: ✭ 34 (+25.93%)
Mutual labels:  substrate
ScriptableMC-Engine
Create TypeScript/JavaScript plugins for Minecraft 1.16 Bukkit/Spigot/Paper
Stars: ✭ 36 (+33.33%)
Mutual labels:  graalvm
zorechka-bot
Github bot for keeping your Bazel dependencies up-to-date and clean
Stars: ✭ 25 (-7.41%)
Mutual labels:  http4s
Astar
The dApp hub for blockchains of the future
Stars: ✭ 533 (+1874.07%)
Mutual labels:  substrate
datdot-node-rust
datdot blockchain node in rust
Stars: ✭ 43 (+59.26%)
Mutual labels:  substrate
LogoRRR
A log viewer which visualises log events such that it is easy to identify problems or events of interest. This app was implemented using Scala and JavaFX, GluonHQ toolchain and GraalVM as platform.
Stars: ✭ 40 (+48.15%)
Mutual labels:  graalvm
ts
Misc. TypeScript definitions that are not yet available on DefinitelyTyped but required by other projects in this repo. Should be merged with upstream projects or the DT project.
Stars: ✭ 13 (-51.85%)
Mutual labels:  substrate
quarkus-performance
Comparing the CPU/Memory utilisation - Quarkus via GraalVM Native Image vs. Quarkus via Java Runtime vs. Payara-Micro via Java Runtime.
Stars: ✭ 49 (+81.48%)
Mutual labels:  graalvm
yona
Yona is a modern take on a dynamic general-purpose programming language with advanced functional programming, minimalistic ML-like syntax, strict evaluation, for GraalVM polyglot virtual machine (VM).
Stars: ✭ 113 (+318.52%)
Mutual labels:  graalvm
substrate-playground
Start hacking your substrate runtime in a web based VSCode like IDE
Stars: ✭ 68 (+151.85%)
Mutual labels:  substrate
graalvm
A Cloud Native Buildpack that provides the GraalVM implementations of JREs and JDKs
Stars: ✭ 21 (-22.22%)
Mutual labels:  graalvm
trustbase
Smart Contract parachain interoperate with Polkadot and Ethereum
Stars: ✭ 22 (-18.52%)
Mutual labels:  substrate
harry-potter-quarkus
Showcases in a web application Quarkus and Infinispan
Stars: ✭ 16 (-40.74%)
Mutual labels:  graalvm
azure-native-spring-function
Tutorial on running Spring Boot + GraalVM native images on Azure Functions
Stars: ✭ 56 (+107.41%)
Mutual labels:  graalvm
dokusho
Simple Japanese reading stats tracker
Stars: ✭ 12 (-55.56%)
Mutual labels:  http4s
substrate-docs
Substrate Developer Hub. Substrate is powered by best in class cryptographic research and comes with peer to peer networking, consensus mechanisms, and much more.
Stars: ✭ 63 (+133.33%)
Mutual labels:  substrate
tradeio
A disciplined way to purely functional domain models in Scala
Stars: ✭ 19 (-29.63%)
Mutual labels:  http4s
lucene-grep
Grep-like utility based on Lucene Monitor compiled with GraalVM native-image
Stars: ✭ 160 (+492.59%)
Mutual labels:  graalvm

License Master Build Status

http4s + Graal

http4s-graal is an experiment to get http4s web service running as native image with Graal (+ Substrate).

Prerequisites

Develop and Compile Dependencies

The following binaries / libraries need to be installed in order to compile the web service (including converting it to native image). The version numbers denotes the specific version used to develop the web service, it may not work under other minor versions:

Setup Steps

  1. Install and configure Graal:
    1. Download Graal (CE / EE) and extract to a folder of your choice
    2. Add Graal binaries folder (bin) to PATH, e.g. export PATH=~/graalvm-ce-1.0.0-rc14/bin:$PATH
  2. Install SBT:
  3. Create the uber-jar by running sbt assembly on the project root
  4. Create the native image by running native-image -H:+ReportUnsupportedElementsAtRuntime -jar target/scala-2.12/http4s-graal-assembly-0.0.1-SNAPSHOT.jar
  5. Start the web service with ./http4s-graal-assembly-0.0.1-SNAPSHOT

Now you can visit localhost:8080 from your browser.

Alternatively:

  1. Run ./scripts/graal/bin/setup.sh to download and setup Graal.
  2. Run ./scripts/graal/bin/dist.sh to create a native image distribution under the /dist directory.

Docker Images

Several Dockerfiles have been provided to allow project compilation and packaging, targeting multiple runtime environments. It utilises multi-stage Docker builds, so no other dependency is required apart from Docker itself. All containers by default will be accessible at port 9080, e.g. localhost:9080.

Run ./scripts/graal/bin/build.sh -i <image> where image is one of the following:

  • zulu8 (default) Azul Zulu 8 on Ubuntu 18.04
  • zulu11 Azul Zulu 11 on Ubuntu 18.04
  • graal GraalVM on Oracle Linux 7 (slim)
  • native Graal + Substrate native image on Oracle Linux 7 (slim)

NOTE: http4s Docker containers will be constrained to 1 CPU and 4GB of memory.

Container Management and Monitoring

Portainer is an open-source web-based Docker management UI. It allows viewing of container stats in realtime: CPU and memory usage, networking, and processes running in the container.

  1. Run ./scripts/portainer/bin/setup.sh to pull the latest Portainer image and create the data volume.
  2. Run ./scripts/portainer/bin/start.sh to start the Portainer container:

Gatling Load Testing

Gatling is an open-source load and performance testing framework based on Scala, Akka and Netty.

  1. Run sbt gatling:test to download, setup, and run Gatling load testing simulation(s).

Contributing

We follow the "feature-branch" Git workflow.

  1. Commit changes to a branch in your fork (use snake_case convention):
    • For technical chores, use chore/ prefix followed by the short description, e.g. chore/do_this_chore
    • For new features, use feature/ prefix followed by the feature name, e.g. feature/feature_name
    • For bug fixes, use bug/ prefix followed by the short description, e.g. bug/fix_this_bug
  2. Rebase or merge from "upstream"
  3. Submit a PR "upstream" to develop branch with your changes

Please read CONTRIBUTING for more details.

License

    Copyright (c) 2018 - 2019 Herdy Handoko

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

http4s-graal is released under the Apache Version 2.0 License. See the LICENSE file for further details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].