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

load_components_from_url() fails to load a yaml file present in the GCS bucket #1

Open
gomrinal opened this issue Mar 15, 2023 · 2 comments

Comments

@gomrinal
Copy link

gomrinal commented Mar 15, 2023

  • Parser issue is happening because of it. I have double checked that there's no issue with the yaml file format.
@gomrinal
Copy link
Author

cp = kfp.components.load_component_from_url("https://storage.cloud.google.com/<bucket name here>/mycomponent.yaml")

@gomrinal
Copy link
Author

gomrinal commented Mar 15, 2023

Error:
ParserError Traceback (most recent call last)
/var/tmp/ipykernel_18640/3316611576.py in
----> 1 cp = kfp.components.load_component_from_url("https://storage.cloud.google.com/bucket name/mycomponent.yaml")

/opt/conda/lib/python3.7/site-packages/kfp/components/_components.py in load_component_from_url(url, auth)
82 Once called with the required arguments, the factory constructs a pipeline task instance (ContainerOp).
83 """
---> 84 component_spec = _load_component_spec_from_url(url, auth)
85 url = _fix_component_uri(url)
86 component_ref = ComponentReference(url=url)

/opt/conda/lib/python3.7/site-packages/kfp/components/_components.py in _load_component_spec_from_url(url, auth)
166 resp = requests.get(url, auth=auth)
167 resp.raise_for_status()
--> 168 return _load_component_spec_from_yaml_or_zip_bytes(resp.content)
169
170

/opt/conda/lib/python3.7/site-packages/kfp/components/_components.py in _load_component_spec_from_yaml_or_zip_bytes(data)
185 with zipfile.ZipFile(stream) as zip_obj:
186 data = zip_obj.read(_COMPONENT_FILE_NAME_IN_ARCHIVE)
--> 187 return _load_component_spec_from_component_text(data)
188
189

/opt/conda/lib/python3.7/site-packages/kfp/components/_components.py in _load_component_spec_from_component_text(text)
189
190 def _load_component_spec_from_component_text(text) -> ComponentSpec:
--> 191 component_dict = load_yaml(text)
192 component_spec = ComponentSpec.from_dict(component_dict)
193

/opt/conda/lib/python3.7/site-packages/kfp/components/_yaml_utils.py in load_yaml(stream)
35 return yaml.load(stream, OrderedLoader)
36
---> 37 return ordered_load(stream)
38
39

/opt/conda/lib/python3.7/site-packages/kfp/components/_yaml_utils.py in ordered_load(stream, Loader, object_pairs_hook)
33 OrderedLoader.add_constructor(
34 yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, construct_mapping)
---> 35 return yaml.load(stream, OrderedLoader)
36
37 return ordered_load(stream)

/opt/conda/lib/python3.7/site-packages/yaml/init.py in load(stream, Loader)
112 loader = Loader(stream)
113 try:
--> 114 return loader.get_single_data()
115 finally:
116 loader.dispose()

/opt/conda/lib/python3.7/site-packages/yaml/constructor.py in get_single_data(self)
47 def get_single_data(self):
48 # Ensure that the stream contains a single document and construct it.
---> 49 node = self.get_single_node()
50 if node is not None:
51 return self.construct_document(node)

/opt/conda/lib/python3.7/site-packages/yaml/composer.py in get_single_node(self)
37
38 # Ensure that the stream contains no more documents.
---> 39 if not self.check_event(StreamEndEvent):
40 event = self.get_event()
41 raise ComposerError("expected a single document in the stream",

/opt/conda/lib/python3.7/site-packages/yaml/parser.py in check_event(self, *choices)
96 if self.current_event is None:
97 if self.state:
---> 98 self.current_event = self.state()
99 if self.current_event is not None:
100 if not choices:

/opt/conda/lib/python3.7/site-packages/yaml/parser.py in parse_document_start(self)
172 "expected '', but found %r"
173 % self.peek_token().id,
--> 174 self.peek_token().start_mark)
175 token = self.get_token()
176 end_mark = token.end_mark

ParserError: expected '', but found ''
in "", line 2, column 1:
/*# sourceURL=/_/mss/boq-identit ...
^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant