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

Parameterized k8s volume mount in session config #100

Merged
merged 4 commits into from
Jan 22, 2021

Conversation

lidongze0629
Copy link
Collaborator

Fixes #47

@codecov-io
Copy link

codecov-io commented Jan 22, 2021

Codecov Report

Merging #100 (5aa8a26) into main (1d2a541) will increase coverage by 0.02%.
The diff coverage is 35.89%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #100      +/-   ##
==========================================
+ Coverage   78.05%   78.07%   +0.02%     
==========================================
  Files          50       50              
  Lines        4511     4529      +18     
==========================================
+ Hits         3521     3536      +15     
- Misses        990      993       +3     
Impacted Files Coverage Δ
python/graphscope/client/session.py 73.07% <ø> (ø)
...n/graphscope/deploy/kubernetes/resource_builder.py 60.50% <24.24%> (-1.20%) ⬇️
python/graphscope/config.py 100.00% <100.00%> (ø)
python/graphscope/deploy/kubernetes/cluster.py 74.63% <100.00%> (+2.43%) ⬆️
python/graphscope/deploy/tests/test_demo_script.py 99.03% <100.00%> (+0.02%) ⬆️
python/graphscope/deploy/kubernetes/utils.py 74.11% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d2a541...5aa8a26. Read the comment docs.

Copy link
Collaborator

@sighingnow sighingnow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@@ -33,7 +33,7 @@ function _start {
sleep 5s
curl -XPOST http://localhost:${_port} -d 'import graphscope'
curl -XPOST http://localhost:${_port} -d 'from graphscope.framework.loader import Loader'
curl_sess="curl -XPOST http://localhost:${_port} -d 'session = graphscope.session(num_workers=${workers}, show_log=True, k8s_coordinator_cpu=1.0, k8s_coordinator_mem='\''4Gi'\'', k8s_vineyard_cpu=1.0, k8s_vineyard_mem='\''4Gi'\'', k8s_vineyard_shared_mem='\''4Gi'\'', k8s_engine_cpu=1.0, k8s_engine_mem='\''4Gi'\'', k8s_gie_graph_manager_image='\''${gie_manager_image}'\'', k8s_gs_image='\''${gs_image}'\'')' --write-out %{http_code} --silent --output ./curl.tmp"
curl_sess="curl -XPOST http://localhost:${_port} -d 'session = graphscope.session(num_workers=${workers}, show_log=True, k8s_volumes={\"data\": {\"type\": \"hostPath\", \"field\": {\"path\": \"${GS_TEST_DIR}\", \"type\": \"Directory\"}, \"mounts\": {\"mountPath\": \"/testingdata\"}}}, k8s_coordinator_cpu=1.0, k8s_coordinator_mem='\''4Gi'\'', k8s_vineyard_cpu=1.0, k8s_vineyard_mem='\''4Gi'\'', k8s_vineyard_shared_mem='\''4Gi'\'', k8s_engine_cpu=1.0, k8s_engine_mem='\''4Gi'\'', k8s_gie_graph_manager_image='\''${gie_manager_image}'\'', k8s_gs_image='\''${gs_image}'\'')' --write-out %{http_code} --silent --output ./curl.tmp"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks that we still need GS_TEST_DIR, but we delete that in scripts/test.sh. Is that desired?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, already remove all hard code GS_TEST_DIR in python code.

}
]
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Only 'hostPath' supported yet." -> "Only 'hostPath' is supported."

Add more about the docstring:

  1. If we just want to mount a single volume, could we write: "mounts": {"mountPath": "<path1>"}?
  2. will we resolve the environment varaibles if $ exists in the "path" or "mountPath"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Yes. you can. I have updated the doc.
  2. Thanks for your advice. I think there is some confusion for users if we support parsing env variables because it occurs in coordinator pod, instead of python client. If we do that, we also have to support passing env in session params.

"--k8s_volumes",
type=str,
default="{}",
help="A str of dict for kubernetes volumes.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"A str of dict" -> "A json string"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot.

@sighingnow sighingnow requested a review from yecol January 22, 2021 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parameterized k8s volume mount in session config.
3 participants