Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

radanalytics.io contribution for Spark and WildFly Swarm s2i tutorial

License

Notifications You must be signed in to change notification settings

radanalyticsio/tutorial-sparkpi-java-wfswarm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wfswarm-sparkpi

A Java implementation of SparkPi using WildFly Swarm

This application is an example tutorial for the radanalytics.io community. It is intended to be used as a source-to-image (s2i) application.

Quick start

You should have access to an OpenShift cluster and be logged in with the oc command line tool.

  1. Create the necessary infrastructure objects

    oc create -f http://radanalytics.io/resources.yaml
  2. Launch wfswarm-sparkpi

    oc new-app --template oshinko-java-spark-build-dc \
        -p APPLICATION_NAME=wfswarm-sparkpi \
        -p GIT_URI=https://github.com/radanalyticsio/tutorial-sparkpi-java-wfswarm \
        -p APP_FILE=wfswarm-sparkpi-1.0-SNAPSHOT-swarm.jar
  3. Expose an external route

    oc expose svc/wfswarm-sparkpi
  4. Visit the exposed URL with your browser or other HTTP tool, for example:

    $ curl http://`oc get routes/wfswarm-sparkpi --template='{{.spec.host}}'`/app
    WildFly Swarm SparkPi server ready.
    Add /sparkpi to invoke Pi computation.
    
    $ curl http://`oc get routes/wfswarm-sparkpi --template='{{.spec.host}}'`/app/sparkpi
    Pi is roughly 3.140480

Optional parameter

If you would like to change the number of samples that are used to calculate Pi, you can specify them by adding the scale argument to your request , for example:

$ curl http://`oc get routes/wfswarm-sparkpi --template='{{.spec.host}}'`/app/sparkpi?scale=10
Pi is roughly 3.141749

About

radanalytics.io contribution for Spark and WildFly Swarm s2i tutorial

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages