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

Added configArtifactRepository method into sdk/python/kfp/compiler/compiler.py #765

Closed
wants to merge 1 commit into from
Closed

Added configArtifactRepository method into sdk/python/kfp/compiler/compiler.py #765

wants to merge 1 commit into from

Conversation

DmitryBe
Copy link
Contributor

@DmitryBe DmitryBe commented Feb 1, 2019

Added configArtifactRepository method into sdk/python/kfp/compiler/compiler.py

Example:

# config compiler (use s3)
cpl = compiler.Compiler() \
    .configArtifactRepository(
        endpoint='s3.amazonaws.com',
        bucket='<bucket>', 
        keyPrefix='pipelines/dev',
        accessKey='', secretKey=''
    )

pipeline_filename = pipeline_func.__name__ + '.pipeline.tar.gz'
cpl.compile(pipeline_func, pipeline_filename)


This change is Reviewable

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: gaoning777

If they are not already assigned, you can assign the PR to them by writing /assign @gaoning777 in a comment when ready.

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
Copy link
Contributor

Hi @DmitryBe. Thanks for your PR.

I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

1 similar comment
@k8s-ci-robot
Copy link
Contributor

Hi @DmitryBe. Thanks for your PR.

I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@DmitryBe
Copy link
Contributor Author

DmitryBe commented Feb 1, 2019

/assign @gaoning777

sdk/python/Makefile Outdated Show resolved Hide resolved
sdk/python/kfp/_client.py Outdated Show resolved Hide resolved
@DmitryBe
Copy link
Contributor Author

DmitryBe commented Feb 2, 2019

Hi @Ark-kun,

Thank you for your review. To make it clear, in order to add AWS S3 support for storing artifacts, I have made 3 PR in total:

  1. backend extend (Added AWS S3 support for storing artefacts. #766)
  2. frontend extend (Frontend aws s3 #767)
  3. the current one, python DSL extend.

To extend python DSL, i have added configArtifactRepository method, to parametrize method _build_conventional_artifact (default minio values where hardcoded previously).

@DmitryBe DmitryBe changed the title Updated dsl python Compiler. Added ArtifactRepositoryConfig, Added configArtifactRepository method into sdk/python/kfp/compiler/compiler.py Feb 10, 2019
@DmitryBe
Copy link
Contributor Author

Hi @Ark-kun,
I cleaned PR based on your suggestions, left only compiler related changes (method configArtifactRepository to parametrize _build_conventional_artifact)

def configArtifactRepository(self, endpoint='minio-service.kubeflow:9000', bucket='mlpipeline', keyPrefix='runs', accessKey='accesskey', secretKey='secretkey', insecure=True):
"""Config artifact repository
"""
self.artifactRepositoryConfig = Compiler.ArtifactRepositoryConfig(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you make this field private (leading underscore)?

@@ -557,6 +584,19 @@ def _compile(self, pipeline_func):
workflow = self._create_pipeline_workflow(args_list_with_defaults, p)
return workflow

def configArtifactRepository(self, endpoint='minio-service.kubeflow:9000', bucket='mlpipeline', keyPrefix='runs', accessKey='accesskey', secretKey='secretkey', insecure=True):
Copy link
Contributor

Choose a reason for hiding this comment

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

Python uses snake_case for function names. def set_artifact_repository(...)

@Ark-kun
Copy link
Contributor

Ark-kun commented Mar 7, 2019

@IronPan @DmitryBe Do you think that it would be better to configure this at the cluster level and not bake this information into the pipeline file?

I think a better solution would be for the backend to read the default artifact repository information from cluster's ConfigMap and add it to the workflow at submission time. WDYT?

@Ark-kun
Copy link
Contributor

Ark-kun commented Apr 4, 2019

I've also noticed that this configuration is S3-only while Argo supports more artifact storage solutions. We can either indicate that the config is S3-only in the name or make a more generic solution.

/ok-to-test

@vicaire
Copy link
Contributor

vicaire commented Apr 24, 2019

@DmitryBe, @Ark-kun, what is the status on this PR? Is it ready for another round of review? Thanks.

@Ark-kun
Copy link
Contributor

Ark-kun commented Apr 30, 2019

BTW, I had a PR where I've made the artifact storage configurable on the cluster level and made the compiled pipelines portable: #513

@k8s-ci-robot
Copy link
Contributor

@DmitryBe: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
kubeflow-pipeline-e2e-test 279c016 link /test kubeflow-pipeline-e2e-test
kubeflow-pipeline-sample-test 279c016 link /test kubeflow-pipeline-sample-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@Ark-kun
Copy link
Contributor

Ark-kun commented Jul 25, 2019

The support for setting the artifact storage options was merged in different PRs.

@Ark-kun
Copy link
Contributor

Ark-kun commented Jul 26, 2019

This functionality has already been merged.

@Ark-kun Ark-kun closed this Jul 26, 2019
Linchin pushed a commit to Linchin/pipelines that referenced this pull request Apr 11, 2023
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.

5 participants