Unofficial AWS Glue Ray.io packaging tool. Pure python or cross platform.
Reason this release was yanked:
buggy
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.
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
- Gather info from pyproject.toml or CLI args, but not both.
- Create a local .venv and .whl using poetry.
- Create a new zip file with an extra top level folder.
- Find the site-packages folder and copy to a new zip
- Find the module contents in .whl and copy to a new zip
- Upload to s3
- 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
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file raypack-0.3.0.tar.gz
.
File metadata
- Download URL: raypack-0.3.0.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58eba58952af4019bbd5f4f83497d67fa90f1af161c11908d30d403162f9da0c |
|
MD5 | 59ab80e5379469df3075dfba269cf1d8 |
|
BLAKE2b-256 | 60bfe661130395c050888643ca18dd1c589807a6600f50fcc9002da8998593ab |
File details
Details for the file raypack-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: raypack-0.3.0-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e2a47ebec8a3a5545d1e699c230e16c752cb05abfb1443db9608e5d338fbf62 |
|
MD5 | 295f1b034a91aa14168710efca290c59 |
|
BLAKE2b-256 | 1a128b061efa40003f6d4d4e921c5eb758be550d9ab7af506857620d051d2f4e |