Coder Social home page Coder Social logo

luisccastillo / gimpfu-iexec Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 20 KB

iExec decentralized application for distributing the computation of gimp's batch mode image processing.

License: GNU General Public License v3.0

Dockerfile 33.32% Python 66.68%
off-chain dapp

gimpfu-iexec's Introduction

gimpfu-iexec

Distributed gimpfu execution

before

after

This application leverages gimp's batch mode in order to apply a set of effects on multiple images. The computational processing can be negociated with iExec workers.

Prerequisites

Please refer to the iExec documentation

Running locally

For more visually appealing results, use higher quality images.

Create your input and output folders, then pass them as a parameters in your docker run :

docker build . --tag gimpfu-iexec
docker run --rm -v /home/user/iexec_in:/iexec_in -v /home/user/iexec_out:/iexec_out -e IEXEC_IN=/iexec_in -e IEXEC_OUT=/iexec_out gimpfu-iexec

The result can be found in $IEXEC_OUT

Running with iExec

For distributed execution testing purposes, use low quality images.

This section assumes you have:

  • Created and filled your wallet with ETH + RLC
  • Configured your API keys and chain configuration files (chain.json)
  • Deployed your docker image to Docker Hub
  • Deployed your application to iExec

Please refer to the quickstart guide to perform the necessary steps.

Executing in the goerli testnet :

iexec app run --watch --input-files <image url 1>,<image url 2> --chain goerli --workerpool <address>

Additional running options can be found here.

You'll find below a minimalistic version of the configuration files :

chain.json
{
  "default": "goerli",
  "chains": {
    "goerli": {
      "id": "5"
    }
  },
  "providers": {
    "infura": {
      "projectId": "<infura_projet_id>",
      "projectSecret": "<infura_projet_secret>"
    },
    "quorum": 1
  }
}
iexec.json
{
  "app": {
    "owner": "<your_ethereum_wallet_address>",
    "name": "gimpfu-iexec",
    "type": "DOCKER",
    "multiaddr": "registry.hub.docker.com/<docker_username>/<docker_image_name>:<docker_image_version>",
    "checksum": "<docker_image_checksum>",
    "mrenclave": ""
  }
}
Fetching results
iexec task show <task_id> --download my-app-result --chain goerli && unzip my-app-result.zip -d my-app-result

You can also download your results using the iExec explorer.


The tunnel

The following video was made using this gimpfu script in order to process more than 80 files with 4k resolution: https://vimeo.com/490181629

gimpfu-iexec's People

Watchers

 avatar

gimpfu-iexec's Issues

consensus file is missing

Hello, you need to create a consensus file and define the path to reach this consensus file
without this consensus, your task will remain unsuccessful because the protocol needs it to complete the task

More info
https://docs.iex.ec/for-developers/your-first-app#application-outputs

Add in you app the /iexec_out/computed.json and /iexec_out/result.txt
Dont forget to put all execution outputs into /iexec_out/ , otherwise you won't get the expected result
ex:
// Put something deterministic in result file, for testing the word "OK" is good
#Append some results in /iexec_out/
text="ok";
with open(iexec_out + '/result.txt', 'w+') as fout:
fout.write(text)

#Declare everything is computed
with open(iexec_out + '/computed.json', 'w+') as f:
json.dump({ "deterministic-output-path" : iexec_out + '/result.txt' }, f)

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.