Skip to main content

Unofficial AWS Glue Ray.io packaging tool. Pure python or cross platform.

Project description

raypack

Raypack will create a package for AWS Glue, Ray.io tasks. This automates this documentation page that has some handwavy descriptions of shell commands.

If you are only using included-by-default packages, public packages, pure python packages, binary wheel packages, you don't have to do this.

AWS Glue can't handle anything without a binary wheel or private package repositories, gcc or other build tools are not in Glue runtime images.

So you have build on a machine that matches the AWS runtime OS (Fedora-like), create a virtual directory, and then zip it up and upload it to s3.

Some code generate with ChatGPT (OpenAI)

raypack is not supported by Amazon, AWS, nor Anyscale, Inc the makers of ray.io.

Libraries.io dependency status for latest release Downloads

Installation

You are encouraged to install with pipx so that the CLI tools dependencies do not conflict with your project dependencies.

pipx install raypack

Capabilities

  • Calls poetry to create a virtualenv without dev dependencies
  • TODO: support pip, pipenv to create virtualenv.
  • Finds site-packages
  • Zips virtualenv and zips own package
  • TODO: support single file modules, eg. mymodule.py
  • Skips cruft
  • Run as few subprocesses as possible
  • config using pyproject.toml or CLI args
  • TODO: Uploads to s3
  • pipx installable
  • works on any OS as well as is possible (can't handle linux binaries on windows for example)

Usage

raypack
python -m raypack

Configuration. If none specified, defaults are as below.

[tool.raypack]
exclude_packaging_cruft = true
outer_folder_name = "venv"
source_venv = ".venv"
venv_tool = "poetry"

How it works

  1. Gather info from pyproject.toml or CLI args, but not both.
  2. Create a local .venv and .whl using poetry.
  3. Create a new zip file with an extra top level folder.
  4. Find the site-packages folder and copy to a new zip
  5. Find the module contents in .whl and copy to a new zip
  6. Upload to s3
  7. Use s3 py modules "--s3-py-modules", "s3://s3bucket/pythonPackage.zip"

Contributing

To install and run tests and linting tools.

poetry install --with dev
make check

To see if the app can package up other apps

poetry build
# exist poetry shell so that pipx can install with the right base python
exit 
pipx install /e/github/raypack/dist/raypack-0.1.0-py3-none-any.whl

And then in a different project with a pyproject.toml file, run

raypack

Prior Art

Random scripts in comments

Some make file script

Similar to PEX or other venv zip tools, which as far as I know are not AWS aware, or they don't include all the dependencies, or they are more interested in making the archive file executable or self-extracting.

AWS Lambdas also have to go through a similar ad hoc zip process.

Documentation

Change Log

  • 0.1.0 - Idea and reserve package name.

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

raypack-0.3.1.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

raypack-0.3.1-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file raypack-0.3.1.tar.gz.

File metadata

  • Download URL: raypack-0.3.1.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for raypack-0.3.1.tar.gz
Algorithm Hash digest
SHA256 dc2bc71e6ab422f2c0d09d9a4564068a55c68f3f86102934fd00c3cce62f4ac9
MD5 efed0e332e70911815ce3b743c8dd17c
BLAKE2b-256 1a1f5b9c8c10955b38ea93984e9a1eaf3aa70e7583031b12a7dd67e05724fefa

See more details on using hashes here.

File details

Details for the file raypack-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: raypack-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for raypack-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d87bd425da268bedf311913d54097b925939b6c8112829d8577cbf3a560cadb
MD5 caebb830b506c0b7b20ed02c4778ab76
BLAKE2b-256 dd238e6d49d426fb69ab22be51322190abeab49d9c414a8fb3a76b765361fd5b

See more details on using hashes here.

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