Coder Social home page Coder Social logo

nextflow-io / nf-nomad Goto Github PK

View Code? Open in Web Editor NEW
1.0 4.0 2.0 394 KB

[WIP] Hashicorp Nomad executor plugin for Nextflow

Home Page: https://nextflow-io.github.io/nf-nomad/

License: Apache License 2.0

Shell 0.43% Groovy 93.55% Makefile 1.09% HCL 4.93%

nf-nomad's Introduction

nf-nomad plugin

This plugin implements a Nextflow executor for Hashicorp Nomad.

Maintainers

Please note that this is a community contributed plugin and is a collaboration between

  1. Abhinav Sharma (@abhi18av) as part of his PhD work at the Stellenbosch University and Jorge Aguilera (@jagedn) as a contributor from Evaluacion y desarrollo de negocios, Spain.
  2. Tomas (@tomiles) and his team from Center For Medical Genetics Ghent, Belgium.

The contribution roles during the development of initial plugin and testing along with the long term commitments have been discussed in development and infrastructure group.

Feel free to reach out to us on the #platform-nomad channel on Slack for discussions and feedbacks.

Plugin Assets

  • settings.gradle

    Gradle project settings.

  • plugins/nf-nomad

    The plugin implementation base directory.

  • plugins/nf-nomad/build.gradle

    Plugin Gradle build file. Project dependencies should be added here.

  • plugins/nf-nomad/src/resources/META-INF/MANIFEST.MF

    Manifest file defining the plugin attributes e.g. name, version, etc. The attribute Plugin-Class declares the plugin main class. This class should extend the base class nextflow.plugin.BasePlugin e.g. nextflow.Nomad.NomadPlugin.

  • plugins/nf-nomad/src/resources/META-INF/extensions.idx

    This file declares one or more extension classes provided by the plugin. Each line should contain the fully qualified name of a Java class that implements the org.pf4j.ExtensionPoint interface (or a sub-interface).

  • plugins/nf-nomad/src/main

    The plugin implementation sources.

  • plugins/nf-nomad/src/test

    The plugin unit tests.

ExtensionPoints

ExtensionPoint is the basic interface which uses nextflow-core to integrate plugins into it. It's only a basic interface and serves as starting point for more specialized extensions.

Unit testing

Run the following command in the project root directory (ie. where the file settings.gradle is located):

./gradlew check

Testing and debugging

To run and test the plugin in a development environment, configure a local Nextflow build with the following steps:

  1. Clone the Nextflow repository in your computer into a sibling directory:

    git clone --depth 1 https://github.com/nextflow-io/nextflow _resources/nextflow
  2. Generate the nextflow class path

    cd _resources/nextflow && ./gradlew exportClasspath
  3. Compile the plugin alongside the Nextflow code:

    cd ../../ && ./gradlew compileGroovy
  4. Run Nextflow with the plugin, using ./launch.sh as a drop-in replacement for the nextflow command, and adding the option -plugins nf-nomad to load the plugin:

    ./launch.sh run main.nf -plugins nf-nomad

Package, upload and publish

The project should be hosted in a GitHub repository whose name should match the name of the plugin, that is the name of the directory in the plugins folder (e.g. nf-nomad).

Follow these steps to package, upload and publish the plugin:

  1. Create a file named gradle.properties in the project root containing the following attributes (this file should not be committed to Git):

    • github_organization: the GitHub organisation where the plugin repository is hosted.
    • github_username: The GitHub username granting access to the plugin repository.
    • github_access_token: The GitHub access token required to upload and commit changes to the plugin repository.
    • github_commit_email: The email address associated with your GitHub account.
  2. Use the following command to package and create a release for your plugin on GitHub:

    ./gradlew :plugins:nf-nomad:upload
  3. Create a pull request against nextflow-io/plugins to make the plugin accessible to Nextflow.

nf-nomad's People

Contributors

abhi18av avatar jagedn avatar matthdsm avatar mribeirodantas avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

mynahub abhi18av

nf-nomad's Issues

Fix gh pipeline

Current pipeline is using old versions of Java (8 & 11) and it's failing

Create a new translation class to address NF -> Nomad conversion

@jagedn initially suggested a new TaskResource class addressing this translation layer.

I do think that we can explore the idea regarding a specific "translation" class which covers all aspects of NomadJobDefinition from a NextflowTask, however I suggest that we still continue the current iterations and revisit this once the plugin has stabilised in its design - what do you think?

Originally posted by @abhi18av in #27 (comment)

Implementation of Job definition logic

  • Implement the NomadService to generate the expected JSON

  • Explore the use of template to send the command.* files to Nomad client

  • Implement the file transfer logic in .command.run file

  • Accommodate the various specifications from TaskRun within NomadJobOperations

  • #21

Implement Nomad Job/Task level settings in configuration

rnaseq-nf Nomad definitions

(Manual) implementation of the rnaseq-nf pipeline as a vanilla Nomad Job

  • Process-1
  • Process-2
  • Process-3
  • Process-4

Missing plugin information in zip

After refactor the gradle tasks related to generate a release version current implementation doesnt produced following information in the META-INF file:

Plugin-Id: nf-nomad
Plugin-Version: 0.0.1
Plugin-Class: nextflow.nomad.NomadPlugin
Plugin-Provider: nextflow
Plugin-Requires: >=23.10.0

Allow storage config using nomad `volume` blocks

While docker volumes is a quick way to prototype adding storage to a job/task it is not considered best practice in nomad. Since it is very driver specific approach and bypasses any native storage (Volume) handling in Nomad. Also most production clusters will lock down mounting volumes this way for security reasons. So we should find a user friendly way to do this using the nomad volume block.

Originally posted by @tomiles in #12 (comment)

Roadmap v0.1.0

Assumptions for the plugin

  1. docker executor is available on all nodes
  2. A shared file system is present across the nomad nodes, with a persistent volume
  3. A prod setup of a minimal of two nodes -> server node and client node

BONUS: Internet connection and wave enabled for fusionfs (?)

Pipelines to be tested on nomad cluster setup

  • nextflow-io/hello
  • rnaseq-nf
  • nf-core/fetchngs
  • nf-core/rnaseq
  • MAGMA

Plugin dev group (Jorge, Abhinav) responsible for

  • Developing the plugin structure and local testing setups via a nomad -dev node - #4
  • Making sure the Nextflow abstractions translate well to the nomad job abstractions #5
  • Testing the standard pipelines for usability and a smooth Nextflow experience locally

Infrastructure group (Tom, Matthias) responsible for

  • Setting up a common nomad testing infra (liasoning with nf-core team)
  • Setting up the testing infrastructure for pipelines via Github Actions (+ local runner) to be triggered on dev/main branch release/merges #3
  • Coming up with the Nextflow config for nomad executor

Long term maintenance

  • Jorge and Abhinav invested as developers
  • CMGG invested in maintaining the nf-core / Nextflow and Nomad infrastructure

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.