Skip to content

Commit ff27ee7

Browse files
authored
Add node availability zone variable for aws (#25)
* add node availability zone variable for aws Signed-off-by: vsoch <vsoch@users.noreply.github.com>
1 parent e808b5c commit ff27ee7

10 files changed

Lines changed: 8 additions & 16 deletions

File tree

docs/getting_started/aws.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ variables:
6666

6767
# Customize availability zones for this experiment
6868
availability_zones: [us-east-1a, us-east-1b]
69+
70+
# Important for instance types only in one zone (hpc instances)
71+
# Select your node group availability zone:
72+
node_group_availability_zone: us-east-2b
6973
```
7074
7175
Note that we currently take a simple approach for boolean values - if it's present (e.g., the examples)

fluxcloud/client/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313

1414
def main(args, parser, extra, subparser):
15-
1615
fluxcloud.utils.ensure_no_extra(extra)
1716

1817
# If nothing provided, show help

fluxcloud/client/shell.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
def main(args, parser, extra, subparser):
11-
1211
fluxcloud.utils.ensure_no_extra(extra)
1312
lookup = {"ipython": ipython, "python": python, "bpython": bpython}
1413
shells = ["ipython", "python", "bpython"]
@@ -32,7 +31,6 @@ def main(args, parser, extra, subparser):
3231

3332

3433
def create_client(args):
35-
3634
cli = Client(
3735
quiet=args.quiet,
3836
settings_file=args.settings_file,

fluxcloud/logger.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def add_prefix(msg, char=">>"):
3838

3939

4040
class ColorizingStreamHandler(_logging.StreamHandler):
41-
4241
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
4342
RESET_SEQ = LogColors.ENDC
4443
COLOR_SEQ = "\033[%dm"

fluxcloud/main/api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ def submit(self, setup, experiment, size):
8484
# Sleep time will be time of last job, assuming they are similar
8585
sleep_time = 5
8686
for jobname, job in experiment.jobs.items():
87-
8887
# Do we want to run this job for this size and machine?
8988
if not experiment.check_job_run(job, size):
9089
logger.debug(

fluxcloud/main/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ def submit(self, setup, experiment):
181181

182182
# Iterate through all the cluster sizes
183183
for size in experiment.minicluster["size"]:
184-
185184
# We can't run if the minicluster > the experiment size
186185
if size > experiment.size:
187186
logger.warning(
@@ -223,7 +222,6 @@ def apply(self, setup, experiment):
223222
experiment_dir = experiment.root_dir
224223

225224
for size, jobname, job in experiment.iter_jobs():
226-
227225
# Add the size
228226
jobname = f"{jobname}-minicluster-size-{size}"
229227
job_output = os.path.join(experiment_dir, jobname)
@@ -265,13 +263,15 @@ def apply(self, setup, experiment):
265263
# Apply the job, and save to output directory
266264
self.run_timed(f"{self.job_prefix}-{jobname}", ["/bin/bash", apply_script])
267265

266+
# Save times between experiment runs
267+
experiment.save_metadata(self.times, self.info)
268+
268269
def clear_minicluster_times(self):
269270
"""
270271
Update times to not include jobs
271272
"""
272273
times = {}
273274
for key, value in self.times.items():
274-
275275
# Don't add back a job that was already saved
276276
if key.startswith(self.job_prefix):
277277
continue

fluxcloud/main/clouds/aws/templates/cluster-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ managedNodeGroups:
1616
minSize: {{ experiment.size }}
1717
maxSize: {{ experiment.size }}
1818
labels: { "fluxoperator": "true" }
19+
{% if variables['node_group_availability_zone'] %}availabilityZones: ["{{ variables['node_group_availability_zone'] }}"]{% endif %}
1920
{% if variables['ssh_key'] %}ssh:
2021
allow: true
2122
publicKeyPath: {{ variables['ssh_key'] }}{% endif %}

fluxcloud/main/decorator.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class save_meta(Decorator):
2222
"""
2323

2424
def __call__(self, cls, *args, **kwargs):
25-
2625
# Name of the key is after command
2726
idx = 0
2827
if "setup" in kwargs:
@@ -52,7 +51,6 @@ class timed(Decorator):
5251
"""
5352

5453
def __call__(self, cls, *args, **kwargs):
55-
5654
# Name of the key is after command
5755
if "name" in kwargs:
5856
key = kwargs["name"]

fluxcloud/main/experiment.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ def iter_jobs(self):
173173

174174
# Iterate through all the cluster sizes
175175
for size in minicluster["size"]:
176-
177176
# We can't run if the minicluster > the experiment size
178177
if size > self.size:
179178
logger.warning(
@@ -183,7 +182,6 @@ def iter_jobs(self):
183182

184183
# Jobname is used for output
185184
for jobname, job in self.jobs.items():
186-
187185
# Do we want to run this job for this size and machine?
188186
if not self.check_job_run(job, size):
189187
logger.debug(
@@ -199,7 +197,6 @@ def get_persistent_variables(self, size, required=None):
199197
"""
200198
jobvars = {}
201199
for _, job in self.jobs.items():
202-
203200
# Skip jobs targeted for a different size
204201
if "size" in job and job["size"] != size:
205202
continue
@@ -302,7 +299,6 @@ def is_run(self):
302299

303300
# If all job output files exist, experiment is considered run
304301
for size in self.minicluster["size"]:
305-
306302
# We can't run if the minicluster > the experiment size
307303
if size > self.size:
308304
logger.warning(
@@ -312,7 +308,6 @@ def is_run(self):
312308

313309
# Jobname is used for output
314310
for jobname, job in self.jobs.items():
315-
316311
# Do we want to run this job for this size and machine?
317312
if not self.check_job_run(job, size):
318313
logger.debug(

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ def get_reqs(lookup=None, key="INSTALL_REQUIRES"):
6565

6666

6767
if __name__ == "__main__":
68-
6968
INSTALL_REQUIRES = get_reqs(lookup)
7069
TESTS_REQUIRES = get_reqs(lookup, "TESTS_REQUIRES")
7170
INSTALL_REQUIRES_ALL = get_reqs(lookup, "INSTALL_REQUIRES_ALL")

0 commit comments

Comments
 (0)