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 artifact location tests #2142

Merged
merged 1 commit into from
Sep 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions samples/core/artifact_location/artifact_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,28 @@
location for all the ops in the pipeline.""",
)
def custom_artifact_location(
tag: str, namespace: str = "kubeflow", bucket: str = "somebucket"
secret_name: str = "mlpipeline-minio-artifact",
tag: str = '1.31.0',
namespace: str = "kubeflow",
bucket: str = "mlpipeline"
):

# configures artifact location
pipeline_artifact_location = dsl.ArtifactLocation.s3(
bucket=bucket,
endpoint="minio-service.%s:9000" % namespace, # parameterize minio-service endpoint
insecure=True,
access_key_secret=V1SecretKeySelector(name="minio", key="accesskey"),
secret_key_secret={"name": "minio", "key": "secretkey"}, # accepts dict also
access_key_secret=V1SecretKeySelector(name=secret_name, key="accesskey"),
secret_key_secret={"name": secret_name, "key": "secretkey"}, # accepts dict also
)

# set pipeline level artifact location
dsl.get_pipeline_conf().set_artifact_location(pipeline_artifact_location)

# artifacts in this op are stored to endpoint `minio-service.<namespace>:9000`
op = dsl.ContainerOp(name="foo", image="busybox:%s" % tag)
op = dsl.ContainerOp(name="foo", image="busybox:%s" % tag,
command=['sh', '-c', 'echo hello > /tmp/output.txt'],
file_outputs={'output': '/tmp/output.txt'})

if __name__ == '__main__':
kfp.compiler.Compiler().compile(custom_artifact_location, __file__ + '.zip')
1 change: 1 addition & 0 deletions test/sample_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ spec:
- dataflow
- execution_order
- imagepullsecrets
- artifact_location
# Build and push image
- name: build-image-by-dockerfile
inputs:
Expand Down