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.2.post1.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

fpx-0.0.2.post1-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file fpx-0.0.2.post1.tar.gz.

File metadata

  • Download URL: fpx-0.0.2.post1.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.2.post1.tar.gz
Algorithm Hash digest
SHA256 65f8a35f43dc555794407b4d62e28d4eca14c49fd001dd3b31e2433b83229693
MD5 bfb85443fec74e352792c35bc365c85c
BLAKE2b-256 7b2225f4e3ecf20c49e536906bae1ba570e8b7e707ccdaf4de1c83eff6c52792

See more details on using hashes here.

Provenance

File details

Details for the file fpx-0.0.2.post1-py3-none-any.whl.

File metadata

  • Download URL: fpx-0.0.2.post1-py3-none-any.whl
  • Upload date:
  • Size: 15.5 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.2.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 a115491ea10094139b860dd9630aebff709dacc6b5bfc2c3ee83cc2697191f91
MD5 98030f9d4b01ab7eec4bed50ea4c7a94
BLAKE2b-256 a54993ecebf27442114aaa901511959fb30ccc0032940c26a30b644d390aae3f

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