10000 GitHub - Psy-Fer/azure-nextflow
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Psy-Fer/azure-nextflow

 
 

Repository files navigation

Azure Nextflow

This repository contains sample only code to demonstrate how secrets can be marshaled from Key Vault into a Container Instance running Nextflow for the purpose of dispatching Nextflow pipelines on Azure Batch.

Overview

Deploying the Azure resources supporting this sample is left to you.

It is assumed that this infrastructure would be deployed using GitHub workflows or DevOps pipelines; samples of each are provided.

It is assumed that regardless of deployment method, GitHub is used for hosting the forked repository.

Pre-requisites

  1. Fork this repository on GitHub.

  2. Create a Service Principal for connecting to Azure.

    az_subId="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    
    az ad sp create-for-rbac --name "DeploymentConnection" --role owner --scopes /subscriptions/$az_subId--sdk-auth
  3. (optional) Access can be granted at the resource group scope instead of the subscription scope if the resource group is created before running the deployment workflow/pipeline.

    az_subId="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    az_rgName="myRgName"
    
    az ad sp create-for-rbac --name "GitHubConnection" --role owner --scopes /subscriptions/$az_subId/resourceGroups/$az_rgName --sdk-auth

    Important: The principal will need Owner permission on the target resource group scope as a minimum.

Set up

The following uses the provided GitHub workflows or DevOps pipelines to build and deploy the sample. See Annex below for manual set up instructions.

Deploy using GitHub

GitHub workflow

  1. Create a new AZURE_CREDENTIALS GitHub Secret using the Service Principal created earlier; details in Azure Docs.

  2. Run the workflow called GitHub Workflows.

    Running the GitHub Workflow

Deploy using DevOps

DevOps Pipeline

  1. Create a new Azure Resource Manager - Service principal (manual) Service Connection in DevOps using the Service Principal created earlier; details in Azure Docs.

  2. Creating a new pipeline and link to the ./.devops/pipelines/cicd.yml file that's on GitHub by selecting GitHub (YAML) and then Existing Azure Pipelines YAML file.

  3. Run the newly created pipeline.

    Running the DevOps Pipeline

Validate deployment

To validate set up was successful, trigger the Azure Function using its webhook.

az_funcAppName="myFuncAppName"

curl --get "https://$az_funcAppName.azurewebsites.net/api/nxfutil"

# returns
Successfully created nxfutil container instance nextflow-xxxxxx.

Usage

When the Function App is triggered it will create a new nxfutil Container Instance. See Annex for nxfutil details.

The http trigger currently accepts 3 (optional) arguments.

  • A URI to a Nextflow config file.
  • A URI to a Nextflow pipeline file.
  • A URI to a Nextflow parameters file.
az_funcAppName="nxfutil-py"

nxf_configUri="https://raw.githubusercontent.com/axgonz/azure-nextflow/main/nextflow/pipelines/nextflow.config"
nxf_pipelineUri="https://raw.githubusercontent.com/axgonz/azure-nextflow/main/nextflow/pipelines/helloWorld/pipeline.nf"
nxf_parametersUri="https://raw.githubusercontent.com/axgonz/azure-nextflow/main/nextflow/pipelines/helloWorld/parameters.json"

curl --get "https://$az_funcAppName.azurewebsites.net/api/nxfutil?config=$nxf_configUri&pipeline=$nxf_pipelineUri&parameters=$nxf_parametersUri"

Annex

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Bicep 52.4%
  • Python 34.7%
  • Nextflow 5.3%
  • Dockerfile 4.2%
  • Shell 3.4%
0