Giter VIP home page Giter VIP logo

sedflix / sadlydistributed Goto Github PK

View Code? Open in Web Editor NEW
23.0 5.0 4.0 919 KB

Distributing your code(soul), in almost any language(state), among a cluster of idle browsers(voids)

License: GNU General Public License v3.0

Makefile 0.12% HTML 0.26% Go 5.74% JavaScript 93.18% Python 0.26% C++ 0.14% Dockerfile 0.31%
distributed-computing volunteer-computing golang websockets javascript webassembly

sadlydistributed's Introduction

SadlyDistributed

Making volunteer computing easy af.
Zero Setup for volunteers. Easy for developers.

We compile your distributed code in almost any language to WebAssembly and then all of it is executed in a cluster of browsers. Anyone who just opens our website in their browser will share his or her computing power with us.

Motivation

We are aware of the amazing computing power of our laptops and phones. What if the scientist around the world would be able to use it when its lying idl(which is most of the time)? What if everyone with a computing device, a browser, and a decent internet connection would be able to contribute to such amazing research happening around the world? Today's world is a sucker for computing resources. ML, AR, VR, Blockchain and tons of other cutting edge tech require tons of computing resources.

There are several nice volunteer computing platform like BONIC, GridCoin, etc. But all of them suffer from a common problem: complex and heavy installation process. Even I, as a techie, hesitate to go through all that hassle. You know setting up anything sucks. Therefore, we came up with SadlyDistributed.

Installation

We <3 Docker. Hence, we have provided a Dockerfile that takes care of all the dependencies of our server code.

Building Docker file

    docker build -t sadlyDistributed .

Running our Server(with Prime Number Example)

    docker run -it -p 8899:8899 sadlyDistributed

Mini-Tutorial

How can you modify your distributed code for our architecture?

We have an example program for finding if a number(it can be as large as you can think of) is prime or not.
Code: /client/programs/1

In general distributed computer, same code is replicated on multiple machines and each machine execute the code over a different range of values(or parameters). The output from multiple machines is combined to produce the final output. Your job, as developer, is to give us your pre-existing distributed code, in almost any language. The code should take input from stdin and gives output to stdout. After that, you need to define how the range of values should be divided and how the results from them should be combined to produce the final answer. After you have defined this logic, we scale your code to all the browsers available to us.

You code interface with our architecture by reading and writing from files. We have two files:

input

You specify the parameters that your code will take in. Each parameters is present in a new line. Our prime number uses the following format:

1 110000
110000 9990000
9990000 99900000
99900000 99900000
<number 1><space><number 2>

Note that our distributed code, bigprimes.go, is written to understand these range. In other words, go run bigprimes.go 110000 9990000 will tell us weather our hardcoded number is divisible by anything between 110000 and 9990000. Our architecture read this file continuously(as new input arrives or so called tail reading) and distributes the parameters over free nodes.

output

Our architecture writes the stdout(or output) received from various machine to this file. Now it is upto you to utilize the info in this file for combining the result. Our prime number used the following format:

1 110000    false
99900000 99900000   false
110000 9990000  false
<parameter><tab><output>

The parameter is same as specified in the input file. And the output is what your code wrote to stdout when given those parameters. Our architecture updates this file as it receives output from different browsers.

In our prime number example, we use two file in two different language to show how our approach is language-agnostic. We have used GoLang for the code that needs to be distributed. And we have used python for generating inputs and combining the output. Neat, right?

sadlydistributed's People

Contributors

peey avatar sedflix 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

Watchers

 avatar  avatar  avatar  avatar  avatar

sadlydistributed's Issues

Can i get a detailed description on how to run this repo?

After performing the steps in readme.. the
cd client/programs/1/ && GOOS=js GOARCH=wasm go build -o main.wasm
is outputted and the container stops running..and no output at localhost:8899

PS C:\Users\Home\Desktop\sadlydistributed> docker build -t sadlydistributed .
Sending build context to Docker daemon  4.415MB
Step 1/8 : FROM golang:1.11
 ---> 43a154fee764
Step 2/8 : RUN apt-get update
 ---> Using cache
 ---> fee378167db8
Step 3/8 : RUN apt-get install -y python3
 ---> Running in ffda80b64792
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  libmpdec2 libpython3-stdlib libpython3.7-minimal libpython3.7-stdlib
  python3-minimal python3.7 python3.7-minimal
Suggested packages:
  python3-doc python3-tk python3-venv python3.7-venv python3.7-doc
  binfmt-support
The following NEW packages will be installed:
  libmpdec2 libpython3-stdlib libpython3.7-minimal libpython3.7-stdlib python3
  python3-minimal python3.7 python3.7-minimal
0 upgraded, 8 newly installed, 0 to remove and 33 not upgraded.
Need to get 4591 kB of archives.
After this operation, 23.2 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 libpython3.7-minimal amd64 3.7.3-2 [588 kB]
Get:2 http://deb.debian.org/debian buster/main amd64 python3.7-minimal amd64 3.7.3-2 [1736 kB]
Get:3 http://deb.debian.org/debian buster/main amd64 python3-minimal amd64 3.7.3-1 [36.6 kB]
Get:4 http://deb.debian.org/debian buster/main amd64 libmpdec2 amd64 2.4.2-2 [87.2 kB]
Get:5 http://deb.debian.org/debian buster/main amd64 libpython3.7-stdlib amd64 3.7.3-2 [1732 kB]
Get:6 http://deb.debian.org/debian buster/main amd64 python3.7 amd64 3.7.3-2 [330 kB]
Get:7 http://deb.debian.org/debian buster/main amd64 libpython3-stdlib amd64 3.7.3-1 [20.0 kB]
Get:8 http://deb.debian.org/debian buster/main amd64 python3 amd64 3.7.3-1 [61.5 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 4591 kB in 2s (2131 kB/s)
Selecting previously unselected package libpython3.7-minimal:amd64.
(Reading database ... 15394 files and directories currently installed.)
Preparing to unpack .../libpython3.7-minimal_3.7.3-2_amd64.deb ...
Unpacking libpython3.7-minimal:amd64 (3.7.3-2) ...
Selecting previously unselected package python3.7-minimal.
Preparing to unpack .../python3.7-minimal_3.7.3-2_amd64.deb ...
Unpacking python3.7-minimal (3.7.3-2) ...
Setting up libpython3.7-minimal:amd64 (3.7.3-2) ...
Setting up python3.7-minimal (3.7.3-2) ...
Selecting previously unselected package python3-minimal.
(Reading database ... 15634 files and directories currently installed.)
Preparing to unpack .../python3-minimal_3.7.3-1_amd64.deb ...
Unpacking python3-minimal (3.7.3-1) ...
Selecting previously unselected package libmpdec2:amd64.
Preparing to unpack .../libmpdec2_2.4.2-2_amd64.deb ...
Unpacking libmpdec2:amd64 (2.4.2-2) ...
Selecting previously unselected package libpython3.7-stdlib:amd64.
Preparing to unpack .../libpython3.7-stdlib_3.7.3-2_amd64.deb ...
Unpacking libpython3.7-stdlib:amd64 (3.7.3-2) ...
Selecting previously unselected package python3.7.
Preparing to unpack .../python3.7_3.7.3-2_amd64.deb ...
Unpacking python3.7 (3.7.3-2) ...
Selecting previously unselected package libpython3-stdlib:amd64.
Preparing to unpack .../libpython3-stdlib_3.7.3-1_amd64.deb ...
Unpacking libpython3-stdlib:amd64 (3.7.3-1) ...
Setting up python3-minimal (3.7.3-1) ...
Selecting previously unselected package python3.
(Reading database ... 16046 files and directories currently installed.)
Preparing to unpack .../python3_3.7.3-1_amd64.deb ...
Unpacking python3 (3.7.3-1) ...
Setting up libmpdec2:amd64 (2.4.2-2) ...
Setting up libpython3.7-stdlib:amd64 (3.7.3-2) ...
Setting up libpython3-stdlib:amd64 (3.7.3-1) ...
Setting up python3.7 (3.7.3-2) ...
Setting up python3 (3.7.3-1) ...
running python rtupdate hooks for python3.7...
running python post-rtupdate hooks for python3.7...
Processing triggers for libc-bin (2.28-10) ...
Processing triggers for mime-support (3.62) ...
Removing intermediate container ffda80b64792
 ---> 4cc69003631e
Step 4/8 : RUN go get github.com/hpcloud/tail
 ---> Running in d43ebc2ee0bd
Removing intermediate container d43ebc2ee0bd
 ---> a370b3d7a326
Step 5/8 : RUN go get github.com/rsms/gotalk
 ---> Running in 40162f60fc79
Removing intermediate container 40162f60fc79
 ---> 5e1dd8da6143
Step 6/8 : WORKDIR $GOPATH/src/github.com/sedflix/SadlyDistributed/
 ---> Running in d14c2810ac3a
Removing intermediate container d14c2810ac3a
 ---> e5a010b582cb
Step 7/8 : COPY . $GOPATH/src/github.com/sedflix/SadlyDistributed/
 ---> 47939b3bee8c
Step 8/8 : CMD ["make", "wasm"]
 ---> Running in a579ccaaa800
Removing intermediate container a579ccaaa800
 ---> be585fcc9e5c
Successfully built be585fcc9e5c
Successfully tagged sadlydistributed:latest
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
PS C:\Users\Home\Desktop\sadlydistributed> docker run -it -p 8899:8899 sadlydistributed
cd client/programs/1/ && GOOS=js GOARCH=wasm go build -o main.wasm
PS C:\Users\Home\Desktop\sadlydistributed>

License file?

Hi, I want to fork and play with this as I am not having any luck with the docker build. Can you provide a license file so that I can understand the consequences of doing so?

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.