-
Notifications
You must be signed in to change notification settings - Fork 549
Add an operator [ paictl conf update ] to upload configuration to k8s #1431
Conversation
@@ -64,6 +64,9 @@ sudo chown core:core -R /pathHadoop/ | |||
QUICK_START_PATH=${JENKINS_HOME}/${BED}/singlebox/quick-start | |||
CONFIG_PATH=${JENKINS_HOME}/${BED}/singlebox/cluster-configuration | |||
|
|||
# Install necessary python package | |||
sudo pip install GitPython |
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 we remove the line? Noticed that you have updated the dependencies in dev-box
.
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.
No we can't. paictl need import it. You will call paictl to generate cluster-configuration out of the dev-box.
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.
|
||
|
||
|
||
def open(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.
maybe you can use __enter__
and __exit__
, which is more elegant, and can clean storage in exit.
Same applies to local_storage
.
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.
Changed
|
||
self.time = str(int(time.time())) | ||
self.logger = logging.getLogger(__name__) | ||
self.local_store = "{0}-{1}".format(local_store, self.time) |
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.
why not using tempfile
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.
We will have to remove the temp directory created by tempfile.mkdtemp([suffix=''[, prefix='tmp'[, dir=None]]])
. And I think it's same as what we have done. Here I prefer manually handle it.
|
||
def git_clone(self): | ||
try: | ||
self.repo = git.Repo.clone_from(self.repo_url, self.local_store, branch=self.branch) |
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.
can we just clone with --depth=1
, since we requires no history.
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.
Changed.
…into yuye/external-git
Progress
Change
paictl
will get the configuration from k8s-configmap. So next time, admin should update their cluster configuration from external storage to the cluster. Then manage the openpai cluster.