Member-only story
Effortless ML Training in GCP: Create and Distribute Custom Python Distribution Package

Here is a step-by-step guide to creating a Python .tar.gz
file for your ML code. This file can be uploaded to Google Cloud Platform (GCP) for custom ML training:
- Organize Your Code:
- Create a new directory for your project, if you haven’t already.
- Inside the project directory, organize your code into subdirectories as needed. A common structure might include subdirectories like
src
for source code anddata
for data files.
project_name/
│
├── src/
│ ├── __init__.py
│ ├── module1.py
│ ├── module2.py
│ └── ...
│
├── data/
│ ├── dataset1.csv
│ ├── dataset2.csv
│ └── ...
│
├── tests/
│ ├── __init__.py
│ ├── test_module1.py
│ ├── test_module2.py
│ └── ...
│
├── docs/
│ └── ...
│
├── setup.py
├── MANIFEST.in (optional)
└── README.md
2. Create a setup.py
Script:
- Create a
setup.py
script at the root of your project directory. - This script should include metadata about your project and instructions for how to build and install it. Here’s a basic example:
from setuptools import find_packages
from setuptools import setup
setup(
name='irys-market-predictor',
version='0.1',
packages=find_packages()…