GithubHelp home page GithubHelp logo

ivybazan / djl-spring-boot-starter-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from deepjavalibrary/djl-spring-boot-starter-demo

0.0 0.0 0.0 94 KB

DJL Spring Boot Starter Demo apps

License: Apache License 2.0

Kotlin 30.88% Shell 0.49% Java 40.91% CSS 21.52% HTML 6.20%

djl-spring-boot-starter-demo's Introduction

DJL Spring Boot Demo

This repository contains example code demonstrating how to use the Deep Java Library (DJL) with Spring Boot and the DJL Spring Boot Starter. It covers MXNet-based object detection inference with platform specific DJL libraries that can be consumed using DJL Spring Boot Starter dependencies.

Building the backend

Examples use Gradle as the build tool. It is a multi-project build. Before building, ensure that the DJL Spring Boot starter BOM is in your local maven repository. For more information, see the DJL Spring Boot Starter repo. You need to check out this repository and run ./mvnw install.

To build the DJL Spring Boot microservice, run the following command:

./gradlew :djl-spring-boot-app:bootJar

This command detects the operating system on the system where the build is running and uses it for platform dependency resolution.

Platform specific builds (for CI):

./gradlew :djl-spring-boot-app:bootJar -P osclassifier=linux-x86_64
./gradlew :djl-spring-boot-app:bootJar -P osclassifier=osx-x86_64
./gradlew :djl-spring-boot-app:bootJar -P osclassifier=win-x86_64

The produced artifacts will have the classifier in the name of the spring boot uber jar, e.g.

djl-spring-boot-app/build/libs/djl-spring-boot-app-0.0.1-SNAPSHOT-linux-x86_64.jar
djl-spring-boot-app/build/libs/djl-spring-boot-app-0.0.1-SNAPSHOT-osx-x86_64.jar

Running the backend

Running the app requires the following: The S3 bucket (djl-demo by default) must be specified in djl-spring-boot-app/src/main/resources/application.properties. The bucket is expected to have two prefixes: inbox, where input is located, and outbox, where results are placed. AWS_ACCESS_KEY and AWS_SECRET_KEY set as environment variables. The IAM user must have read permissions for the inbox and write permissions for the outbox.

Use the following command to run the backend on macOS:

java -jar djl-spring-boot-app/build/libs/djl-spring-boot-app-0.0.1-SNAPSHOT-osx-x86_64.jar

Deploying to PCF

Make sure your manifest.yml file contains valid S3 access credentials. You can specify your own bucket in [application.properties] (djl-spring-boot-app/src/main/resources/application.properties) and web application.properties.

Use the following command to deploy:

cf login
cf push -f manifest.yml -p build/libs/djl-spring-boot-app-0.0.1-SNAPSHOT-linux-x86_64.jar

Check the logs:

cd logs djl-demo --recent

Frontend Web Application

Web Application

License

This project is licensed under the Apache-2.0 License.

djl-spring-boot-starter-demo's People

Contributors

amazon-auto avatar frankfliu avatar ivybazan avatar shapirov103 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.