Coder Social home page Coder Social logo

swimos / tutorial Goto Github PK

View Code? Open in Web Editor NEW
27.0 12.0 10.0 134 KB

Tutorials to help you build your first Swim app

Home Page: https://swimOS.org

Java 39.52% HTML 60.48%
tutorial tutorial-code swim java javascript distributed-systems distributed-computing actor-model stateful open-source

tutorial's Introduction

Swim Tutorial

Swim is a completely integrated solution for building scalable, end-to-end streaming applications. Instead of requiring separate message brokers, app servers, and databases, Swim applications consist of just two pieces:

  • A Swim server with built-in persistence, messaging, scheduling, clustering, replication, introspection, and security

  • A user interface that uses Swim's streaming UI frameworks to visualize data from Swim servers in real-time

Read this in other languages: 简体中文

Run

  • Install JDK 11+.

    • Ensure that your JAVA_HOME environment variable is pointed to your Java installation location.
    • Ensure that your PATH includes $JAVA_HOME.
  • From a console pointed to the server directory, run ./gradlew run (.\gradlew.bat run on Windows) to run the Swim server.

  • Then, open ui/chart.html, ui/gauge.html, and ui/pie.html in your browser to see the different real-time UI components.

How It Works

Visit server to learn how to stand up your data in a Swim server.

Then, visit ui to learn to visualize this data like never before.

tutorial's People

Contributors

adityarandive avatar ajay-gov avatar brohitbrose avatar c9r avatar crista2019 avatar freyadyu avatar sircipher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tutorial's Issues

Java 11 Parsing error of swim.codec

Hi. Still trying to get the swim server to build on my machine. I've tried Java 9,11, and 14, and Gradle versions 5.1, 6.0.1, 6.3, 6.5. on Windows 10.

I downloaded a fresh version of the tutorial repo this afternoon, knowing that you recently updated it.

Using java 11.0.7 and gradle 6.0.1 which matches the gradlew version:

I get the following error at 80% execution.

Prairie Rose@DESKTOP-4SLV1D8 MINGW64 ~/Downloads/tutorial-master/tutorial-master/server
$ java -version
java version "11.0.7" 2020-04-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.7+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.7+8-LTS, mixed mode)

Prairie Rose@DESKTOP-4SLV1D8 MINGW64 ~/Downloads/tutorial-master/tutorial-master/server
$ gradle -v


Gradle 6.0.1

Build time: 2019-11-18 20:25:01 UTC
Revision: fad121066a68c4701acd362daf4287a7c309a0f5

Kotlin: 1.3.50
Groovy: 2.5.8
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 11.0.7 (Oracle Corporation 11.0.7+8-LTS)
OS: Windows 10 10.0 amd64

Prairie Rose@DESKTOP-4SLV1D8 MINGW64 ~/Downloads/tutorial-master/tutorial-master/server
$ ./gradlew.bat -v


Gradle 6.0.1

Build time: 2019-11-18 20:25:01 UTC
Revision: fad121066a68c4701acd362daf4287a7c309a0f5

Kotlin: 1.3.50
Groovy: 2.5.8
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 11.0.7 (Oracle Corporation 11.0.7+8-LTS)
OS: Windows 10 10.0 amd64

Prairie Rose@DESKTOP-4SLV1D8 MINGW64 ~/Downloads/tutorial-master/tutorial-master/server
$ ./gradlew run
Starting a Gradle Daemon, 2 busy Daemons could not be reused, use --status for details

Task :run
Running Tutorial plane...
error: unexpected ' '
--> :1:17
|
1 | C:/Users/Prairie Rose/Downloads/tutorial-master/tutorial-master/server
| ^
at swim.codec/swim.codec.Parser.error(Parser.java:142)
at swim.uri/swim.uri.UriParser.parsePathString(UriParser.java:214)
at swim.uri/swim.uri.UriPath.parse(UriPath.java:314)
at swim.service.web/swim.service.web.WebServer.(WebServer.java:62)
at swim.service.web/swim.service.web.WebService.createServer(WebService.java:118)
at swim.io.http/swim.io.http.HttpSocketService.createSocket(HttpSocketService.java:51)
at swim.io/swim.io.TcpService.doAccept(TcpService.java:117)
at swim.io/swim.io.StationTransport.doAccept(Station.java:453)
at swim.io/swim.io.StationThread.doAccept(Station.java:1079)
at swim.io/swim.io.StationThread.select(Station.java:1005)
at swim.io/swim.io.StationThread.run(Station.java:882)
error: unexpected ' '
--> :1:17
|
1 | C:/Users/Prairie Rose/Downloads/tutorial-master/tutorial-master/server
| ^
at swim.codec/swim.codec.Parser.error(Parser.java:142)
at swim.uri/swim.uri.UriParser.parsePathString(UriParser.java:214)
at swim.uri/swim.uri.UriPath.parse(UriPath.java:314)
at swim.service.web/swim.service.web.WebServer.(WebServer.java:62)
at swim.service.web/swim.service.web.WebService.createServer(WebService.java:118)
at swim.io.http/swim.io.http.HttpSocketService.createSocket(HttpSocketService.java:51)
at swim.io/swim.io.TcpService.doAccept(TcpService.java:117)
at swim.io/swim.io.StationTransport.doAccept(Station.java:453)
at swim.io/swim.io.StationThread.doAccept(Station.java:1079)
at swim.io/swim.io.StationThread.select(Station.java:1005)
at swim.io/swim.io.StationThread.run(Station.java:882)
<==========---> 80% EXECUTING [19s]
:run

Tutorial Server will not build.

Followed the install instructions in the readme file, but when running I get the following error, and it is stuck at 80% executing. Left running all night without change.

Using Java 9.0.4

Extended terminal snippet:

1 | C:/Users/Prairie Rose/Downloads/tutorial-master/server
| ^
at swim.codec/swim.codec.Parser.error(Parser.java:142)
at swim.uri/swim.uri.UriParser.parsePathString(UriParser.java:214)
at swim.uri/swim.uri.UriPath.parse(UriPath.java:314)
at swim.service.web/swim.service.web.WebServer.(WebServer.java:62)
at swim.service.web/swim.service.web.WebService.createServer(WebService.java:118)
at swim.io.http/swim.io.http.HttpSocketService.createSocket(HttpSocketService.java:51)
at swim.io/swim.io.TcpService.doAccept(TcpService.java:117)
at swim.io/swim.io.StationTransport.doAccept(Station.java:453)
at swim.io/swim.io.StationThread.doAccept(Station.java:1079)
at swim.io/swim.io.StationThread.select(Station.java:1005)
at swim.io/swim.io.StationThread.run(Station.java:882)
error: unexpected ' '
--> :1:17

to replicate:

  1. Running on java 9.0.4 on windows
  2. open admin command prompt
  3. navigate to server folder
  4. run "gradlew.bat run"
    when execution gets to 80% error starts occurring.

<==========---> 80% EXECUTING [9m 46s]
--> :1:17
|
1 | C:/Users/Prairie Rose/Downloads/tutorial-master/server
| ^
at swim.codec/swim.codec.Parser.error(Parser.java:142)
at swim.uri/swim.uri.UriParser.parsePathString(UriParser.java:214)
at swim.uri/swim.uri.UriPath.parse(UriPath.java:314)
at swim.service.web/swim.service.web.WebServer.(WebServer.java:62)
at swim.service.web/swim.service.web.WebService.createServer(WebService.java:118)
at swim.io.http/swim.io.http.HttpSocketService.createSocket(HttpSocketService.java:51)
at swim.io/swim.io.TcpService.doAccept(TcpService.java:117)
at swim.io/swim.io.StationTransport.doAccept(Station.java:453)
error: unexpected ' '
--> :1:17 swim.io/swim.io.StationThread.select(Station.java:1005)
|
1 | C:/Users/Prairie Rose/Downloads/tutorial-master/server
| ^
at swim.codec/swim.codec.Parser.error(Parser.java:142)
at swim.uri/swim.uri.UriParser.parsePathString(UriParser.java:214)
at swim.uri/swim.uri.UriPath.parse(UriPath.java:314)
at swim.service.web/swim.service.web.WebServer.(WebServer.java:62)
at swim.service.web/swim.service.web.WebService.createServer(WebService.java:118)
at swim.io.http/swim.io.http.HttpSocketService.createSocket(HttpSocketService.java:51)
at swim.io/swim.io.TcpService.doAccept(TcpService.java:117)rver.java:62)
at swim.io/swim.io.StationTransport.doAccept(Station.java:453)ebService.java:118)
at swim.io/swim.io.StationThread.doAccept(Station.java:1079)HttpSocketService.java:51)
at swim.io/swim.io.StationThread.select(Station.java:1005))
at swim.io/swim.io.StationThread.run(Station.java:882)ava:453)
error: unexpected ' 'im.io.StationThread.doAccept(Station.java:1079)
--> :1:17 swim.io/swim.io.StationThread.select(Station.java:1005)
| at swim.io/swim.io.StationThread.run(Station.java:882)
1 | C:/Users/Prairie Rose/Downloads/tutorial-master/server
| ^
at swim.codec/swim.codec.Parser.error(Parser.java:142)
at swim.uri/swim.uri.UriParser.parsePathString(UriParser.java:214)
at swim.uri/swim.uri.UriPath.parse(UriPath.java:314)
at swim.service.web/swim.service.web.WebServer.(WebServer.java:62)
at swim.service.web/swim.service.web.WebService.createServer(WebService.java:118)
at swim.io.http/swim.io.http.HttpSocketService.createSocket(HttpSocketService.java:51)
at swim.io/swim.io.TcpService.doAccept(TcpService.java:117)rver.java:62)
at swim.io/swim.io.StationTransport.doAccept(Station.java:453)ebService.java:118)
at swim.io/swim.io.StationThread.doAccept(Station.java:1079)HttpSocketService.java:51)
at swim.io/swim.io.StationThread.select(Station.java:1005))
at swim.io/swim.io.StationThread.run(Station.java:882)ava:453)
error: unexpected ' '
--> :1:17
|
1 | C:/Users/Prairie Rose/Downloads/tutorial-master/server
| ^
at swim.codec/swim.codec.Parser.error(Parser.java:142)
at swim.uri/swim.uri.UriParser.parsePathString(UriParser.java:214)
at swim.uri/swim.uri.UriPath.parse(UriPath.java:314)
at swim.service.web/swim.service.web.WebServer.(WebServer.java:62)
at swim.service.web/swim.service.web.WebService.createServer(WebService.java:118)
at swim.io.http/swim.io.http.HttpSocketService.createSocket(HttpSocketService.java:51)
at swim.io/swim.io.TcpService.doAccept(TcpService.java:117)
at swim.io/swim.io.StationTransport.doAccept(Station.java:453)
at swim.io/swim.io.StationThread.doAccept(Station.java:1079)
at swim.io/swim.io.StationThread.select(Station.java:1005)
at swim.io/swim.io.StationThread.run(Station.java:882)
error: unexpected ' '
--> :1:17
|DLE
1 | C:/Users/Prairie Rose/Downloads/tutorial-master/server
| ^
at swim.codec/swim.codec.Parser.error(Parser.java:142)
at swim.uri/swim.uri.UriParser.parsePathString(UriParser.java:214)
at swim.uri/swim.uri.UriPath.parse(UriPath.java:314)
at swim.service.web/swim.service.web.WebServer.(WebServer.java:62)
at swim.service.web/swim.service.web.WebService.createServer(WebService.java:118)
at swim.io.http/swim.io.http.HttpSocketService.createSocket(HttpSocketService.java:51)
at swim.io/swim.io.TcpService.doAccept(TcpService.java:117)
at swim.io/swim.io.StationTransport.doAccept(Station.java:453)
at swim.io/swim.io.StationThread.doAccept(Station.java:1079)
at swim.io/swim.io.StationThread.select(Station.java:1005)
at swim.io/swim.io.StationThread.run(Station.java:882)
<==========---> 80% EXECUTING [12m 59s] > IDLE

:run
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE
IDLE

Exercise more capabilities of Swim in the tutorial application

  • Introduce an exercise to the reader to update swim.tutorial.DataSource to write to more Agents than just /unit/master. Edit the README in server accordingly.

  • Introduce an exercise to the reader to create a stats value lane in swim.tutorial.UnitAgent that is populated by changes to histogram. Maybe suggest something that follows this skeleton. Edit the README in server accordingly.

  • Since the data entries in histogram are pretty boring, maybe enhance them with some measure of central tendency (e.g. mean/median) and some measure of spread (e.g. range; stdev/variance might be harder with streaming inputs but it seems doable?) Will leave this decision to @Crista2019 ; have fun with it!

  • Include solutions to a new branch (or branches, if you prefer that).

  • In the READMEs, ask how one might change the UI code to accommodate for these server-side changes.

Create a docker container and post on dockerhub

User Story
As a developer, I would like to run all of the demos so that I can get started quickly.

Acceptance Criteria

  1. Each repo contains a Dockerfile and docker-compose.yaml to run it
  2. merges to master are published on docker-hub with instructions so we can run quickly

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.