This repository has been archived by the owner. It is now read-only.
The GUNZIP accelerator provides an hardware-accelerated gzip decompression.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.resources
samples
.gitignore
LICENSE
readme.md
run_example.py

readme.md

AWS OVH

GUNZIP Accelerator

The GUNZIP accelerator provides an hardware-accelerated gzip decompression.

Features

  • Hardware-accelerated GZIP decompression
  • Remote or local execution facility
  • Easy to use Python API

Limitations

  • The GUNZIP accelerator does not support password-protected archives.
  • Inputs and outputs can't be larger than 30GB.
  • See also limitations from API

Parameters

This section describes accelerator inputs and outputs.

Configuration parameters

No parameters required.

Processing parameters

Generic parameters:

  • file_in: Path to the file to decompress.
  • file_out: Path to the result decompressed file.

Processing output

Processing output is file defined by file_out parameter.

Getting started

The Apyfal Python library is required.

Apyfal is installed using PIP. Some installation options are available depending the host you want to use (See "Installation" in Apyfal documentation for more information).

You can install the full package with all options using:

pip install apyfal[all]

Using Accelerator with Apyfal

Running example

This example decompress a file of 1 MB.

You can clone a repository to get examples files, then move to the cloned directory:

git clone https://github.com/Accelize/gunzip --depth 1
cd gunzip

You need to create and configure an accelerator.conf file to run the example. See "Configuration" in Apyfal documentation for more information.

You can run the example with Apyfal :

./run_example.py

The result is the "results/sample_1_1MB.txt" file.

Using Apyfal step by step

This section explains how to run this particular accelerator. For explanation on Apyfal and host configuration, See "Getting Started" in Apyfal documentation.

import apyfal

# 1- Create Accelerator
with apyfal.Accelerator(accelerator='cast_gunzip') as myaccel:
    
    # 2- Configure Accelerator and its host
    #    Note: This step can take some minutes depending the configured host
    myaccel.start()
    
    # 3- Process file
    myaccel.process(file_in="samples/sample_1_1MB.txt.gz", file_out="results/sample_1_1MB.txt")

The result is the "results/sample_1_1MB.txt" file.

Local execution on cloud instance

This section shows how to run the above example directly on host.

This example requires an host running the accelerator.

Creating cloud instance host using Apyfal CLI

You can easily generate a cloud instance host with Apyfal CLI

apyfal create --accelerator cast_gunzip

apyfal start

And then connect to it with SSH (key_pair and ip_address values are printed by Apyfal CLI on start):

ssh -Yt -i ~/.ssh/${key_pair}.pem centos@${ip_address}

It is now possible to continue using Apyfal as Python library or as CLI, The example next steps will use the CLI.

Accelerator configuration

First, initialize the Apyfal CLI.

apyfal create

Like previously, start the accelerator:

apyfal start

Process with accelerator

Then, process with accelerator.

apyfal process --file_in samples/sample_1_1MB.txt.gz --file_out results/sample_1_1MB.txt

The result is the "results/sample_1_1MB.txt" file.

Terminate cloud instance with Apyfal CLI

From client computer, don't forget to terminate instance you have created with Apyfal once you have finished with it:

apyfal stop

Support and enhancement requests

Read the APYFAL FAQ

Contact us if you have any support or enhancement request