Creating Algorithms for Computes
We sent out another batch of 100 license keys for the new Computes mesh computer beta release! Congratulations! You’ve gone through our Fibonacci example and now you’re ready to write and run your very own algorithm on our new decentralized and distributed supercomputing platform.
Let’s start by modifying the Fibonacci example by making it echo back the input as output. You can start by cloning the Fibonacci example by running
git clone git@github.com:computes/fibonacci-sum-split.git
Open main.go and replace it with the following code. (note: only a few lines were changed starting at line #20 to add the input string to a JSON object to render as the output.
You can compile these changes locally by running go build
and then test them by running:
echo “ping” | ./fibonacci-sum-split
This should result in:
{“Pong”:”ping”}
Now you are ready to create your very own Docker container to run this algorithm on Computes. You can do this by running:
docker build -t local/helloworld .
That’s it…now you are ready to go back to the First Task instructions and update the input and docker image parameters in the split-task.json step as follows:
Manually re-run the steps under First Task or update the automated demo script from our Supercomputing in Seconds post. You should receive the following result from Computes!
{“split”:{“results”:{“Pong”:”\”ping\””}},”taskEvents”:{“tasks”:[“zdpuB18bmS2kXCN3UAvfPwA1bVA9CQn6Y5oZm3mJAk5KANiEv”]},”uuid”:”d0d7ef54-fb9e-481e-9713–4bb6c1290c0b”}
Congratulations!!! You’re now on your way to hacking the gibson! Here’s a short video of these steps in action.
As you have probably already surmised, Computes can run both serial machine learning algorithms (chained tasks) as well as massively parallel algorithms written in any programming language via Docker containers.
Stay tuned to this blog for more exciting information about our new technology stack and development progress! You can also reach us on Twitter, Facebook, and GitHub.