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

Add Katib Client in v1alpha2 #480

Merged
merged 7 commits into from
May 1, 2019

Conversation

andreyvelich
Copy link
Member

@andreyvelich andreyvelich commented Apr 29, 2019

I added Katib Client functionality in the util.
We need it for the UI, like we have here:
https://github.com/kubeflow/katib/blob/master/pkg/manager/v1alpha1/studyjobclient/studyjobclient.go.

Will we have config map with Trial templates and Metrics collector templates, like here:
https://github.com/kubeflow/katib/blob/master/manifests/v1alpha1/studyjobcontroller/metricsControllerConfigMap.yaml
https://github.com/kubeflow/katib/blob/master/manifests/v1alpha1/studyjobcontroller/workerConfigMap.yaml ?
I named these config maps as:
trial-template and metricscollector-template

/assign @hougangliu @YujiOshima @johnugeorge
/cc @richardsliu


This change is Reviewable


const (
trialTemplatesName = "trial-template"
metricsCollectorTemplatesName = "metricscollector-template"
Copy link
Member

Choose a reason for hiding this comment

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

How about adding it in pkg/api/operators/apis/experiment/v1alpha2/constants.go? trialTemplate is already defined

@richardsliu
Copy link
Contributor

@andreyvelich Most likely yes, we will have similar metrics collector templates.

Can we rename the template as metrics-collector-template?

"sigs.k8s.io/controller-runtime/pkg/client"
cl "sigs.k8s.io/controller-runtime/pkg/client"
Copy link
Member

Choose a reason for hiding this comment

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

duplicate with line 26


ns := getNamespace(namespace...)
trialTemplates := &apiv1.ConfigMap{}

Copy link
Member

Choose a reason for hiding this comment

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

Suggest move getConfigMap into this file, too and then please call getConfigMap

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

return nil
}

func (k *katibClient) GetTrialTemplates(namespace ...string) (map[string]string, error) {
Copy link
Member

Choose a reason for hiding this comment

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

for now, trial template can be stored in any configmap, not just trial-template

Copy link
Member Author

@andreyvelich andreyvelich Apr 30, 2019

Choose a reason for hiding this comment

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

Is there any way to get Trial templates configmap?

}

func (k *katibClient) UpdateMetricsCollectorTemplates(newMCTemplates map[string]string, namespace ...string) error {

Copy link
Member

Choose a reason for hiding this comment

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

ditto

@johnugeorge
Copy link
Member

Client code can be common util code which can be used by all components. I think, it should be moved out of experiment controller

@richardsliu
Copy link
Contributor

We can create a pkg/util/v1alpha2 directory for common clients.

@andreyvelich
Copy link
Member Author

andreyvelich commented Apr 30, 2019

@johnugeorge @richardsliu What do you think about moving it into manager folder, like here:
https://github.com/kubeflow/katib/tree/master/pkg/manager/v1alpha1/studyjobclient ?

@richardsliu
Copy link
Contributor

@andreyvelich I think we need something like that, but I am not sure why that directory is named "manager". For v1alpha1 it just contains:

  • metricscollector
  • file-metricscollector
  • studyjobclient
  • visualize

Seems more like an util folder to me.

Move templates const
@andreyvelich
Copy link
Member Author

@richardsliu Should we name this folder util in v1alpha2 ?

@richardsliu
Copy link
Contributor

@andreyvelich Sounds good.

@andreyvelich
Copy link
Member Author

@richardsliu @johnugeorge Done

@andreyvelich
Copy link
Member Author

/retest

@@ -27,4 +27,10 @@ const (

// Default value of Spec.TemplatePath
DefaultTrialTemplatePath = "defaultTrialTemplate.yaml"

// Name of the configMap for Trial templates
TrialTemplatesName = "trial-template"
Copy link
Member

Choose a reason for hiding this comment

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

line no 23 has it added already

TrialTemplatesName = "trial-template"

// Name of the configMap for MetricsCollector templates
MetricsCollectorTemplatesName = "metrics-collector-template"
Copy link
Member

Choose a reason for hiding this comment

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

Is this the default metric config map similar to trial?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I will rename it, like for Trial template

@johnugeorge
Copy link
Member

/lgtm

@richardsliu
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: richardsliu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 709d97c into kubeflow:master May 1, 2019
@andreyvelich andreyvelich deleted the v1alpha2-katib-client branch October 6, 2021 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants