|
14 | 14 | # Based on https://docs.ray.io/en/latest/train/getting-started-pytorch-lightning.html
|
15 | 15 |
|
16 | 16 | """
|
17 |
| -# For S3 persistent storage replace the following environment variables with your AWS credentials then uncomment the S3 run_config |
18 |
| -# See here for information on how to set up an S3 bucket https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-bucket.html |
19 |
| -
|
20 |
| -os.environ["AWS_ACCESS_KEY_ID"] = "XXXXXXXX" |
21 |
| -os.environ["AWS_SECRET_ACCESS_KEY"] = "XXXXXXXX" |
22 |
| -os.environ["AWS_DEFAULT_REGION"] = "XXXXXXXX" |
23 |
| -""" |
24 |
| - |
25 |
| -""" |
26 |
| -# For Minio persistent storage uncomment the following code and fill in the name, password and API URL then uncomment the minio run_config. |
27 |
| -# See here for information on how to set up a minio bucket https://ai-on-openshift.io/tools-and-applications/minio/minio/ |
28 |
| -
|
29 |
| -def get_minio_run_config(): |
30 |
| - import s3fs |
31 |
| - import pyarrow.fs |
32 |
| -
|
33 |
| - s3_fs = s3fs.S3FileSystem( |
34 |
| - key = os.getenv('MINIO_ACCESS_KEY', "XXXXX"), |
35 |
| - secret = os.getenv('MINIO_SECRET_ACCESS_KEY', "XXXXX"), |
36 |
| - endpoint_url = os.getenv('MINIO_URL', "XXXXX") |
37 |
| - ) |
38 |
| -
|
39 |
| - custom_fs = pyarrow.fs.PyFileSystem(pyarrow.fs.FSSpecHandler(s3_fs)) |
40 |
| -
|
41 |
| - run_config = ray.train.RunConfig(storage_path='training', storage_filesystem=custom_fs) |
42 |
| - return run_config |
| 17 | +Note: This example requires an S3 compatible storage bucket for distributed training. Please visit our documentation for more information -> https://github.com/project-codeflare/codeflare-sdk/blob/main/docs/s3-compatible-storage.md |
43 | 18 | """
|
44 | 19 |
|
45 | 20 |
|
@@ -110,8 +85,6 @@ def train_func():
|
110 | 85 | trainer = TorchTrainer(
|
111 | 86 | train_func,
|
112 | 87 | scaling_config=scaling_config,
|
113 |
| - # run_config = ray.train.RunConfig(storage_path="s3://BUCKET_NAME/SUB_PATH/", name="unique_run_name") # Uncomment and update the S3 URI for S3 persistent storage. |
114 |
| - # run_config=get_minio_run_config(), # Uncomment for minio persistent storage. |
115 | 88 | )
|
116 | 89 | result: ray.train.Result = trainer.fit()
|
117 | 90 |
|
|
0 commit comments