Giter Club home page Giter Club logo

lilypad-module-boilerplate's Introduction

Lilypad Module Boiler Template

This is the basic template needed to create a module for the Lilypad network.

For more information on building modules, see the docs on build a job module

lilypad_module.json.tmpl

{
  "machine": {
    "gpu": 0,
    "cpu": 1000,
    "ram": 100
  },
  "job": {
    "APIVersion": "V1beta1",
    "Spec": {
      "Deal": {
        "Concurrency": 1
      },
      "Docker": {
        "Entrypoint": [
          "/bin/sh",
          "-c",
          "/usr/app/run \"$MESSAGE\""
        ],
        "EnvironmentVariables": [
          {{ if .Message }}"{{ subst "MESSAGE=%s" .Message }}"{{else}}"Message=Hello World"{{ end }}
        ],
        "Image": "dockerhubuser/image:tagversion@sha256:hash"
      },
      "Engine": "Docker",
      "Network": {
        "Type": "None"
      },
      "PublisherSpec": {
        "Type": "IPFS"
      },
      "Resources": {
        "GPU": ""
      },
      "Timeout": 1800,
      "Verifier": "Noop"
    }
  }
}

Template Components

  • APIVersion: Specifies the API version for the job.
  • Spec: Contains the detailed job specifications.
  • Deal: Sets the concurrency to 1, ensuring only one job instance runs at a time.
  • Docker: Configures the Docker container for the job
  • Entrypoint: Defines the command(s) to be executed in the container as part of its initial startup runtime.
  • EnvironmentVariables: This can be utilised to set env vars for the containers runtime, in the example above we use Go templating to set the MESSAGE variable dynamically from the CLI.
  • Image: Specifies the image to be used (lilypadnetwork/lilysay:0.0.6), Its important to note to reference the SHA256 hash if you are using Docker.
  • Engine: In our example we are using Docker as the container runtime.
  • Network: Specifies that the container does not require networking (Type: "None").
  • PublisherSpec: Sets the method for publishing job results to IPFS.
  • Resources: Indicates no additional GPU resources are needed (GPU: ""). As this is a very light job so does not need intensive processing.
  • Timeout: Sets the maximum duration for the job to 300 seconds (5 minutes).
  • Verifier: Specifies "Noop" as the verification method, meaning no verification is performed.

lilypad-module-boilerplate's People

Contributors

developersteve avatar

Watchers

 avatar Gorka Ludlow avatar Alison Haire avatar

lilypad-module-boilerplate's Issues

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.