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
fix: Fix issue with volume mount #194
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting the PR. Looks like you are still working on it so I changed it to WIP. Let me know when it's ready for review.
Hi, Changes I did in couler, I don't know if it is somehow fits your idea, also if you have any comments on this. |
couler/core/templates/container.py
Outdated
@@ -70,6 +70,12 @@ def __init__( | |||
self.node_selector = node_selector | |||
self.volumes = volumes | |||
|
|||
def get_volumeMounts_name(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use consistent function names
couler/core/templates/workflow.py
Outdated
@@ -158,6 +166,22 @@ def to_dict(self): | |||
"Unsupported signature for cluster spec: %s" % sig | |||
) | |||
ts.append(template_dict) | |||
#check volumes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some tests to make sure the existing and new use cases are covered?
couler/core/templates/workflow.py
Outdated
@@ -201,6 +225,7 @@ def to_dict(self): | |||
else: | |||
d["spec"] = workflow_spec | |||
|
|||
print(d) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this?
couler/core/templates/workflow.py
Outdated
})) | ||
|
||
if self.volumes: | ||
print(self.volumes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove?
couler/core/templates/container.py
Outdated
template["volumes"].append( | ||
{"name": volume_mount.name, "emptyDir": {}} | ||
) | ||
# # Volume |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented code if no longer needed
couler/tests/volume_test.py
Outdated
@@ -0,0 +1,17 @@ | |||
import os |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like an integration test so perhaps move it to integration tests folder and make sure to test this on CI as well similar to others.
Hi Terry, Sorry for the late response, Thanks for your comments! Best, |
Please address unsolved comments and fix failed CI builds. Thanks. |
The sanity check failed https://github.com/couler-proj/couler/runs/2614334892 Please check out the instruction here on how to fix it: https://github.com/couler-proj/couler/blob/master/CONTRIBUTING.md#run-sanity-checks |
@@ -51,3 +48,6 @@ spec: | |||
- cowsay | |||
args: | |||
- "{{inputs.parameters.para-consumer-0}}" | |||
volumes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change doesn't look correct? It should be part of the template? (similar in other YAML files)
go.sum
Outdated
@@ -741,6 +748,10 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w | |||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | |||
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd h1:5CtCZbICpIOFdgO940moixOPjc0178IU44m4EjOO5IY= | |||
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | |||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | |||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what introduced these changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
I think it because I was trying to run integrated tests locally. But I think my go env(proto3) has some version problems.
I have removed these changes.
integration_tests/volume_example.py
Outdated
], | ||
volume_mounts=[VolumeMount("apppath", "/tmp")], | ||
) | ||
# 3) Add an exit handler that runs when the workflow succeeds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplify this example by removing the exit handler
integration_tests/volume_example.py
Outdated
' vol_found=`mount | grep /tmp` && \ | ||
if [[ -n $vol_found ]]; \ | ||
then echo "Volume mounted and found"; \ | ||
else echo "Not found"; fi ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we know if this is correct? Should we be exiting 0 and non-zero here instead of just echo-ing here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I removed the handler, and add exit -1 instead of not found.
@peiniliu Thanks for fixing the tests. I previous overlooked some of the details and just left some additional (minor) comments. Please take another look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
What changes were proposed in this pull request?
fix Issue #193
Why are the changes needed?
fix Issue #193
Does this PR introduce any user-facing change?
No
How was this patch tested?
volume_test.py