{"id":18368695,"url":"https://github.com/radanalyticsio/tutorial-sparkpi-scala-akka","last_synced_at":"2025-04-06T17:31:49.186Z","repository":{"id":68707225,"uuid":"95588759","full_name":"radanalyticsio/tutorial-sparkpi-scala-akka","owner":"radanalyticsio","description":null,"archived":false,"fork":false,"pushed_at":"2018-05-23T16:51:08.000Z","size":11,"stargazers_count":5,"open_issues_count":2,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-22T04:02:22.530Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/radanalyticsio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-27T18:30:38.000Z","updated_at":"2019-12-21T00:28:33.000Z","dependencies_parsed_at":"2023-09-18T23:33:47.411Z","dependency_job_id":null,"html_url":"https://github.com/radanalyticsio/tutorial-sparkpi-scala-akka","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radanalyticsio%2Ftutorial-sparkpi-scala-akka","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radanalyticsio%2Ftutorial-sparkpi-scala-akka/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radanalyticsio%2Ftutorial-sparkpi-scala-akka/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radanalyticsio%2Ftutorial-sparkpi-scala-akka/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/radanalyticsio","download_url":"https://codeload.github.com/radanalyticsio/tutorial-sparkpi-scala-akka/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247522413,"owners_count":20952543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T23:27:05.355Z","updated_at":"2025-04-06T17:31:49.177Z","avatar_url":"https://github.com/radanalyticsio.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SparkPi\nA Scala webapp using akka-http to launch a SparkPi computation from an HTTP endpoint (GET)\n\nThis application is an example tutorial for the [radanalytics.io](https://radanalytics.io) community.\nIt is intended to be used as a source-to-image (s2i) application.\n\n## Quick start\n\nYou should have access to an OpenShift cluster and be logged in with the\n`oc` command line tool.\n\n1. Create the necessary infrastructure objects\n   ```bash\n   oc create -f https://radanalytics.io/resources.yaml\n   ```\n\n1. Launch scala-spark-webapp\n   ```bash\n   oc new-app --template oshinko-scala-spark-build-dc \\\n   -p APPLICATION_NAME=scala-spark-webapp \\\n   -p GIT_URI=https://github.com/radanalyticsio/tutorial-sparkpi-scala-akka \\\n   -p APP_MAIN_CLASS=io.radanalytics.examples.akka.sparkpi.WebServerHttpApp \\\n   -p APP_FILE=scala-spark-webapp_2.11-0.1.jar \\\n   -p SPARK_OPTIONS=\" --packages com.typesafe.akka:akka-http_2.11:10.0.9,com.typesafe.akka:akka-http-xml_2.11:10.0.9,com.typesafe.akka:akka-stream_2.11:2.5.3 --conf spark.jars.ivy=/tmp/.ivy2 \"\n   ```\n\n1. Expose an external route\n   ```bash\n   oc expose svc/scala-spark-webapp\n   ```\n\n1. Visit the exposed URL with your browser or other HTTP tool, for example:\n   ```bash\n   $ curl http://`oc get routes/scala-spark-webapp --template='{{.spec.host}}'`\n     Scala Akka SparkPi server running. Add the 'sparkpi' route to this URL to invoke the app.\n   $ curl http://`oc get routes/scala-spark-webapp --template='{{.spec.host}}'`/sparkpi\n     Pi is roughly 3.1458957294786476\n   ```\n\n ### Optional parameter\n\n If you would like to change the number of samples that are used to calculate\n Pi, you can specify them by adding the `scale` argument to your request\n , for example:\n\n ```bash\n $ curl http://`oc get routes/scala-spark-webapp --template='{{.spec.host}}'`/sparkpi?scale=10\n Pi is roughly 3.141749\n ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradanalyticsio%2Ftutorial-sparkpi-scala-akka","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fradanalyticsio%2Ftutorial-sparkpi-scala-akka","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradanalyticsio%2Ftutorial-sparkpi-scala-akka/lists"}