Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AIP-8056 disable volume_mode="ReadWriteMany" test #282

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 37 additions & 36 deletions metaflow/plugins/aip/tests/flows/resources_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,44 +208,45 @@ def join_step(self, inputs):
"df -h | grep /opt/metaflow_volume", shell=True
)
assert "12G" in str(output)
self.next(self.split_step)

@step
def split_step(self):
self.items = [1, 2]
self.next(self.shared_volume_foreach_step, foreach="items")

@resources(volume="13G", volume_mode="ReadWriteMany")
@step
def shared_volume_foreach_step(self):
output = subprocess.check_output(
"df -h | grep /opt/metaflow_volume", shell=True
)
assert "13G" in str(output)

file_path = "/opt/metaflow_volume/test.txt"
message = "hello world!"

# validate the volume is shared across the foreach splits
if self.input == 1:
with open(file_path, "w") as f:
f.write(message)
else:
while not os.path.exists(file_path):
time.sleep(1)
print(".")

with open(file_path, "r") as f:
read_lines = f.readlines()
print("read_lines", read_lines)
assert message == read_lines[0]

self.next(self.shared_volume_join_step)

@step
def shared_volume_join_step(self, inputs):
self.next(self.end)

# AIP-8056(talebz): Flaky WFSDK test volume_mode=“ReadWriteMany”
# @step
# def split_step(self):
# self.items = [1, 2]
# self.next(self.shared_volume_foreach_step, foreach="items")
#
# @resources(volume="13G", volume_mode="ReadWriteMany")
# @step
# def shared_volume_foreach_step(self):
# output = subprocess.check_output(
# "df -h | grep /opt/metaflow_volume", shell=True
# )
# assert "13G" in str(output)
#
# file_path = "/opt/metaflow_volume/test.txt"
# message = "hello world!"
#
# # validate the volume is shared across the foreach splits
# if self.input == 1:
# with open(file_path, "w") as f:
# f.write(message)
# else:
# while not os.path.exists(file_path):
# time.sleep(1)
# print(".")
#
# with open(file_path, "r") as f:
# read_lines = f.readlines()
# print("read_lines", read_lines)
# assert message == read_lines[0]
#
# self.next(self.shared_volume_join_step)
#
# @step
# def shared_volume_join_step(self, inputs):
# self.next(self.end)

@step
def end(self):
print("All done.")
Expand Down
Loading