-
Notifications
You must be signed in to change notification settings - Fork 76
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
Hostpath volume #60
Hostpath volume #60
Conversation
paddlecloud/paddlecloud/settings.py
Outdated
#DATACENTERS = { | ||
# ... | ||
# "dc1":{ | ||
# "type": "hostpath", |
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.
Maybe fstype
is better?
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.
Done.
paddlecloud/paddlecloud/settings.py
Outdated
@@ -270,6 +270,15 @@ | |||
# "admin_key": "/certs/admin.secret" |
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.
Should contain type
in this example.
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.
type
=> fstype
Done.
paddlecloud/paddlejob/views.py
Outdated
)) | ||
if dc == name: | ||
if cfg["type"] == "cephfs": | ||
volumes.append(CephFSVolume( |
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.
Check if monitors_addr
user
secret
exists. Return an error code when parameters not found.
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.
These parameters are in settings.py, I think we can check the configurations at the start-up phase of the cloud server. And maybe implement this feature in another PR is suitable.
@@ -0,0 +1,4 @@ | |||
from cephfs_volume import CephFSVolume |
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.
It seems package volume
is too small to exist. We can have:
def get_volume_config(**kwargs):
__check_parameters(kwargs)
tmpl = __get_template(kwargs["type"])
return json.loads(__render(tmpl, kwargs))
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.
Good point!I have use templates instead of package volume.Thanks a lot!
Done.
paddlecloud/paddlejob/volume.py
Outdated
} | ||
|
||
def __render(tmpl, **kwargs): | ||
tmpl.replace("$NAME", "sfsdf") |
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 line is not needed.
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.
Done.
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.
LGTM
Fixed #51