Skip to content

Commit

Permalink
Added CHANGES file. Added --version option. Tweaks to setup.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
victor73 committed Mar 4, 2019
1 parent 8f7a92d commit c201098
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 16 deletions.
56 changes: 56 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
portal_client 1.4.2

* Corrections to setup.py.
* Addition of --version option.

- Victor <[email protected]> Sun, 03 Mar 2019 18:00:00 -0400

portal_client 1.4.1

* Additional clarification about the virtualenv creation.
* Separate installation document and new readme.
* Checking for ascp being in the path when FASP endpoint is used.

- Victor <[email protected]> Fri, 01 Mar 2019 12:28:00 -0400

portal_client 1.4.0

* Fixes FTP downloads for NCBI SRA FTP urls.
* Adds new feature, --disable-validation, to turn off/disable MD5 checksum
validation to boost performance for large files/transfers (or when MD5
information is incorrect or unavailable).

- Victor <[email protected]> Fri, 01 Mar 2019 12:26:00 -0400

portal_client 1.3.0

* Fixes problem with destination path using /, instead of os.path.join().

- Victor <[email protected]> Thu, 28 Feb 2019 15:00:00 -0400

portal_client 1.2.0

* Major refactoring in several classes.
* Replacement to the ihmpdcc/hmp_client project.

- Victor <[email protected]> Sun, 10 Feb 2019 10:06:00 -0400

portal_client 1.2

* Updated documentation.
* New FASP (Aspera) functionality.

- jmatsumura <[email protected]> Wed, 14 Jun 2017 14:33:00 -0400

portal_client 1.1

* Adding in a basic, but very convenient feature for creating a directory if
it does not already exist.

- jmatsumura <[email protected]> Tue, 13 Jun 2017 16:57:00 -0400

portal_client 1.0

* Initial release.

- jmatsumura <[email protected]> Wed, 07 Jun 2017 16:17:00 -0400
86 changes: 72 additions & 14 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Installation

There are 2 basic ways to install portal_client:
There are several ways to install portal_client:

1. Traditional installation
2. Using Docker

## 1. Traditional installation
1. Using easy_install
2. Using pip
3. Using VirtualEnv
4. Using Docker

The portal client requires Python 3, the Boto library, and two Google
python libraries:
Expand All @@ -18,9 +18,62 @@ python libraries:

- [google-cloud-storage](https://pypi.org/project/google-cloud-storage/)

An easy way to install Python 3 and the necessary dependencies is to use VirtualEnv and
pip (or pip3 on some systems). The following commands assume you already have VirtualEnv
installed on your system and the portal_client software downloaded.

## Using easy_install

Download or clone the portal_client code from github.

<pre>
$ cd portal_client
</pre>

Then one can simply use easy_install. If you have root privileges:

<pre>
# easy_install .
</pre>

or with sudo:

<pre>
$ sudo easy_install .
</pre>

If you are performing a non-root installation, you can still use easy_install. First,
pick an installation directory. In this example we'll use /tmp. Then add the installation
directory to your PYTHONPATH environment variable if it isn't already there:

<pre>
$ export PYTHONPATH=$PYTHONPATH:/tmp
</pre>

Then invoke easy_install with the --install-dir option. Note the final '.', which tells
easy_install where to look for the setup.py script.

<pre>
$ easy_install --install-dir /tmp .
</pre>

## Using pip

Another tool that is commonly used to install Python modules is pip. To use pip to
install portal_client, download the source code as shown above, then invoke pip as root or using
sudo:

<pre>
$ cd portal_client
</pre>

<pre>
$ sudo pip3 install .
</pre>

## Using VirtualEnv

An easy way to install portal_client and the necessary dependencies is to use
VirtualEnv and pip (or pip3 on some systems). The following commands assume you
already have VirtualEnv installed on your system and the portal_client software
downloaded.

1. Create a virtual environment

Expand All @@ -36,17 +89,18 @@ source /path/to/venvs/portal_client/bin/activate

3. Install the portal_client into the virtual environment

Switch back to your download of portal_client and execute pip3 install as follows:
Switch back to your download of portal_client and execute pip3 install as
follows:

```bash
pip3 install .
```

This will retrieve and install the dependencies as well.

### 2. Using Docker
## Using Docker

The portal_client code comes bundled with a Dockerfile, which, when used, will
The portal_client code comes with a Dockerfile, which, when used, will
build a docker image with Python 3.6 as well as the dependencies specific to
the portal client. One can then use this Docker image to execute the client
using the following steps:
Expand All @@ -70,13 +124,15 @@ the -v option, and we are executing the client in the /tmp directory with the us
of the -w option.

```bash
docker run -v "$PWD:/tmp" -w /tmp -ti --rm portal_client portal_client --url=https://raw.githubusercontent.com/IGS/portal_client/master/example_manifests/example_manifest.tsv
docker run -v "$PWD:/tmp" -w /tmp -ti --rm portal_client portal_client \
--url=https://raw.githubusercontent.com/IGS/portal_client/master/example_manifests/example_manifest.tsv
```

* If running on EC2, this will automatically be detected and S3 will be the preferred endpoint. Example:

```bash
docker run -ti --rm -v "$PWD":/tmp -w /tmp portal_client portal_client --url=https://raw.githubusercontent.com/IGS/portal_client/master/example_manifests/example_manifest.tsv
docker run -ti --rm -v "$PWD":/tmp -w /tmp portal_client portal_client \
--url=https://raw.githubusercontent.com/IGS/portal_client/master/example_manifests/example_manifest.tsv
```

* If you wish to control which protocol/endpoint to prioritize, you can pass
Expand All @@ -85,5 +141,7 @@ For example, to override the S3 prioritized endpoint on an AWS EC2 instance with
the HTTP endpoint:

```bash
docker run -ti --rm -v "$PWD:/tmp" -w /tmp portal_client portal_client --url=https://raw.githubusercontent.com/IGS/portal_client/master/example_manifests/example_manifest.tsv --endpoint-priority=HTTP
docker run -ti --rm -v "$PWD:/tmp" -w /tmp portal_client portal_client \
--endpoint-priority=HTTP \
--url=https://raw.githubusercontent.com/IGS/portal_client/master/example_manifests/example_manifest.tsv
```
11 changes: 11 additions & 0 deletions lib/portal_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,23 @@ def set_logging():
ch.setFormatter(formatter)
root.addHandler(ch)

def version():
import pkg_resources
version = pkg_resources.get_distribution('portal_client').version
return version

def parse_cli():
parser = argparse.ArgumentParser(
description='Client to download files given a manifest file ' + \
'generated from a portal instance.'
)

parser.add_argument(
'--version',
action='version',
version='%(prog)s ' + version()
)

parser.add_argument(
'-m', '--manifest',
type=str,
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def read(fname):
name='portal-client',
description='Download client tool for IGS Portal servers.',
long_description=read('DESC'),
version='1.4.1',
version='1.4.2',
py_modules=['portal_client'],
author='Victor F',
author_email='[email protected]',
Expand All @@ -31,7 +31,7 @@ def read(fname):
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: POSIX",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"Topic :: Utilities",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Bio-Informatics"
Expand Down

0 comments on commit c201098

Please sign in to comment.