Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial refactoring to match SMaHT portal changes #1

Merged
merged 18 commits into from
Dec 4, 2023
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# portal-pipeline-utils GA Workflow
# smaht-pipeline-utils GA Workflow

name: CI

Expand All @@ -17,7 +17,7 @@ on:
jobs:
# This workflow contains a single job called "test"
test:
name: Test portal-pipeline-utils with Python ${{ matrix.python_version }}
name: Test smaht-pipeline-utils with Python ${{ matrix.python_version }}

# The type of runner that the job will run on
runs-on: ubuntu-22.04
Expand All @@ -33,7 +33,7 @@ jobs:
with:
python-version: ${{ matrix.python_version }}

- name: Test portal-pipeline-utils
- name: Test smaht-pipeline-utils
run: |
make configure
make build
Expand Down
6 changes: 2 additions & 4 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ Change Log
==========


3.0.0
0.0.1
=====
* 2023-10-10
* Added this CHANGELOG.rst file.
* Upgrade to Python 3.11.
* Initial release
8 changes: 0 additions & 8 deletions LOG.md

This file was deleted.

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

Utilities for deploying pipelines and interfacing with portal infrastructure.

For more information on available commands and how to contribute and deploy pipelines within the infrastructure check the extended [*documentation*](https://portal-pipeline-utils.readthedocs.io/en/latest/ "portal-pipeline-utils documentation").
For more information on available commands and how to contribute and deploy pipelines within the infrastructure check the extended [*documentation*](https://smaht-pipeline-utils.readthedocs.io/en/latest/ "smaht-pipeline-utils documentation").

## Install

The software is python based. To install the software and the required packages, we recommend using a fresh virtual environment.
Please refer to `pyproject.toml` for the supported Python versions.

The package is available on [*pypi*](https://pypi.org/project/portal-pipeline-utils "portal-pipeline-utils pypi"):
The package is available on [*pypi*](https://pypi.org/project/smaht-pipeline-utils "smaht-pipeline-utils pypi"):

pip install portal-pipeline-utils
pip install smaht-pipeline-utils

To install from source:

git clone https://github.com/dbmi-bgm/portal-pipeline-utils.git
cd portal-pipeline-utils
git clone https://github.com/smaht-dac/smaht-pipeline-utils.git
cd smaht-pipeline-utils
make configure
make update
make build

To check that the software is correctly installed, try to run `pipeline_utils`. If installed from source, this command may fail with a bash “command not found” error, try `poetry run pipeline_utils` instead.
To check that the software is correctly installed, try to run `smaht_pipeline_utils`. If installed from source, this command may fail with a bash “command not found” error, try `poetry run smaht_pipeline_utils` instead.

See `make info` for details on make targets.
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

# -- Project information -----------------------------------------------------

project = 'portal-pipeline-utils'
copyright = '2021, HMS DBMI'
author = 'Michele Berselli, CGAP & SMaHT Team'
project = 'smaht-pipeline-utils'
copyright = '2023, HMS DBMI'
author = 'Michele Berselli, SMaHT Team'

# The full version, including alpha/beta/rc tags
release = '2.1.0'
release = '0.0.1'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/contribute_pipeline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,4 @@ Example
Examples
--------

Real examples of implemented pipeline modules can be found linked as submodules in our main pipeline repository for the CGAP project here: https://github.com/dbmi-bgm/cgap-pipeline-main.
Real examples of implemented pipeline modules can be found linked as submodules in our main pipeline repository for the SMaHT project here: https://github.com/smaht-dac/main-pipelines.
50 changes: 25 additions & 25 deletions docs/deploy_pipeline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,37 +55,37 @@ by running a test command:
More information on how to setup Docker can be found in the
`AWS Documentation <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html>`_.

We now need to install the ``pipeline_utils`` software to deploy the pipeline components.
We now need to install the ``smaht_pipeline_utils`` software to deploy the pipeline components.

Install pipeline_utils
======================
Install smaht_pipeline_utils
============================

The software is Python-based.
To install the software and the required packages, we recommend
using a fresh virtual environment.
Please refer to `pyproject.toml <https://github.com/dbmi-bgm/portal-pipeline-utils/blob/main/pyproject.toml>`_ for the supported Python version.
Please refer to `pyproject.toml <https://github.com/smaht-dac/smaht-pipeline-utils/blob/main/pyproject.toml>`_ for the supported Python version.

We recommend using pyenv to manage virtual environments.
Instructions for installing and using
pyenv can be found `here <https://realpython.com/intro-to-pyenv/>`_.

Once the virtual environment is set up and activated, we can proceed to :ref:`install <install>` portal-pipeline-utils software.
Once the virtual environment is set up and activated, we can proceed to :ref:`install <install>` smaht-pipeline-utils software.

.. code-block:: bash

# Install from source
git clone https://github.com/dbmi-bgm/portal-pipeline-utils.git
cd portal-pipeline-utils
git clone https://github.com/smaht-dac/smaht-pipeline-utils.git
cd smaht-pipeline-utils
make configure
make update
make build
cd ..

# Install from pypi
pip install portal-pipeline-utils
pip install smaht-pipeline-utils

To check that the software is correctly installed, try to run ``pipeline_utils``.
If installed from source, this command may fail with a bash "command not found" error, try ``poetry run pipeline_utils`` instead.
To check that the software is correctly installed, try to run ``smaht_pipeline_utils``.
If installed from source, this command may fail with a bash "command not found" error, try ``poetry run smaht_pipeline_utils`` instead.

Set Up Credentials and Environmental Variables
==============================================
Expand Down Expand Up @@ -142,7 +142,7 @@ Example of a key-pair entry:
}
}

``<namespace>`` is the namespace for the environment and can be found in the portal health page (e.g., cgap-wolf).
``<namespace>`` is the namespace for the environment and can be found in the portal health page (e.g., smaht-wolf).

.. _account_vars:

Expand All @@ -154,21 +154,21 @@ Finally we need to setup the information to identify the target environment to u
.. code-block:: bash

# Set the namespace of the target environment
# e.g., cgap-wolf
# e.g., smaht-wolf
export ENV_NAME=

# Set the bucket used to store the worklow description files
# e.g., cgap-biotest-main-application-tibanna-cwls
# e.g., smaht-wolf-application-tibanna-cwls
export WFL_BUCKET=

# Set the path to the keypair file with the portal credential
export KEYDICTS_JSON=~/.cgap-keys.json

# Set up project and institution
# Project and institution need to correspond to metadata present on the portal
# e.g., cgap-core and hms-dbmi
export PROJECT=
export INSTITUTION=
# Set up consortia and submission centers
# consortia and submission_centers need to correspond to metadata present on the portal
# e.g., ['smaht'] and ['smaht_dac']
export CONSORTIA=
export SUBMISSION_CENTERS=

# If running sentieon code,
# specify the address for the server that validate the software license
Expand All @@ -188,14 +188,14 @@ by the ``--repos`` argument.

.. code-block:: bash

pipeline_utils pipeline_deploy \
smaht_pipeline_utils pipeline_deploy \
--ff-env ${ENV_NAME} \
--keydicts-json ${KEYDICTS_JSON} \
--wfl-bucket ${WFL_BUCKET} \
--account ${AWS_ACCOUNT_NUMBER} \
--region ${TIBANNA_AWS_REGION} \
--project ${PROJECT} \
--institution ${INSTITUTION} \
--consortia ${CONSORTIA} \
--submission-centers ${SUBMISSION_CENTERS} \
--sentieon-server ${SENTIEON_LICENSE} \
--post-software \
--post-file-format \
Expand All @@ -214,18 +214,18 @@ The default is set to the ``main`` branch. The ``--local-build`` flag will preve

*Note: we are working to enable more builders with a command line argument for which builder to use to deploy modules from different repositories through AWS CodeBuild.*

Deploying CGAP Pipelines
Deploying SMaHT Pipelines
========================

CGAP pipelines are released as a complete package with a customized set up for automated deployment to the desired environment.
SMaHT pipelines are released as a complete package with a customized set up for automated deployment to the desired environment.
To deploy the pipelines run the following steps:

1. Clone the main pipeline repository.
The submodules will be empty and set to the current commits saved for the main branch.

.. code-block:: bash

git clone https://github.com/dbmi-bgm/cgap-pipeline-main.git
git clone https://github.com/smaht-dac/main-pipelines.git

2. Check out the desired version.
This will set the submodules to the commits saved for that pipeline release.
Expand All @@ -241,7 +241,7 @@ The submodules will be set in detached state on their current commit.

make pull

4. Build pipeline_utils (optional).
4. Build smaht_pipeline_utils (optional).
This will build from source the latest version linked for the current release.

.. code-block:: bash
Expand Down
47 changes: 1 addition & 46 deletions docs/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,4 @@
Functions
=========

Collection of utilities available as functions:

- :ref:`check_lines <check_lines>`

.. _check_lines:

check_lines
+++++++++++

*check_lines* function can be used to check that line counts are matching between the output of two steps where lines should not be dropped (i.e., any steps that modify without filtering), or between an output ``bam`` and the input ``fastq`` files.
Requires uuid for the *MetaWorkflowRun* object to check and ff_key to access the metadata on the portal. The steps to compare are specified as dictionaries, examples below.

.. code-block:: python

from pipeline_utils.lib import check_lines

result <bool> = check_lines.check_lines(metawfr_uuid, ff_key, steps=steps_dict, fastqs=fastqs_dict)

# metawfr_uuid
# -> uuid for MetaWorkflowRun object

# ff_key
# -> key to authenticate on the portal

## steps_dict example
# steps_dict = {
# 'workflow_add-readgroups-check': {
# 'dependency': 'workflow_bwa-mem_no_unzip-check',
# 'output': 'bam_w_readgroups',
# 'output_match': 'raw_bam',
# 'key': 'Total Reads',
# 'key_match': 'Total Reads'
# },
# ...
# }

## fastqs_dict example
# fastqs_dict = {
# 'workflow_bwa-mem_no_unzip-check': {
# 'output': 'raw_bam',
# 'input_match': ['fastq_R1', 'fastq_R2'],
# 'key': 'Total Reads',
# 'key_match': 'Total Sequences'
# },
# ...
# }
In development.
10 changes: 5 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
=========================
Portal Pipeline Utilities
=========================
===============================
SMaHT Portal Pipeline Utilities
===============================

Documentation for portal-pipeline-utils_, a collection of utilities for deploying pipelines and interfacing with portal infrastructure.
Documentation for smaht-pipeline-utils_, a collection of utilities for deploying pipelines and interfacing with SMaHT portal infrastructure.

.. _portal-pipeline-utils: https://github.com/dbmi-bgm/portal-pipeline-utils
.. _smaht-pipeline-utils: https://github.com/smaht-dac/smaht-pipeline-utils

Contents
########
Expand Down
10 changes: 5 additions & 5 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ PyPI

The package is available on pypi_:

.. _pypi: https://pypi.org/project/portal-pipeline-utils
.. _pypi: https://pypi.org/project/smaht-pipeline-utils

.. code-block:: bash

pip install portal-pipeline-utils
pip install smaht-pipeline-utils

Source
^^^^^^
Expand All @@ -23,10 +23,10 @@ To install the latest version from source:

.. code-block:: bash

git clone https://github.com/dbmi-bgm/portal-pipeline-utils.git
cd portal-pipeline-utils
git clone https://github.com/smaht-dac/smaht-pipeline-utils.git
cd smaht-pipeline-utils
make configure
make update
make build

Please refer to `pyproject.toml <https://github.com/dbmi-bgm/portal-pipeline-utils/blob/main/pyproject.toml>`_ for the supported Python version.
Please refer to `pyproject.toml <https://github.com/smaht-dac/smaht-pipeline-utils/blob/main/pyproject.toml>`_ for the supported Python version.
18 changes: 9 additions & 9 deletions docs/pipeline_utils.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
==============
pipeline_utils
==============
====================
smaht_pipeline_utils
====================

This is the entry point for a collection of utilities available as commands:

Expand All @@ -10,7 +10,7 @@ Usage:

.. code-block:: bash

pipeline_utils [COMMAND] [ARGS]
smaht_pipeline_utils [COMMAND] [ARGS]

.. _pipeline_deploy:

Expand All @@ -24,7 +24,7 @@ Usage:

.. code-block:: bash

pipeline_utils pipeline_deploy --ff-env FF_ENV --repos REPO [REPO ...] [OPTIONAL ARGS]
smaht_pipeline_utils pipeline_deploy --ff-env FF_ENV --repos REPO [REPO ...] [OPTIONAL ARGS]

**Arguments:**

Expand Down Expand Up @@ -61,10 +61,10 @@ Usage:
- AWS account to use for deployment
* - *-\-region*
- AWS account region to use for deployment
* - *-\-project*
- Project to use for deployment [cgap-core]
* - *-\-institution*
- Institution to use for deployment [hms-dbmi]
* - *-\-consortia*
- List of consortia to use for deployment [smaht]
* - *-\-submission-centers*
- List of centers to use for deployment [smaht_dac]
* - *-\-post-software*
- DEPLOY | UPDATE Software objects (.yaml or .yml)
* - *-\-post-file-format*
Expand Down
2 changes: 1 addition & 1 deletion docs/repo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ Example ``foo_bar`` pipeline:
├── PIPELINE
└── VERSION

Real examples can be found linked as submodules in our pipelines repository for CGAP project here: https://github.com/dbmi-bgm/cgap-pipeline-main.
Real examples can be found linked as submodules in our pipelines repository for SMaHT project here: https://github.com/smaht-dac/main-pipelines.
Loading
Loading