Download minio_api/server.py from heboya8/ETL_pipeline: direct link, hf CLI and curl.
- Browser
- Download file 814 Bytes
-
https://huggingface.co/heboya8/ETL_pipeline/resolve/main/minio_api/server.py
- Command line
-
hf download hf://heboya8/ETL_pipeline/minio_api/server.py
-
curl -L -o server.py https://huggingface.co/heboya8/ETL_pipeline/resolve/main/minio_api/server.py
814 Bytes
| import os | |
| import subprocess | |
| from dotenv import load_dotenv | |
| # Install MinIO binary | |
| subprocess.run(["wget", "https://dl.min.io/server/minio/release/linux-amd64/minio"]) | |
| subprocess.run(["chmod", "+x", "minio"]) | |
| subprocess.run(["mkdir", "-p", "~/minio-data"]) | |
| # Load environment variables | |
| load_dotenv("minio.env") | |
| minio_root_user = os.getenv("MINIO_ROOT_USER") | |
| minio_root_password = os.getenv("MINIO_ROOT_PASSWORD") | |
| address_port = 9192 | |
| web_port = 9193 | |
| # Start MinIO server in background | |
| command = f'./minio server ~/minio-data --address ":{address_port}" --console-address ":{web_port}" &' | |
| try: | |
| subprocess.run(command, shell=True, check=True) | |
| print(f"MinIO started with API on :{address_port} and WebUI on :{web_port}") | |
| except subprocess.CalledProcessError as e: | |
| print(f"Failed to start MinIO: {e}") | |