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

Pipelines kustomize v3 manifest #1248

Merged
merged 26 commits into from
Jun 18, 2020
Merged

Pipelines kustomize v3 manifest #1248

merged 26 commits into from
Jun 18, 2020

Conversation

Bobgy
Copy link
Contributor

@Bobgy Bobgy commented Jun 12, 2020

Which issue is resolved by this Pull Request:
Resolves #1048
Resolves #897
Resolves kubeflow/pipelines#3993

Description of your changes:
Add kustomize v3 manifest for pipelines.
In addition to existing pipelines components, I also integrated the newly introduced components:

  • cache server
  • metadata writer

/cc @Ark-kun

I verified these with gcp blueprint deployment, caching and metadata writer both works properly.

Checklist:

  • Unit tests have been rebuilt:
    1. cd manifests/tests
    2. make generate-changed-only
    3. make test

@k8s-ci-robot k8s-ci-robot requested a review from Ark-kun June 12, 2020 09:04
@kubeflow-bot
Copy link
Contributor

This change is Reviewable

@Bobgy
Copy link
Contributor Author

Bobgy commented Jun 15, 2020

/cc @rmgogogo
/assign @jlewi

Copy link
Contributor

@jlewi jlewi left a comment

Choose a reason for hiding this comment

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

Reviewed 19 of 196 files at r1.
Reviewable status: 9 of 152 files reviewed, 8 unresolved discussions (waiting on @Ark-kun, @Bobgy, and @rmgogogo)


pipeline/installs/generic/kustomization.yaml, line 35 at r2 (raw file):

- name: mysql-secret
  env: params-db-secret.env
vars:

What are these vars for? Can we get rid of them?
https://github.com/kubeflow/manifests/blob/master/docs/KustomizeBestPractices.md#eschew-vars


pipeline/installs/generic/params.yaml, line 2 at r2 (raw file):

varReference:
- path: spec/http/route/destination/host

What are you using vars for?


pipeline/installs/generic/virtual-service.yaml, line 18 at r2 (raw file):

    route:
    - destination:
        host: $(KFP_UI_SERVICE).$(KFP_UI_NAMESPACE).svc.$(clusterDomain)

How about adding kpt setters for the clusterDomain so that we don't need to rely on the vars for GCP?
Likewise do we need a vars for $(KFP_UI_SERVICE)? Doesn't the service have a fixed name?


pipeline/minio/installs/gcp-pd/kustomization.yaml, line 16 at r1 (raw file):

- name: pipeline-minio-install-config
  env: params.env
vars:

Can we get rid of these vars?
https://github.com/kubeflow/manifests/blob/master/docs/KustomizeBestPractices.md#eschew-vars


pipeline/minio/installs/gcp-pd/params.yaml, line 2 at r1 (raw file):

varReference:
- path: spec/gcePersistentDisk/pdName

Do we need all these custom vars?
https://github.com/kubeflow/manifests/blob/master/docs/KustomizeBestPractices.md#eschew-vars


pipeline/minio/installs/gcp-pd/persistent-volume.yaml, line 4 at r1 (raw file):

kind: PersistentVolume
metadata:
  name: $(kfpMinioPvName)

Why is this a var?
https://github.com/kubeflow/manifests/blob/master/docs/KustomizeBestPractices.md#eschew-vars


pipeline/minio/installs/gcp-pd/persistent-volume.yaml, line 11 at r1 (raw file):

  - ReadWriteOnce
  gcePersistentDisk:
    pdName: $(kfpMinioPd)

Why is this a var? On GCP could we use a kpt setter?


pipeline/minio/installs/gcp-pd/persistent-volume-claim.yaml, line 6 at r1 (raw file):

  name: minio-pvc
spec:
  volumeName: $(kfpMinioPvName)

Why vars?

Copy link
Contributor Author

@Bobgy Bobgy left a comment

Choose a reason for hiding this comment

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

Reviewable status: 9 of 186 files reviewed, 8 unresolved discussions (waiting on @Ark-kun, @Bobgy, @jlewi, and @rmgogogo)


pipeline/installs/generic/kustomization.yaml, line 35 at r2 (raw file):

Previously, jlewi (Jeremy Lewi) wrote…

What are these vars for? Can we get rid of them?
https://github.com/kubeflow/manifests/blob/master/docs/KustomizeBestPractices.md#eschew-vars

Yes, got rid of in kfp rc 2


pipeline/installs/generic/params.yaml, line 2 at r2 (raw file):

Previously, jlewi (Jeremy Lewi) wrote…

What are you using vars for?

this is exactly https://github.com/kubeflow/manifests/blob/master/docs/KustomizeBestPractices.md#global-substitution
substituting virtual service


pipeline/installs/generic/virtual-service.yaml, line 18 at r2 (raw file):

Previously, jlewi (Jeremy Lewi) wrote…

How about adding kpt setters for the clusterDomain so that we don't need to rely on the vars for GCP?
Likewise do we need a vars for $(KFP_UI_SERVICE)? Doesn't the service have a fixed name?

I will fix first two vars, for cluster domain, we can change it to kpt setter. Would you want me do it in this PR or separate?

@Bobgy
Copy link
Contributor Author

Bobgy commented Jun 17, 2020

@jlewi I removed most of the vars after rebasing to kfp rc2 manifest with changes in kubeflow/pipelines#3978.

The remaining usages of var are:

I'm not sure why we are parameterizing PV name, it was consistent with KF 1.0 manifest. I'll take a look at commit history to find why. I'm guessing that's because persistence volume is immutable after creation, so for proper devops action of changing a PV, it's best to customize the name to use a new PV.

Because this PR is huge. I suggest we separate a PR for how to get rid of the last 4 vars (if we do want to).

@Bobgy
Copy link
Contributor Author

Bobgy commented Jun 17, 2020

I did some investigation, the PV, PVC name parameterization by var was added in #104. However, it didn't explain any reasoning about why they were added.

@gabrielwen Do you have context why we needed to parameterize PV and PVC name for pipeline's mysql and minio db?

@jlewi
Copy link
Contributor

jlewi commented Jun 17, 2020

Thanks @Bobgy I think most of the vars you mentioned are for internal substitution; e.g.
namespace. Per the guide this is ok as long as we give the vars unique enough names so we don't conflict with similar vars from other packages.

A better solution for clusterDomain is being tracked in #1007 (comment)

You can keep that one as is for now. On GCP we can probably just switch to kpt setters since we are already using kpt setter.

@gabrielwen Do you have context why we needed to parameterize PV and PVC name for pipeline's mysql and minio db?

I think it might have been related to how we were creating the PD. I think we may have been using deployment manager (and now KCC) to create the PD and thus needed to substitute in the correct name to the package.

I think the reasoning was we wanted to use KCC/DM and not the dynamic provisioner to create the PD because we wanted to make sure the PD wasn't destroyed if KF was deleted because we didn't want to destroy any data.

I'm good with submitting PR as is and filing issues to track fixing things later.

@jlewi
Copy link
Contributor

jlewi commented Jun 17, 2020

/lgtm
/approve

@Bobgy
Copy link
Contributor Author

Bobgy commented Jun 18, 2020

@jlewi the conflicts were caused by env to envs change: https://github.com/kubeflow/manifests/commits/master/pipeline/upstream
#1204

but kfp standalone manifests don't support envs yet, because we wanted to maintain kubectl kustomize compatibility, which uses a kustomize v2.x version: https://github.com/kubernetes-sigs/kustomize#kubectl-integration.

I'll ask the PR owner for a resolution.

@k8s-ci-robot k8s-ci-robot removed the lgtm label Jun 18, 2020
@Bobgy
Copy link
Contributor Author

Bobgy commented Jun 18, 2020

I updated kfp pull upstream script to use sed for a quick HACK that transforms env: to envs: during pull: a842b7b

What do you think?

@jlewi
Copy link
Contributor

jlewi commented Jun 18, 2020

SGTM

Although you could also write a kpt FN transformer.

kustomize 2.x is very old. A lot of things won't work if you rely on it.

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jlewi

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 f5150c5 into kubeflow:master Jun 18, 2020
@Bobgy
Copy link
Contributor Author

Bobgy commented Jun 18, 2020

Although you could also write a kpt FN transformer.

Thanks for sharing, will try that next time

kustomize 2.x is very old. A lot of things won't work if you rely on it.

convenience from kubectl is the major reason we keep using it. We will consider upgrading when we get the first blocking issue

@Bobgy Bobgy mentioned this pull request Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants