Skip to main content

No project description provided

Project description

AWS EC2 Deploy —

  1. Install Python 3.8 or newer:

    # install build dependencies
    sudo yum install -y openssl-devel readline-devel zlib-devel bzip2-devel libffi-devel
    
    # install `pyenv`
    git clone https://github.com/pyenv/pyenv.git ~/.pyenv
    echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
    echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
    echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.bash_profile
    
    # install python
    pyenv install 3.8.2
  2. Create venv for FPX and install it:

    pyenv shell 3.8.2
    cd /usr/lib/ckan
    python -m venv fpx
    cd fpx
    source bin/activate
    pip install fpx
  3. Create config file. It can be created anywhere, as long as it accessible by FPX service:

    echo '
    
    PORT = 8000
    
    # DB is not used much, so SQLite can be used as long as you are going to use single instance of FPX service.
    # If you planning to use multiple instances + load balancer, consider using PostgreSQL
    DB_URL = "sqlite:////etc/ckan/default/fpx.db"
    
    # Maximum number of simultaneous downloads. 2 is used only for testing.
    # In production, value between 10 and 100 should be used, depending on server's bandwidth.
    # Higher value won't create any performance penalty.
    SIMULTANEOURS_DOWNLOADS_LIMIT = 2
    ' > /etc/ckan/default/fpx.py
  4. Initialize database and create access token for client. It can be stored later inside CKAN ini file as fpx.client.secret:

    export FPX_CONFIG=/etc/ckan/default/fpx.py
    fpx db up
    fpx client add link-digital  # use any name instead of `link-digital`
  5. Test service:

    FPX_CONFIG=/etc/ckan/default/fpx.py fpx server run
    # or, if you want to explicitely use python interpreter
    FPX_CONFIG=/etc/ckan/default/fpx.py python -m fpx
  6. Configure system.d/supervisor/etc. unit for fpx. Make sure, that fpx server run command, that spins up the service executed using python>=3,8 (pyenv shell 3.8.2) and, if SQLite is used, fpx process requires write access to db file.

  7. FPX service must be available via public url(and CKAN ini file requires this URL under fpx.service.url config option). As written in documentation(https://sanic.readthedocs.io/en/latest/sanic/deploying.html#deploying), no additional layers required. But if you decide to use it with Nginx, following link may be useful - https://sanic.readthedocs.io/en/latest/sanic/nginx.html#nginx-configuration . Note, FPX is using websockets(if it can somehow affect configuration).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fpx-0.0.3.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

fpx-0.0.3-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file fpx-0.0.3.tar.gz.

File metadata

  • Download URL: fpx-0.0.3.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.0

File hashes

Hashes for fpx-0.0.3.tar.gz
Algorithm Hash digest
SHA256 40787f20171b80d79b57465e9ed9270b60a93f21eeff217040ae561f77deaa04
MD5 b462db80f65d4474a75d15c637dbda96
BLAKE2b-256 5dbbd99d615797ec0e314c4352c9175c29cfb99ad64f895efdedf0376729f224

See more details on using hashes here.

Provenance

File details

Details for the file fpx-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: fpx-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.0

File hashes

Hashes for fpx-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d55a24623a97132eba02cc0b574d46426c6414ed226e846f3bbb81b9a851531b
MD5 cc3a9dead3df0b299be3c44f63aee56b
BLAKE2b-256 b4e2f550d2260e6ce396b81ce98ae3cc43d1b63609dfa9c2c122115df16ef4ad

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page