Beispiel #1
0
    def test_output_s3_artifact(self):
        # the content of local file would be uploaded to OSS
        output_artifact = couler.create_s3_artifact(
            path="/mnt/t1.txt",
            bucket="test-bucket/",
            accesskey_id="abcde",
            accesskey_secret="abc12345",
            key="s3path/t1",
            endpoint="xyz.com",
        )
        couler.run_container(
            image="docker/whalesay:latest",
            args=["echo -n hello world > %s" % output_artifact.path],
            command=["bash", "-c"],
            output=output_artifact,
        )

        wf = couler.workflow_yaml()
        template = wf["spec"]["templates"][1]
        artifact = template["outputs"]["artifacts"][0]
        self._s3_check_helper(artifact)
        couler._cleanup()
Beispiel #2
0
    def test_input_s3_artifact(self):
        input_artifact = couler.create_s3_artifact(
            path="/mnt/t1.txt",
            bucket="test-bucket/",
            accesskey_id="abcde",
            accesskey_secret="abc12345",
            key="s3path/t1",
            endpoint="xyz.com",
        )

        # read the content from an S3 bucket
        couler.run_container(
            image="docker/whalesay:latest",
            args=["cat %s" % input_artifact.path],
            command=["bash", "-c"],
            input=input_artifact,
        )

        wf = couler.workflow_yaml()
        template = wf["spec"]["templates"][1]
        artifact = template["inputs"]["artifacts"][0]
        self._s3_check_helper(artifact)
        couler._cleanup()