Skip to content

Commit

Permalink
🐛 Fix --version, add enter, parse-resources and version, and …
Browse files Browse the repository at this point in the history
…fix tests (#29)
  • Loading branch information
shnizzedy authored Apr 20, 2022
2 parents e6bdbe4 + 0b166d5 commit b3a1b6b
Show file tree
Hide file tree
Showing 26 changed files with 1,150 additions and 558 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/test_cpac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:

strategy:
matrix:
platform: [docker, singularity]
tag: [latest, dev-v1.8]
platform: [docker]
tag: [latest, nightly]
go: [1.14]
python: [3.6, 3.7, 3.8]
python: [3.7, 3.8, 3.9, "3.10"]
singularity: [3.6.4]

steps:
Expand All @@ -39,45 +39,44 @@ jobs:
run: python -m pip install --upgrade pip setuptools wheel
- name: Set up Singularity
if: ${{ matrix.platform == 'singularity' }}
uses: eWaterCycle/setup-singularity@v5
uses: eWaterCycle/setup-singularity@v7
with:
singularity-version: ${{ matrix.singularity }}
- name: Prepare Singularity cache and tmp directories
if: ${{ matrix.platform == 'singularity' }}
run: mkdir -p ${SINGULARITY_CACHEDIR} && mkdir -p ${SINGULARITY_TMPDIR}
- name: Install dependencies
run: |
sudo apt-get install libarchive-dev \
libffi-dev \
flawfinder \
libgpgme11-dev \
libseccomp-dev \
squashfs-tools \
libssl1.1 libssl-dev \
libuuid1 uuid-dev
sudo apt-get install libffi-dev \
flawfinder \
libgpgme11-dev \
libseccomp-dev \
squashfs-tools \
libssl1.1 libssl-dev \
libuuid1 uuid-dev
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install coverage coveralls nipype
- name: Install cpac
run: cd $GITHUB_WORKSPACE && pip install -e .
- name: Test cpac, platform and tag specified
run: |
coverage run --append -m pytest --doctest-modules --platform ${{ matrix.platform }} --tag ${{ matrix.tag }} .
coverage run --append -m pytest --basetemp=${PWD}/tmp --doctest-modules --platform ${{ matrix.platform }} --tag ${{ matrix.tag }} .
coverage report -m
- name: Test cpac, platform specified, tag unspecified
if: ${{ matrix.tag == 'latest' }}
run: |
coverage run --append -m pytest --doctest-modules --platform ${{ matrix.platform }} .
coverage run --append -m pytest --basetemp=${PWD}/tmp --doctest-modules --platform ${{ matrix.platform }} .
coverage report -m
- name: Test cpac, platform unspecified, tag specified
if: ${{ matrix.platform == 'docker' }}
run: |
coverage run --append -m pytest --doctest-modules --tag ${{ matrix.tag }} .
coverage run --append -m pytest --basetemp=${PWD}/tmp --doctest-modules --tag ${{ matrix.tag }} .
coverage report -m
- name: Test cpac, platform and tag unspecified
if: ${{ matrix.platform == 'docker' }} && ${{ matrix.tag }} == 'latest'
run: |
coverage run --append -m pytest --doctest-modules .
coverage run --append -m pytest --basetemp=${PWD}/tmp --doctest-modules .
coverage report -m
- name: Report coverage
uses: AndreMiras/coveralls-python-action@v20201129
Expand All @@ -102,6 +101,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install cpac
run: cd $GITHUB_WORKSPACE && pip install .
- name: Configure Git credentials
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ __pycache__/*
.cache/*
.*.swp
*/.ipynb_checkpoints/*
tmp

# Project files
.ropeproject
Expand Down Expand Up @@ -49,4 +50,5 @@ MANIFEST
.venv*/

# Singularity Images
**/*.simg
**/*.simg
**/*.sif
9 changes: 8 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ Changelog
=========
`Unreleased`
================================================================================================
* 🧮 Evaluates memory usage for specific nodes from `callback.log` files
* 🧮 Evaluates memory usage for specific nodes from ``callback.log`` files
* ✨ Adds ``enter`` command to enter a container's ``BASH``
* ✨ Adds ``version`` command to give version of in-container C-PAC
* 🐛 Fixes issue where ``--version`` command was not working
* 🐛 Fixes issue where custom pipeline configurations were not binding to temporary container prior to checking for bind paths
* ✅ Updates for tests that were failing
* 📝 Add known issues to usage string
* ⬆ Require Python ≥ 3.7 (for typing annotations)

`Version 0.4.0: Goodbye Singularity Hub <https://github.com/FCP-INDI/cpac/releases/tag/v0.4.0>`_
================================================================================================
Expand Down
41 changes: 37 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ C-PAC Python Package is a lightweight Python package that handles interfacing a
Dependencies
============

* `Python <https://www.python.org>`_ ≥3.6
* `Python <https://www.python.org>`_ ≥3.7
* `pip <https://pip.pypa.io>`_
* At least one of:

* `Docker <https://www.docker.com>`_
* `Singularity <https://sylabs.io/singularity>`_ ≥2.5&≤3.0
* `Singularity <https://sylabs.io/singularity>`_ ≥2.5

Usage
=====
Expand All @@ -32,7 +32,8 @@ Usage
usage: cpac [-h] [--version] [-o OPT] [-B CUSTOM_BINDING]
[--platform {docker,singularity}] [--image IMAGE] [--tag TAG]
[--working_dir PATH] [-v] [-vv]
{run,group,utils,pull,upgrade,crash} ...
{run,utils,version,group,pull,upgrade,enter,bash,shell,parse-resources,parse_resources,crash}
...
cpac: a Python package that simplifies using C-PAC <http://fcp-indi.github.io> containerized images.
Expand All @@ -57,8 +58,40 @@ Usage
cpac run --help
Known issues:
- Some Docker containers unexpectedly persist after cpac finishes. To clear them, run
1. `docker ps` to list the containers
For each C-PAC conatainer that persists, run
2. `docker attach <container_name>`
3. `exit`
- https://github.com/FCP-INDI/cpac/issues
positional arguments:
{run,group,utils,pull,upgrade,crash}
{run,utils,version,group,pull,upgrade,enter,bash,shell,parse-resources,parse_resources,crash}
run Run C-PAC. See
"cpac [--platform {docker,singularity}] [--image IMAGE] [--tag TAG] run --help"
for more information.
utils Run C-PAC commandline utilities. See
"cpac [--platform {docker,singularity}] [--image IMAGE] [--tag TAG] utils --help"
for more information.
version Print the version of C-PAC that cpac is using.
group Run a group level analysis in C-PAC. See
"cpac [--platform {docker,singularity}] [--image IMAGE] [--tag TAG] group --help"
for more information.
pull (upgrade) Upgrade your local C-PAC version to the latest version
by pulling from Docker Hub or other repository.
Use with "--image" and/or "--tag" to specify an image
other than the default "fcpindi/c-pac:latest" to pull.
enter (bash, shell)
Enter a new C-PAC container via BASH.
parse-resources (parse_resources)
When provided with a `callback.log` file, this utility can sort through
the memory `runtime` usage, `estimate`, and associated `efficiency`, to
identify the `n` tasks with the `highest` or `lowest` of each of these
categories.
"parse-resources" is intended to be run outside a C-PAC container.
See "cpac parse-resources --help" for more information.
crash Convert a crash pickle to plain text (C-PAC < 1.8.0).
optional arguments:
-h, --help show this help message and exit
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
docker >= 4.2.1
dockerpty
docker-pycreds
pandas >= 0.23.4
pyyaml
Expand Down
6 changes: 4 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ classifiers =
Operating System :: OS Independent
Programming Language :: Python :: 3
Topic :: Scientific/Engineering :: Bio-Informatics
version = 0.4.1
version = 0.5.0

[options]
zip_safe = False
Expand All @@ -37,14 +37,16 @@ setup_requires =
pyyaml
install_requires =
docker
dockerpty
docker-pycreds
pandas >= 0.23.4
spython >= 0.0.81
pyyaml
rich
tabulate >= 0.8.6
tornado
websocket-client
python_requires = >=3.6
python_requires = >=3.7

[options.packages.find]
where = src
Expand Down
Loading

0 comments on commit b3a1b6b

Please sign in to comment.