haskell-distributed / cloud-haskell Goto Github PK
View Code? Open in Web Editor NEWThis is an umbrella development repository for Cloud Haskell
Home Page: http://haskell-distributed.github.com
License: BSD 3-Clause "New" or "Revised" License
This is an umbrella development repository for Cloud Haskell
Home Page: http://haskell-distributed.github.com
License: BSD 3-Clause "New" or "Revised" License
Forgive me if I sound completely wonky; I'm new to this.
I'm trying to build with stack, and I get a plan construction failed error due to the build requiring an unattainable base version.
Can you please help? Is this, at all, due to [this]? (https://travis-ci.org/github/haskell-distributed/cloud-haskell)
Error: While constructing the build plan, the following exceptions were encountered:
In the dependencies for cloud-haskell-0.3.0.0:
distributed-process-0.7.0 from stack configuration does not match ==0.6.* (latest matching version is 0.6.6)
network-transport-0.5.2 from stack configuration does not match ==0.4.* (latest matching version is 0.4.4.0)
needed since cloud-haskell is a build target.
In the dependencies for distributed-process-async-0.2.3:
binary-0.8.3.0 from stack configuration does not match >=0.6.3.0 && <0.8 (latest matching version is 0.7.6.1)
distributed-process-0.7.0 from stack configuration does not match >=0.5.3 && <0.7 (latest matching version is 0.6.6)
time-1.6.0.1 from stack configuration does not match >1.4 && <1.6 (latest matching version is 1.5.0.1)
needed since distributed-process-async is a build target.
In the dependencies for distributed-process-client-server-0.1.3.2:
binary-0.8.3.0 from stack configuration does not match >=0.6.3.0 && <0.8 (latest matching version is 0.7.6.1)
distributed-process-0.7.0 from stack configuration does not match >=0.5.2 && <0.7 (latest matching version is 0.6.6)
time-1.6.0.1 from stack configuration does not match >1.4 && <1.6 (latest matching version is 1.5.0.1)
needed since distributed-process-client-server is a build target.
In the dependencies for distributed-process-demos-0.1.0.0(-use-azure):
binary-0.8.3.0 from stack configuration does not match >=0.5 && <0.8 (latest matching version is 0.7.6.1)
needed since distributed-process-demos is a build target.
In the dependencies for distributed-process-execution-0.1.2.2:
binary-0.8.3.0 from stack configuration does not match >=0.6.3.0 && <0.8 (latest matching version is 0.7.6.1)
distributed-process-0.7.0 from stack configuration does not match >=0.5.3 && <0.7 (latest matching version is 0.6.6)
time-1.6.0.1 from stack configuration does not match >1.4 && <1.6 (latest matching version is 1.5.0.1)
needed since distributed-process-execution is a build target.
In the dependencies for distributed-process-extras-0.2.1.2:
binary-0.8.3.0 from stack configuration does not match >=0.6.3.0 && <0.8 (latest matching version is 0.7.6.1)
distributed-process-0.7.0 from stack configuration does not match >=0.5.3 && <0.7 (latest matching version is 0.6.6)
time-1.6.0.1 from stack configuration does not match >1.4 && <1.6 (latest matching version is 1.5.0.1)
needed since distributed-process-extras is a build target.
In the dependencies for distributed-process-registry-0.1.0.2:
binary-0.8.3.0 from stack configuration does not match >=0.6.3.0 && <0.8 (latest matching version is 0.7.6.1)
distributed-process-0.7.0 from stack configuration does not match >=0.5.3 && <0.7 (latest matching version is 0.6.6)
time-1.6.0.1 from stack configuration does not match >1.4 && <1.6 (latest matching version is 1.5.0.1)
needed since distributed-process-registry is a build target.
In the dependencies for distributed-process-simplelocalnet-0.2.3.2:
binary-0.8.3.0 from stack configuration does not match >=0.6.3 && <0.8 (latest matching version is 0.7.6.1)
distributed-process-0.7.0 from stack configuration does not match >=0.5.0 && <0.7 (latest matching version is 0.6.6)
network-multicast-0.2.0 from stack configuration does not match >=0.0 && <0.2 (latest matching version is 0.1.2)
network-transport-0.5.2 from stack configuration does not match >=0.4.1.0 && <0.5 (latest matching version is 0.4.4.0)
network-transport-tcp-0.6.0 from stack configuration does not match >=0.4 && <0.6 (latest matching version is 0.5.1)
transformers-0.5.2.0 from stack configuration does not match >=0.2 && <0.5 (latest matching version is 0.4.3.0)
needed since distributed-process-simplelocalnet is a build target.
In the dependencies for distributed-process-supervisor-0.1.3.2:
binary-0.8.3.0 from stack configuration does not match >=0.6.3.0 && <0.8 (latest matching version is 0.7.6.1)
distributed-process-0.7.0 from stack configuration does not match >=0.5.3 && <0.7 (latest matching version is 0.6.6)
time-1.6.0.1 from stack configuration does not match >1.4 && <1.6 (latest matching version is 1.5.0.1)
needed since distributed-process-supervisor is a build target.
In the dependencies for distributed-process-task-0.1.2.2:
binary-0.8.3.0 from stack configuration does not match >=0.6.3.0 && <0.8 (latest matching version is 0.7.6.1)
distributed-process-0.7.0 from stack configuration does not match >=0.5.3 && <0.7 (latest matching version is 0.6.6)
time-1.6.0.1 from stack configuration does not match >1.4 && <1.6 (latest matching version is 1.5.0.1)
needed since distributed-process-task is a build target.
In the dependencies for network-transport-benchmarks-0.0.0.1:
base-4.9.1.0 from stack configuration does not match >=4.8 && <4.9 (latest matching version is 4.8.2.0)
needed since network-transport-benchmarks is a build target.
In the dependencies for network-transport-composed-0.2.0.1:
network-transport-0.5.2 from stack configuration does not match >=0.4.0.0 && <0.5 (latest matching version is 0.4.4.0)
needed since network-transport-composed is a build target.
Some different approaches to resolving this:
* Set 'allow-newer: true' in /home/d/.stack/config.yaml to ignore all version constraints and build anyway.
* Build requires unattainable version of base. Since base is a part of GHC, you most likely need to use a different GHC version
with the matching base.
Plan construction failed.
Many packages still mention the old issue tracker in their readme. We should replace that boilerplate with the below:
This repository is part of Cloud Haskell.
See http://haskell-distributed.github.com for documentation, user guides,
tutorials and assistance.
## Getting Help / Raising Issues
Please visit the [bug tracker](../../issues) to submit issues. You can contact the [email protected] mailing list for help and comments.
## License
This package is made available under a 3-clause BSD-style license.
While we're at it, fixup the header to read something like:
# distributed-process
[![travis](https://secure.travis-ci.org/haskell-distributed/distributed-process.png)](http://travis-ci.org/haskell-distributed/distributed-process)
![Release](https://img.shields.io/hackage/v/distributed-process.svg)
That is, badges below title, not on same line, and badge line includes Hackage release number.
@facundominguez @qnikst - any objections to this idea (below)?
I am thinking about using this repository to create an integration build, that can be run either in a pipeline (which would mean moving to a different CI provider, since travis doesn't really support build pipelines) or scheduling to run daily.
The idea is that we create an integration testing project, which executes a much broader range of cloud haskell libraries against a much broader set of use cases. A set of stack-X.yaml
configurations can pull in the very latest of a matrix of our dependencies, and test accordingly. This would allow us to verify multiple configurations of things that are not limited to distributed-process
, but could also pull in and utilise stuff like simplelocalnet
, multiple alternative network-transport
implementations (e.g., 0MQ, named pipes, CCI, etc), exercise some of the platform libraries like d-p-task
, d-p-execution
, d-p-supervisor
, and so on.
We could also use this capability to exercise tests that run multiple executables.
I will do some further investigation on various CI provider options, and post back my findings.
I am happy to update the tutorial as I work through it but I don't want to spend effort if it isn't going to be accepted.
I am thinking of removing the section on stack
. I couldn't get stack to behave
~/Dropbox/Private/CloudHaskell $ stack build
While constructing the BuildPlan the following exceptions were encountered:
-- Failure when adding dependencies:
distributed-process: needed (-any), latest is 0.5.5, but not present in build plan
network-transport-tcp: needed (-any), latest is 0.4.2, but not present in build plan
needed for package: CloudHaskell-0.1.0.0
-- While attempting to add dependency,
Could not find package distributed-process in known packages
-- While attempting to add dependency,
Could not find package network-transport-tcp in known packages
Recommended action: try adding the following to your extra-deps in /Users/dom/Dropbox/Private/CloudHaskell/stack.yaml
- distributed-process-0.5.5
- network-transport-tcp-0.4.2
You may also want to try the 'stack solver' command
But using cabal
did work. I'd suggest just saying something like, "you will need to have the packages distributed-process
and network-transport-tcp
" available using stack
or cabal
"
For example, binary has a different specified lower bound in the NT packages than it does in the DP ones, which leads to double compilation. We need to vet all the dependencies to ensure this goes away.
Hello,
I'm looking for advice on how to turn my single-player local game into an online multiplayer cooperative game, using cloud-haskell for networking:
In this game, each player controls a ship, and can fire a laser from that ship.
So Client
nodes will send player events to the server
node, and the server
will periodically send game updates to the clients
.
Are there some real-world examples, or tutorials that I could look at for inspiration?
My thinking sofar is to do something like in ChatClient.hs ChatServer.hs to "connect" the client to the server, and then use typed channels to transfer player events and game updates between them. In case I am missing an important aspect, please tell me!
Thank you :)
[Imported from JIRA. Reported by Facundo Dominguez @facundominguez) as CH-5 on 2013-04-18 01:52:49]
Taken from: https://cloud-haskell.atlassian.net/browse/CH-5
At work we had a discussion about whether it was possible to serialize existential types like
data Foo = forall a. Serializable a => Foo
This may be relevant for Cloud Haskell. On one hand values need to have a type which is Serializable
in order to be sent, and on the other hand an alternative implementation of the Closure
type would be possible.
In http://hpaste.org/85654 and also pasted below, I'm submitting a solution. It uses a table to look up "get" methods of Binary instances by Typeable
fingerprint.
If the remote tables of Cloud Haskell included the appropriate "get" methods, perhaps it would be possible to define Closure
as
data Closure b = forall a. Closure (Static (a -> b)) a
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE ScopedTypeVariables #-}
import Control.Distributed.Process.Serializable
( fingerprint, Serializable, encodeFingerprint, decodeFingerprint )
import Data.Binary
import Data.Map ( Map, fromList, lookup )
import Data.Typeable ( Typeable(typeOf), cast )
import Data.Typeable.Internal ( TypeRep(TypeRep) )
import GHC.Fingerprint ( Fingerprint(Fingerprint) )
data Foo = forall a. Serializable a => Foo a
stable :: Map Fingerprint SomeGet
stable = fromList
[ (mkSMapEntry (undefined :: Bool))
, (mkSMapEntry (undefined :: [Int]))
]
data SomeGet = forall a. Serializable a => SomeGet (Get a)
mkSMapEntry :: forall a. Serializable a => a -> (Fingerprint,SomeGet)
mkSMapEntry a = (fingerprint a,SomeGet (get :: Get a))
instance Binary Foo where
put (Foo a) = put (encodeFingerprint$ fingerprint a) >> put a
get = do
fp<-get
case Data.Map.lookup (decodeFingerprint fp) stable of
Just (SomeGet someget) -> fmap Foo someget
Nothing -> error "Binary Foo: fingerprint unknown"
main = case decode$ encode$ Foo xs of
Foo xs'-> case cast xs' of
Just xs'' -> print$ xs'' == xs
where
xs = [ 2 :: Int ]
cabal install distributed-process-simplelocalnet-0.2.3.0
cabal install distributed-process-0.5.5
cabal install distributed-static-0.3.2.0
cabal install network-transport-tcp-0.4.2
cabal install network-transport-0.4.0.2 -- can not install
cabal install rank1dynamic-0.3.1.0
cabal install cloud-haskell-0.2.2.0
i use the Main.hs code in
http://haskell-distributed.github.io/tutorials/1ch.html#creating-a-node
import Control.Concurrent (threadDelay)
import Control.Monad (forever)
import Control.Distributed.Process
import Control.Distributed.Process.Node
import Network.Transport.TCP (createTransport, defaultTCPParameters)
replyBack :: (ProcessId, String) -> Process ()
replyBack (sender, msg) = send sender msg
logMessage :: String -> Process ()
logMessage msg = say $ "handling " ++ msg
main :: IO ()
main = do
Right t <- createTransport "127.0.0.1" "10501" defaultTCPParameters
node <- newLocalNode t initRemoteTable
runProcess node $ do
-- Spawn another worker on the local node
echoPid <- spawnLocal $ forever $ do
-- Test our matches in order against each message in the queue
receiveWait [match logMessage, match replyBack]
-- The `say` function sends a message to a process registered as "logger".
-- By default, this process simply loops through its mailbox and sends
-- any received log message strings it finds to stderr.
say "send some messages!"
send echoPid "hello"
self <- getSelfPid
send echoPid (self, "hello")
-- `expectTimeout` waits for a message or times out after "delay"
m <- expectTimeout 1000000
case m of
-- Die immediately - throws a ProcessExitException with the given reason.
Nothing -> die "nothing came back!"
Just s -> say $ "got " ++ s ++ " back!"
root@ubuntu:/cluster# ls/cluster# stack build
app cluster.cabal LICENSE Setup.hs src stack.yaml test
root@ubuntu:
[1 of 1] Compiling Main ( /tmp/stack21101/Setup.hs, /tmp/stack21101/Setup.o )
Linking /root/.stack/setup-exe-cache/x86_64-linux/tmp-setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 ...
cluster-0.1.0.0: configure
Configuring cluster-0.1.0.0...
cluster-0.1.0.0: build
Preprocessing library cluster-0.1.0.0...
[1 of 1] Compiling Lib ( src/Lib.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Lib.o )
In-place registering cluster-0.1.0.0...
Preprocessing executable 'cluster-exe' for cluster-0.1.0.0...
/root/cluster/app/Main.hs:3:8:
Could not find module ‘Control.Distributed.Process’
Use -v to see a list of the files searched for.
/root/cluster/app/Main.hs:4:8:
Could not find module ‘Control.Distributed.Process.Node’
Use -v to see a list of the files searched for.
/root/cluster/app/Main.hs:5:8:
Could not find module ‘Network.Transport.TCP’
Use -v to see a list of the files searched for.
-- While building package cluster-0.1.0.0 using:
/root/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.5.0 build lib:cluster exe:cluster-exe --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
I personally don't, what do you think @facundominguez, @mboes, @qnikst ?
Could not find module `Control.Distributed.Process.Node'
Use -v to see a list of the files searched for.
root@ubuntu:/home/martin/Downloads# cabal install cloud-haskell-0.2.2.0
Resolving dependencies...
cabal: Could not resolve dependencies:
next goal: cloud-haskell (user goal)
rejecting: cloud-haskell-0.2.0.0, 0.0.1.0 (global constraint requires
==0.2.2.0)
Dependency tree exhaustively searched.
root@ubuntu:/home/martin/Downloads# cabal install cloud-haskell-0.2.0.0
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: cloud-haskell-0.2.0.0 (user goal)
trying: distributed-process-execution-0.1.2.2 (dependency of
cloud-haskell-0.2.0.0)
trying: time-1.5.0.1/installed-654... (dependency of
distributed-process-execution-0.1.2.2)
trying: hashable-1.2.1.0/installed-a53... (dependency of
distributed-process-execution-0.1.2.2)
next goal: text (dependency of hashable-1.2.1.0/installed-a53...)
rejecting: text-0.11.3.1/installed-f9a... (conflict: time =>
deepseq==1.4.2.0/installed-35c..., text => deepseq==1.3.0.1/installed-aa1...)
rejecting: text-1.2.2.1, 1.2.2.0, 1.2.1.3, 1.2.1.2, 1.2.1.1, 1.2.1.0, 1.2.0.6,
1.2.0.5, 1.2.0.4, 1.2.0.3, 1.2.0.2, 1.2.0.0, 1.1.1.4, 1.1.1.3, 1.1.1.2,
1.1.1.1, 1.1.1.0, 1.1.0.1, 1.1.0.0, 1.0.0.1, 1.0.0.0, 0.11.3.1, 0.11.3.0,
0.11.2.3, 0.11.2.2, 0.11.2.1, 0.11.2.0, 0.11.1.13, 0.11.1.12, 0.11.1.11,
0.11.1.10, 0.11.1.9, 0.11.1.8, 0.11.1.7, 0.11.1.6, 0.11.1.5, 0.11.1.3,
0.11.1.2, 0.11.1.1, 0.11.1.0, 0.11.0.8, 0.11.0.7, 0.11.0.6, 0.11.0.5,
0.11.0.4, 0.11.0.3, 0.11.0.2, 0.11.0.1, 0.11.0.0, 0.10.0.2, 0.10.0.1,
0.10.0.0, 0.9.1.0, 0.9.0.1, 0.9.0.0, 0.8.1.0, 0.8.0.0, 0.7.2.1, 0.7.1.0,
0.7.0.1, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1 (conflict: hashable =>
text==0.11.3.1/installed-f9a...)
Dependency tree exhaustively searched.
root@ubuntu:/home/martin/Downloads# cabal install cloud-haskell-0.2.2.0
Resolving dependencies...
cabal: Could not resolve dependencies:
next goal: cloud-haskell (user goal)
rejecting: cloud-haskell-0.2.0.0, 0.0.1.0 (global constraint requires
==0.2.2.0)
Dependency tree exhaustively searched.
root@ubuntu:/home/martin/Downloads#
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.