Giter VIP home page Giter VIP logo

funqy-multi-cloud's Introduction

Multi Cloud Funqy Demo

Local

  1. Launch application using:
    ./mvnw quarkus:dev
    
  2. Test by issuing curl commands:
    URL=http://localhost:8080
    curl -X GET $URL/hello 
    curl -d '"Funqy"' -X POST $URL/greet
    

Azure Function

Pre-requisites

  1. AZ CLI
  2. Azure Functions Core Tools (optional to run function locally)

Deploy

  1. Export the following variables:

    export GUID='guid'
    export CLIENT_ID='client-id'
    export PASSWORD='value'
    export TENANT='tenant-value'
    export SUBSCRIPTION='subscription-value'
    export RESOURCEGROUP='resource-group'
    
  2. Login to Azure

    az login --service-principal -u $CLIENT_ID -p $PASSWORD --tenant $TENANT
    
  3. Build Azure Function and deploy it to Azure

    ./mvnw clean package -f pom-azure.xml -DskipTests -DtenantId=$TENANT \
    -DfunctionResourceGroup=$RESOURCEGROUP azure-functions:deploy
    
  4. Test by issuing curl commands with the URL from the deploy output:

    URL=<URL from deploy output without ending slash>
    curl -w '\nTime: %{time_total}s\n' -X GET $URL/hello 
    curl -w '\nTime: %{time_total}s\n' -d '"Azure"' -X POST $URL/greet
    

AWS Lambda

Pre-requisites

  1. AWS CLI
  2. SAM CLI

Deploy

  1. Login to AWS

    aws configure
    
  2. Build Lambda function

    ./mvnw clean package -f pom-aws.xml -DskipTests
    
  3. Deploy Lambda to AWS

    sam deploy -t target/sam.jvm.yaml --guided --capabilities CAPABILITY_NAMED_IAM
    
    1. Alternatively you can use Native build and deploy to AWS
      ./mvnw clean package -f pom-aws.xml -DskipTests -Pnative -Dquarkus.native.container-build=true
      sam deploy -t target/sam.native.yaml --guided --capabilities CAPABILITY_NAMED_IAM
      
  4. Test by issuing curl commands with the URL from the deploy output:

    URL=<URL from deploy output without ending slash>
    curl -w '\nTime: %{time_total}s\n' -X GET $URL/hello 
    curl -w '\nTime: %{time_total}s\n' -d '"AWS"' -X POST $URL/greet
    

Google Cloud Function

Pre-requisites

  1. gcloud CLI

Deploy

  1. Login to gcloud

    gcloud init
    
  2. Build Google Cloud Function

    ./mvnw clean package -f pom-gcp.xml -DskipTests
    
  3. Deploy Function to GCP

    gcloud functions deploy quarkus-funqy-http \
        --entry-point=io.quarkus.gcp.functions.http.QuarkusHttpFunction \
        --runtime=java11 --trigger-http --allow-unauthenticated --source=target/deployment
    
  4. Test by issuing curl commands with the URL from the deploy output:

    URL=<URL from deploy output>
    curl -w '\nTime: %{time_total}s\n' -X GET $URL/hello 
    curl -w '\nTime: %{time_total}s\n' -d '"GCP"' -X POST $URL/greet
    

KNative

Pre-requisites

  1. oc (OpenShift) CLI
  2. kn CLI
  3. Install OpenShift Serverless Operator
    1. Log into OpenShift Console with a cluster admin user
    2. Navigate to Operators/OperatorHub
    3. Search for Serverless and click on "Red Hat OpenShift Serverless"
    4. Click on Install
    5. Accept default values and click Install
    6. Once Operator is installed, create Knative Serving instance by running this command:
    oc apply -f knative/serving.yaml
    

Deploy

  1. Build KNative Function and deploy it to OpenShift (requires podman desktop/docker running to deploy):

    oc login --token=<token> --server=<api-url>
    oc new-project funqy-knative
    kn func deploy
    
    1. Alternatively you can deploy function using previously published public image:
    kn func deploy --build=false --push=false --registry quay.io --image quay.io/jbaldera/funqy-knative:1.0
    
  2. Test by issuing curl commands with the URL from the deploy output:

    URL=<URL from deploy output>
    curl -w '\nTime: %{time_total}s\n' -X GET $URL/hello 
    curl -w '\nTime: %{time_total}s\n' -d '"KNative"' -X POST $URL/greet
    

funqy-multi-cloud's People

Contributors

yortch avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

jamesdri

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.