lightray 0.2.4__tar.gz → 0.2.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lightray-0.2.4 → lightray-0.2.5}/PKG-INFO +18 -18
- {lightray-0.2.4 → lightray-0.2.5}/README.md +8 -10
- {lightray-0.2.4 → lightray-0.2.5}/lightray/callbacks.py +5 -5
- {lightray-0.2.4 → lightray-0.2.5}/lightray/cli.py +6 -6
- {lightray-0.2.4 → lightray-0.2.5}/lightray/utils.py +3 -3
- lightray-0.2.5/lightray.egg-info/PKG-INFO +140 -0
- lightray-0.2.5/lightray.egg-info/SOURCES.txt +14 -0
- lightray-0.2.5/lightray.egg-info/dependency_links.txt +1 -0
- lightray-0.2.5/lightray.egg-info/entry_points.txt +2 -0
- lightray-0.2.5/lightray.egg-info/requires.txt +7 -0
- lightray-0.2.5/lightray.egg-info/top_level.txt +1 -0
- {lightray-0.2.4 → lightray-0.2.5}/pyproject.toml +23 -10
- lightray-0.2.5/setup.cfg +4 -0
- lightray-0.2.4/.flake8 +0 -11
- lightray-0.2.4/.github/workflows/charts.yaml +0 -32
- lightray-0.2.4/.github/workflows/pre-commit.yaml +0 -17
- lightray-0.2.4/.github/workflows/publish.yaml +0 -27
- lightray-0.2.4/.github/workflows/unit-tests.yaml +0 -34
- lightray-0.2.4/.gitignore +0 -2
- lightray-0.2.4/.pre-commit-config.yaml +0 -26
- lightray-0.2.4/charts/raycluster/.helmignore +0 -23
- lightray-0.2.4/charts/raycluster/Chart.yaml +0 -24
- lightray-0.2.4/charts/raycluster/templates/NOTES.txt +0 -0
- lightray-0.2.4/charts/raycluster/templates/external-service.yaml +0 -13
- lightray-0.2.4/charts/raycluster/templates/head-deployment.yaml +0 -102
- lightray-0.2.4/charts/raycluster/templates/internal-service.yaml +0 -23
- lightray-0.2.4/charts/raycluster/templates/secret.yaml +0 -9
- lightray-0.2.4/charts/raycluster/templates/ssh-secret.yaml +0 -10
- lightray-0.2.4/charts/raycluster/templates/worker-deployment.yaml +0 -109
- lightray-0.2.4/charts/raycluster/values.yaml +0 -53
- lightray-0.2.4/example/cli.yaml +0 -20
- lightray-0.2.4/example/example.yaml +0 -54
- lightray-0.2.4/example/lightning.py +0 -78
- lightray-0.2.4/example/run.sh +0 -1
- lightray-0.2.4/lightray/__init__.py +0 -0
- lightray-0.2.4/uv.lock +0 -2562
- {lightray-0.2.4/example → lightray-0.2.5/lightray}/__init__.py +0 -0
- {lightray-0.2.4 → lightray-0.2.5}/lightray/fs.py +0 -0
- {lightray-0.2.4 → lightray-0.2.5}/tests/test_cli.py +0 -0
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lightray
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5
|
|
4
4
|
Summary: Distribute a LightningCLI hyperparameter search with Ray Tune
|
|
5
5
|
Author-email: Ethan Jacob Marx <ethan.marx@ligo.org>
|
|
6
|
+
Maintainer-email: Will Benoit <william.benoit@ligo.org>
|
|
6
7
|
License-Expression: MIT
|
|
7
|
-
|
|
8
|
-
Requires-
|
|
8
|
+
Project-URL: Repository, https://github.com/ML4GW/lightray
|
|
9
|
+
Requires-Python: <3.15,>=3.11
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
Requires-Dist: ray[default,tune]<3,>=2.41
|
|
9
12
|
Requires-Dist: lightning>=2.4.0
|
|
13
|
+
Requires-Dist: s3fs>=2024.9.0
|
|
14
|
+
Requires-Dist: pyarrow>=17
|
|
15
|
+
Requires-Dist: jsonargparse[signatures]<5,>=4.50
|
|
10
16
|
Requires-Dist: omegaconf<3,>=2.3.0
|
|
11
|
-
Requires-Dist:
|
|
12
|
-
Requires-Dist: ray[default,tune]<3,>=2.8.0
|
|
13
|
-
Requires-Dist: s3fs<2025,>=2024.9.0
|
|
14
|
-
Requires-Dist: wandb<0.19,>=0.18.5
|
|
15
|
-
Description-Content-Type: text/markdown
|
|
17
|
+
Requires-Dist: botocore
|
|
16
18
|
|
|
17
19
|
# lightray
|
|
18
20
|
A CLI for easily integrating `LightningCLI` with `RayTune` hyperparameter optimization
|
|
@@ -68,23 +70,21 @@ tune_config:
|
|
|
68
70
|
num_samples: 1
|
|
69
71
|
reuse_actors: true
|
|
70
72
|
|
|
71
|
-
# ray.
|
|
73
|
+
# ray.tune.RunConfig
|
|
72
74
|
run_config:
|
|
73
75
|
name: "my-first-run"
|
|
74
76
|
storage_path: s3://aframe-test/new-tune/
|
|
77
|
+
# ray.tune.FailureConfig
|
|
75
78
|
failure_config:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
max_failures: 1
|
|
79
|
+
max_failures: 1
|
|
80
|
+
# ray.tune.CheckpointConfig
|
|
79
81
|
checkpoint_config:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
checkpoint_score_attribute: "val_loss"
|
|
84
|
-
checkpoint_score_order: "min"
|
|
82
|
+
num_to_keep: 5
|
|
83
|
+
checkpoint_score_attribute: "val_loss"
|
|
84
|
+
checkpoint_score_order: "min"
|
|
85
85
|
verbose: null
|
|
86
86
|
|
|
87
|
-
# ray.
|
|
87
|
+
# ray.tune.SyncConfig
|
|
88
88
|
sync_config:
|
|
89
89
|
sync_period: 1000
|
|
90
90
|
|
|
@@ -52,23 +52,21 @@ tune_config:
|
|
|
52
52
|
num_samples: 1
|
|
53
53
|
reuse_actors: true
|
|
54
54
|
|
|
55
|
-
# ray.
|
|
55
|
+
# ray.tune.RunConfig
|
|
56
56
|
run_config:
|
|
57
57
|
name: "my-first-run"
|
|
58
58
|
storage_path: s3://aframe-test/new-tune/
|
|
59
|
+
# ray.tune.FailureConfig
|
|
59
60
|
failure_config:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
max_failures: 1
|
|
61
|
+
max_failures: 1
|
|
62
|
+
# ray.tune.CheckpointConfig
|
|
63
63
|
checkpoint_config:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
checkpoint_score_attribute: "val_loss"
|
|
68
|
-
checkpoint_score_order: "min"
|
|
64
|
+
num_to_keep: 5
|
|
65
|
+
checkpoint_score_attribute: "val_loss"
|
|
66
|
+
checkpoint_score_order: "min"
|
|
69
67
|
verbose: null
|
|
70
68
|
|
|
71
|
-
# ray.
|
|
69
|
+
# ray.tune.SyncConfig
|
|
72
70
|
sync_config:
|
|
73
71
|
sync_period: 1000
|
|
74
72
|
|
|
@@ -3,7 +3,7 @@ import time
|
|
|
3
3
|
from typing import Literal
|
|
4
4
|
|
|
5
5
|
from botocore.exceptions import ClientError, ConnectTimeoutError
|
|
6
|
-
from ray import
|
|
6
|
+
from ray import tune
|
|
7
7
|
from ray.tune.integration.pytorch_lightning import TuneReportCheckpointCallback
|
|
8
8
|
|
|
9
9
|
BOTO_RETRY_EXCEPTIONS = (ClientError, ConnectTimeoutError)
|
|
@@ -11,12 +11,12 @@ BOTO_RETRY_EXCEPTIONS = (ClientError, ConnectTimeoutError)
|
|
|
11
11
|
|
|
12
12
|
def report_with_retries(metrics, checkpoint=None, retries: int = 10):
|
|
13
13
|
"""
|
|
14
|
-
Call `
|
|
14
|
+
Call `tune.report`, which will persist checkpoints to s3,
|
|
15
15
|
retrying after any possible errors
|
|
16
16
|
"""
|
|
17
17
|
for _ in range(retries):
|
|
18
18
|
try:
|
|
19
|
-
|
|
19
|
+
tune.report(metrics=metrics, checkpoint=checkpoint)
|
|
20
20
|
break
|
|
21
21
|
except BOTO_RETRY_EXCEPTIONS:
|
|
22
22
|
time.sleep(5)
|
|
@@ -26,7 +26,7 @@ def report_with_retries(metrics, checkpoint=None, retries: int = 10):
|
|
|
26
26
|
class LightRayReportCheckpointCallback(TuneReportCheckpointCallback):
|
|
27
27
|
"""
|
|
28
28
|
Subclass of Rays TuneReportCheckpointCallback
|
|
29
|
-
with addition of a retry mechanism to the `
|
|
29
|
+
with addition of a retry mechanism to the `tune.report`
|
|
30
30
|
call to handle transient s3 errors.
|
|
31
31
|
|
|
32
32
|
Adds a `checkpoint_every` parameter to the constructor
|
|
@@ -88,6 +88,6 @@ class LightRayReportCheckpointCallback(TuneReportCheckpointCallback):
|
|
|
88
88
|
logging.debug(f"Reporting checkpoint on epoch {self.step}")
|
|
89
89
|
report_with_retries(report_dict, checkpoint=checkpoint)
|
|
90
90
|
else:
|
|
91
|
-
|
|
91
|
+
tune.report(metrics=report_dict)
|
|
92
92
|
|
|
93
93
|
self.step += 1
|
|
@@ -16,7 +16,7 @@ from jsonargparse import (
|
|
|
16
16
|
capture_parser,
|
|
17
17
|
)
|
|
18
18
|
from lightning.pytorch.cli import LightningCLI
|
|
19
|
-
from ray import
|
|
19
|
+
from ray import tune
|
|
20
20
|
from ray.tune.integration.pytorch_lightning import TuneCallback
|
|
21
21
|
|
|
22
22
|
from lightray import fs, utils
|
|
@@ -28,11 +28,11 @@ def cli(args=None):
|
|
|
28
28
|
parser.add_subclass_arguments(TuneCallback, "tune_callback")
|
|
29
29
|
parser.add_class_arguments(tune.TuneConfig, "tune_config")
|
|
30
30
|
parser.add_class_arguments(
|
|
31
|
-
|
|
31
|
+
tune.RunConfig, "run_config", skip="storage_filesystem"
|
|
32
32
|
)
|
|
33
33
|
# TODO: use add class arguments from tune.Tuner directly
|
|
34
34
|
# see https://github.com/omni-us/jsonargparse/issues/609
|
|
35
|
-
parser.add_class_arguments(
|
|
35
|
+
parser.add_class_arguments(tune.SyncConfig, "sync_config")
|
|
36
36
|
parser.add_function_arguments(ray.init, "ray_init")
|
|
37
37
|
parser.add_argument(
|
|
38
38
|
"--lightning_cli_cls",
|
|
@@ -49,12 +49,12 @@ def cli(args=None):
|
|
|
49
49
|
parser.add_argument("--cpus_per_trial", type=int, default=1)
|
|
50
50
|
|
|
51
51
|
parser.link_arguments(
|
|
52
|
-
"run_config.checkpoint_config.checkpoint_score_attribute",
|
|
52
|
+
"run_config.checkpoint_config.init_args.checkpoint_score_attribute",
|
|
53
53
|
"tune_callback.init_args.metric",
|
|
54
54
|
apply_on="parse",
|
|
55
55
|
)
|
|
56
56
|
parser.link_arguments(
|
|
57
|
-
"run_config.checkpoint_config.checkpoint_score_order",
|
|
57
|
+
"run_config.checkpoint_config.init_args.checkpoint_score_order",
|
|
58
58
|
"tune_callback.init_args.mode",
|
|
59
59
|
apply_on="parse",
|
|
60
60
|
)
|
|
@@ -97,7 +97,7 @@ def cli(args=None):
|
|
|
97
97
|
|
|
98
98
|
# instantiate tune related classes from config
|
|
99
99
|
# and parse the parameter space
|
|
100
|
-
cfg_init = parser.
|
|
100
|
+
cfg_init = parser.instantiate(cfg)
|
|
101
101
|
cfg_init.run_config.sync_config = cfg_init.sync_config
|
|
102
102
|
utils.eval_tune_run_config(cfg_init.param_space)
|
|
103
103
|
|
|
@@ -5,7 +5,7 @@ from typing import Type
|
|
|
5
5
|
from unittest.mock import patch
|
|
6
6
|
|
|
7
7
|
from lightning.pytorch.cli import LightningCLI
|
|
8
|
-
from ray import
|
|
8
|
+
from ray import tune
|
|
9
9
|
|
|
10
10
|
re_tune_func = re.compile(r"^tune.(\w+)\((.+)\)$")
|
|
11
11
|
|
|
@@ -40,7 +40,7 @@ def get_trainable(
|
|
|
40
40
|
args.append(f"--{key}={val}")
|
|
41
41
|
|
|
42
42
|
# setup lightning logger path to point to ray trial dir
|
|
43
|
-
log_dir =
|
|
43
|
+
log_dir = tune.get_context().get_trial_dir()
|
|
44
44
|
args.append(f"--trainer.logger.save_dir={log_dir}")
|
|
45
45
|
|
|
46
46
|
# get ckpt prefix based on fs
|
|
@@ -50,7 +50,7 @@ def get_trainable(
|
|
|
50
50
|
ckpt_prefix = "s3://"
|
|
51
51
|
|
|
52
52
|
# restore from checkpoint if available
|
|
53
|
-
checkpoint =
|
|
53
|
+
checkpoint = tune.get_checkpoint()
|
|
54
54
|
ckpt_path = None
|
|
55
55
|
if checkpoint:
|
|
56
56
|
ckpt_path = os.path.join(
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lightray
|
|
3
|
+
Version: 0.2.5
|
|
4
|
+
Summary: Distribute a LightningCLI hyperparameter search with Ray Tune
|
|
5
|
+
Author-email: Ethan Jacob Marx <ethan.marx@ligo.org>
|
|
6
|
+
Maintainer-email: Will Benoit <william.benoit@ligo.org>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Repository, https://github.com/ML4GW/lightray
|
|
9
|
+
Requires-Python: <3.15,>=3.11
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
Requires-Dist: ray[default,tune]<3,>=2.41
|
|
12
|
+
Requires-Dist: lightning>=2.4.0
|
|
13
|
+
Requires-Dist: s3fs>=2024.9.0
|
|
14
|
+
Requires-Dist: pyarrow>=17
|
|
15
|
+
Requires-Dist: jsonargparse[signatures]<5,>=4.50
|
|
16
|
+
Requires-Dist: omegaconf<3,>=2.3.0
|
|
17
|
+
Requires-Dist: botocore
|
|
18
|
+
|
|
19
|
+
# lightray
|
|
20
|
+
A CLI for easily integrating `LightningCLI` with `RayTune` hyperparameter optimization
|
|
21
|
+
|
|
22
|
+
## Getting Started
|
|
23
|
+
Imagine you have the following lightning `DataModule`, `LightningModule` and `LightningCLI`
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from lightning.pytorch as pl
|
|
27
|
+
|
|
28
|
+
class DataModule(pl.LightningDataModule):
|
|
29
|
+
def __init__(self, hidden_dim: int, learning_rate: float, parameter: int):
|
|
30
|
+
self.parameter = parameter
|
|
31
|
+
self.hidden_dim = hidden_dim
|
|
32
|
+
self.learning_rate = learning_rate
|
|
33
|
+
|
|
34
|
+
def train_dataloader(self):
|
|
35
|
+
...
|
|
36
|
+
|
|
37
|
+
class LightningModule(pl.LightningModule):
|
|
38
|
+
def __init__(self, parameter: int):
|
|
39
|
+
self.parameter = parameter
|
|
40
|
+
|
|
41
|
+
def training_step(self):
|
|
42
|
+
...
|
|
43
|
+
|
|
44
|
+
class CustomCLI(pl.cli.LightningCLI):
|
|
45
|
+
def add_arguments_to_parser(self, parser):
|
|
46
|
+
parser.link_arguments(
|
|
47
|
+
"data.init_args.parameter",
|
|
48
|
+
"model.init_args.parameter",
|
|
49
|
+
apply_on="parse"
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
To launching a hyperparameter tuning job with `RayTune` using this `LightningCLI` can be done by configuring
|
|
55
|
+
a `yaml` that looks like the following
|
|
56
|
+
|
|
57
|
+
```yaml
|
|
58
|
+
# tune.yaml
|
|
59
|
+
|
|
60
|
+
# ray.tune.TuneConfig
|
|
61
|
+
tune_config:
|
|
62
|
+
mode: "min"
|
|
63
|
+
metric: "val_loss"
|
|
64
|
+
scheduler:
|
|
65
|
+
class_path: ray.tune.schedulers.ASHAScheduler
|
|
66
|
+
init_args:
|
|
67
|
+
max_t: 200
|
|
68
|
+
grace_period: 21
|
|
69
|
+
reduction_factor: 2
|
|
70
|
+
num_samples: 1
|
|
71
|
+
reuse_actors: true
|
|
72
|
+
|
|
73
|
+
# ray.tune.RunConfig
|
|
74
|
+
run_config:
|
|
75
|
+
name: "my-first-run"
|
|
76
|
+
storage_path: s3://aframe-test/new-tune/
|
|
77
|
+
# ray.tune.FailureConfig
|
|
78
|
+
failure_config:
|
|
79
|
+
max_failures: 1
|
|
80
|
+
# ray.tune.CheckpointConfig
|
|
81
|
+
checkpoint_config:
|
|
82
|
+
num_to_keep: 5
|
|
83
|
+
checkpoint_score_attribute: "val_loss"
|
|
84
|
+
checkpoint_score_order: "min"
|
|
85
|
+
verbose: null
|
|
86
|
+
|
|
87
|
+
# ray.tune.SyncConfig
|
|
88
|
+
sync_config:
|
|
89
|
+
sync_period: 1000
|
|
90
|
+
|
|
91
|
+
# ray.init
|
|
92
|
+
ray_init:
|
|
93
|
+
address: null
|
|
94
|
+
|
|
95
|
+
# tune.Tune.param_space
|
|
96
|
+
param_space:
|
|
97
|
+
model.learning_rate: tune.loguniform(1e-3, 4)
|
|
98
|
+
|
|
99
|
+
# ray.tune.TuneCallback
|
|
100
|
+
tune_callback:
|
|
101
|
+
class_path: lightray.callbacks.LightRayReportCheckpointCallback
|
|
102
|
+
init_args:
|
|
103
|
+
'on': "validation_end"
|
|
104
|
+
checkpoint_every: 10
|
|
105
|
+
|
|
106
|
+
# resources per trial
|
|
107
|
+
cpus_per_trial: 2
|
|
108
|
+
gpus_per_trial: 1
|
|
109
|
+
|
|
110
|
+
# lightning cli class to tune
|
|
111
|
+
lightning_cli_cls: example.lightning.Cli
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Then, launch the tuning job.
|
|
115
|
+
|
|
116
|
+
```console
|
|
117
|
+
lightray --config tune.yaml -- --config cli.yaml
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Any arguments passed after "--" will automatically be forwarded to the specified `LightningCLI` class as if it were being run from the command line. This way, tuning configuration and training configuration can be kept separate. Also, you can easily utilize existing configuration files compatible with your `LightningCLI`.
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
## S3 Support
|
|
124
|
+
In addition, there is automatic support for `s3` storage. Make sure you have set the `AWS_ENDPOINT_URL`, `AWS_ACCESS_KEY_ID`, and `AWS_SECRET_ACCESS_KEY` environment variables.
|
|
125
|
+
Then, simply pass the path to your bucket with the `s3` prefix (e.g. `s3://{bucket}/{folder}`) to the `run_config.storage_path` argument.
|
|
126
|
+
|
|
127
|
+
```console
|
|
128
|
+
lightray --config tune.yaml --run_config.storage_path s3://{bucket}/{folder}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
There is also a wrapper around the `ray.tune.integration.pytorch_lightning.TuneReportCheckpointCallback` that will do checkpoint reporting with retries to handle transient s3 errors.
|
|
132
|
+
This is provided at `lightray.callbacks.LightRayReportCheckpointCallback`
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
## Remote cluster
|
|
136
|
+
To connect to a remote ray cluster, pass the ip address (using port `10001`) to `ray_init.address`:
|
|
137
|
+
|
|
138
|
+
```console
|
|
139
|
+
lightray --config tune.yaml --ray_init.address ray://{ip}:10001 -- --config cli.yaml
|
|
140
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
lightray/__init__.py
|
|
4
|
+
lightray/callbacks.py
|
|
5
|
+
lightray/cli.py
|
|
6
|
+
lightray/fs.py
|
|
7
|
+
lightray/utils.py
|
|
8
|
+
lightray.egg-info/PKG-INFO
|
|
9
|
+
lightray.egg-info/SOURCES.txt
|
|
10
|
+
lightray.egg-info/dependency_links.txt
|
|
11
|
+
lightray.egg-info/entry_points.txt
|
|
12
|
+
lightray.egg-info/requires.txt
|
|
13
|
+
lightray.egg-info/top_level.txt
|
|
14
|
+
tests/test_cli.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
lightray
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "lightray"
|
|
3
|
-
|
|
3
|
+
dynamic = ["version"]
|
|
4
4
|
description = "Distribute a LightningCLI hyperparameter search with Ray Tune"
|
|
5
5
|
authors = [{ name = "Ethan Jacob Marx", email = "ethan.marx@ligo.org" }]
|
|
6
|
-
|
|
6
|
+
maintainers = [{ name = "Will Benoit", email = "william.benoit@ligo.org" }]
|
|
7
|
+
requires-python = ">=3.11,<3.15"
|
|
7
8
|
readme = "README.md"
|
|
8
9
|
license = "MIT"
|
|
9
10
|
dependencies = [
|
|
10
|
-
"ray[default, tune]>=2.
|
|
11
|
+
"ray[default, tune]>=2.41,<3",
|
|
11
12
|
"lightning>=2.4.0",
|
|
12
|
-
"s3fs>=2024.9.0
|
|
13
|
-
"pyarrow>=17
|
|
14
|
-
"jsonargparse[signatures]>=4.
|
|
15
|
-
"wandb>=0.18.5,<0.19",
|
|
13
|
+
"s3fs>=2024.9.0",
|
|
14
|
+
"pyarrow>=17",
|
|
15
|
+
"jsonargparse[signatures]>=4.50,<5",
|
|
16
16
|
"omegaconf>=2.3.0,<3",
|
|
17
|
+
"botocore",
|
|
17
18
|
]
|
|
18
19
|
|
|
20
|
+
[project.urls]
|
|
21
|
+
Repository = "https://github.com/ML4GW/lightray"
|
|
22
|
+
|
|
19
23
|
[project.scripts]
|
|
20
24
|
lightray = "lightray.cli:cli"
|
|
21
25
|
|
|
@@ -25,9 +29,18 @@ dev = [
|
|
|
25
29
|
"pytest>=8.3.2,<9",
|
|
26
30
|
]
|
|
27
31
|
|
|
32
|
+
[tool.setuptools.packages.find]
|
|
33
|
+
include = ["lightray*"]
|
|
34
|
+
|
|
35
|
+
[tool.setuptools-git-versioning]
|
|
36
|
+
enabled = true
|
|
37
|
+
# skip the helm chart release tags (ray-cluster-*)
|
|
38
|
+
tag_filter = "v.*"
|
|
39
|
+
dev_template = "{tag}.post{ccount}+git.{sha}"
|
|
40
|
+
|
|
28
41
|
[build-system]
|
|
29
|
-
requires = ["
|
|
30
|
-
build-backend = "
|
|
42
|
+
requires = [ "setuptools>=77.0.3", "wheel", "setuptools-git-versioning>=2.0,<4",]
|
|
43
|
+
build-backend = "setuptools.build_meta"
|
|
31
44
|
|
|
32
45
|
[tool.ruff]
|
|
33
46
|
line-length = 79
|
|
@@ -36,7 +49,7 @@ extend-exclude = ["docs"]
|
|
|
36
49
|
|
|
37
50
|
[tool.ruff.lint]
|
|
38
51
|
mccabe = {"max-complexity" = 18}
|
|
39
|
-
select = ["B", "C", "E", "F", "W",
|
|
52
|
+
select = ["B", "C", "E", "F", "W", "B9", "T201"]
|
|
40
53
|
ignore = ["W605", "E203"] # ignore for consistency with black
|
|
41
54
|
|
|
42
55
|
# ignore asterisk imports and unused
|
lightray-0.2.5/setup.cfg
ADDED
lightray-0.2.4/.flake8
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
[flake8]
|
|
2
|
-
max-line-length = 79
|
|
3
|
-
max-complexity = 18
|
|
4
|
-
select = B,C,E,F,W,T4,B9
|
|
5
|
-
ignore = W503, E203 # ignore for consistency with black
|
|
6
|
-
|
|
7
|
-
# ignore asterisk imports and unused
|
|
8
|
-
# import errors in __init__ files
|
|
9
|
-
per-file-ignores =
|
|
10
|
-
**/__init__.py:F401,F403,E402
|
|
11
|
-
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
name: Release Charts
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
paths:
|
|
8
|
-
- 'charts/**'
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
release:
|
|
12
|
-
permissions:
|
|
13
|
-
contents: write
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
steps:
|
|
16
|
-
- name: Checkout
|
|
17
|
-
uses: actions/checkout@v3
|
|
18
|
-
with:
|
|
19
|
-
fetch-depth: 0
|
|
20
|
-
|
|
21
|
-
- name: Configure Git
|
|
22
|
-
run: |
|
|
23
|
-
git config user.name "$GITHUB_ACTOR"
|
|
24
|
-
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
|
25
|
-
|
|
26
|
-
- name: Install Helm
|
|
27
|
-
uses: azure/setup-helm@v3
|
|
28
|
-
|
|
29
|
-
- name: Run chart-releaser
|
|
30
|
-
uses: helm/chart-releaser-action@v1.6.0
|
|
31
|
-
env:
|
|
32
|
-
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
name: pre-commit
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
push:
|
|
6
|
-
branches:
|
|
7
|
-
- main
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
pre-commit:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
steps:
|
|
13
|
-
- uses: actions/checkout@v2
|
|
14
|
-
- uses: actions/setup-python@v2
|
|
15
|
-
with:
|
|
16
|
-
python-version: "3.9"
|
|
17
|
-
- uses: pre-commit/action@v2.0.3
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
name: Publish to PyPI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
release:
|
|
5
|
-
types: [published]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
publish:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
environment: PyPI
|
|
11
|
-
steps:
|
|
12
|
-
- uses: actions/checkout@v4
|
|
13
|
-
|
|
14
|
-
- name: Install uv
|
|
15
|
-
uses: astral-sh/setup-uv@v3
|
|
16
|
-
with:
|
|
17
|
-
enable-cache: true
|
|
18
|
-
cache-dependency-glob: uv.lock
|
|
19
|
-
|
|
20
|
-
- name: Set up Python
|
|
21
|
-
run: uv python install 3.12
|
|
22
|
-
|
|
23
|
-
- name: Build
|
|
24
|
-
run: uv build
|
|
25
|
-
|
|
26
|
-
- name: Publish
|
|
27
|
-
run: uv publish -t ${{ secrets.PYPI_TOKEN }}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
name: unit-tests
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
push:
|
|
6
|
-
branches:
|
|
7
|
-
- main
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
test:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
strategy:
|
|
13
|
-
fail-fast: false
|
|
14
|
-
matrix:
|
|
15
|
-
python-version: ['3.9', '3.10', '3.11']
|
|
16
|
-
steps:
|
|
17
|
-
- uses: actions/checkout@v2
|
|
18
|
-
|
|
19
|
-
# set up our environment
|
|
20
|
-
-
|
|
21
|
-
name: Install Python
|
|
22
|
-
uses: actions/setup-python@v2
|
|
23
|
-
with:
|
|
24
|
-
python-version: ${{ matrix.python-version }}
|
|
25
|
-
-
|
|
26
|
-
name: Install package
|
|
27
|
-
run: |
|
|
28
|
-
python -m pip install .
|
|
29
|
-
python -m pip install pytest
|
|
30
|
-
|
|
31
|
-
# run the library's tests
|
|
32
|
-
-
|
|
33
|
-
name: run tests
|
|
34
|
-
run: python -m pytest tests/
|
lightray-0.2.4/.gitignore
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
repos:
|
|
2
|
-
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
3
|
-
rev: v0.9.6
|
|
4
|
-
hooks:
|
|
5
|
-
- id: ruff
|
|
6
|
-
args: [ --fix ]
|
|
7
|
-
- id: ruff-format
|
|
8
|
-
- repo: https://github.com/astral-sh/uv-pre-commit
|
|
9
|
-
# uv version.
|
|
10
|
-
rev: 0.6.0
|
|
11
|
-
hooks:
|
|
12
|
-
- id: uv-lock
|
|
13
|
-
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
14
|
-
rev: v2.3.0
|
|
15
|
-
hooks:
|
|
16
|
-
- id: end-of-file-fixer
|
|
17
|
-
- id: check-yaml
|
|
18
|
-
exclude: ^charts/raycluster/templates/
|
|
19
|
-
- repo: https://github.com/gruntwork-io/pre-commit
|
|
20
|
-
rev: v0.1.15
|
|
21
|
-
hooks:
|
|
22
|
-
- id: helmlint
|
|
23
|
-
- repo: https://github.com/dhruvmanila/remove-print-statements
|
|
24
|
-
rev: v0.5.2
|
|
25
|
-
hooks:
|
|
26
|
-
- id: remove-print-statements
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Patterns to ignore when building packages.
|
|
2
|
-
# This supports shell glob matching, relative path matching, and
|
|
3
|
-
# negation (prefixed with !). Only one pattern per line.
|
|
4
|
-
.DS_Store
|
|
5
|
-
# Common VCS dirs
|
|
6
|
-
.git/
|
|
7
|
-
.gitignore
|
|
8
|
-
.bzr/
|
|
9
|
-
.bzrignore
|
|
10
|
-
.hg/
|
|
11
|
-
.hgignore
|
|
12
|
-
.svn/
|
|
13
|
-
# Common backup files
|
|
14
|
-
*.swp
|
|
15
|
-
*.bak
|
|
16
|
-
*.tmp
|
|
17
|
-
*.orig
|
|
18
|
-
*~
|
|
19
|
-
# Various IDEs
|
|
20
|
-
.project
|
|
21
|
-
.idea/
|
|
22
|
-
*.tmproj
|
|
23
|
-
.vscode/
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
apiVersion: v2
|
|
2
|
-
name: ray-cluster
|
|
3
|
-
description: Deploy static ray clusters with Kubernetes.
|
|
4
|
-
|
|
5
|
-
# A chart can be either an 'application' or a 'library' chart.
|
|
6
|
-
#
|
|
7
|
-
# Application charts are a collection of templates that can be packaged into versioned archives
|
|
8
|
-
# to be deployed.
|
|
9
|
-
#
|
|
10
|
-
# Library charts provide useful utilities or functions for the chart developer. They're included as
|
|
11
|
-
# a dependency of application charts to inject those utilities and functions into the rendering
|
|
12
|
-
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
|
|
13
|
-
type: application
|
|
14
|
-
|
|
15
|
-
# This is the chart version. This version number should be incremented each time you make changes
|
|
16
|
-
# to the chart and its templates, including the app version.
|
|
17
|
-
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
|
18
|
-
version: 0.1.6
|
|
19
|
-
|
|
20
|
-
# This is the version number of the application being deployed. This version number should be
|
|
21
|
-
# incremented each time you make changes to the application. Versions are not expected to
|
|
22
|
-
# follow Semantic Versioning. They should reflect the version the application is using.
|
|
23
|
-
# It is recommended to use it with quotes.
|
|
24
|
-
appVersion: "1.16.0"
|
|
File without changes
|