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

Pipeline configurations generated from CHAPbook #2

Open
keara-soloway opened this issue Jul 5, 2023 · 2 comments
Open

Pipeline configurations generated from CHAPbook #2

keara-soloway opened this issue Jul 5, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@keara-soloway
Copy link

I think there are 2 small bugs in generating CHAP configurations from the notebook:

CHAPaaS/chap.go

Lines 179 to 194 in 99dabf2

func genChapConfig(user, module, reader, writer string) string {
config := "pipeline:\n"
reader = strings.ToLower(reader)
writer = strings.ToLower(writer)
if reader == "yaml" {
config += " - common.YAMLReader: {}"
} else if reader == "nexus" {
config += " - common.NexuReader: {}"
}
//config += " - UserProcessor: {}\n - common.PrintProcessor: {}"
config += fmt.Sprintf(" - users.%s.%s.UserProcessor: {}\n", user, module)
config += " - common.PrintProcessor: {}\n"
if writer == "yaml" {
config += " - common.YAMLWriter: {}"
} else if writer == "nexus" {
config += " - common.NexuWriter: {}"

Missing \n-s on L184, L186, L192, and L194, and NexusReader is missing an "s" on L186 and L194.

Here's what I see in CHAPbook: if I select a YAMLReader, put some code in the notebook for the UserProcessor, then click "Run", the output is this:

pipeline:
  - common.YAMLReader: {}  - users.keara-soloway.userprocessor.UserProcessor: {}
  - common.PrintProcessor: {}
run non-profiled code
Traceback (most recent call last):
  File "/home/chess_chapaas/chess/install/bin/CHAP", line 33, in 
    sys.exit(load_entry_point('ChessAnalysisPipeline===PACKAGE-VERSION', 'console_scripts', 'CHAP')())
  File "/home/chess_chapaas/chess/venv/lib64/python3.9/site-packages/CHAP/runner.py", line 53, in main
    runner(opts)
  File "/home/chess_chapaas/chess/venv/lib64/python3.9/site-packages/CHAP/runner.py", line 67, in runner
    config = safe_load(file)
  File "/home/chess_chapaas/chess/venv/lib64/python3.9/site-packages/yaml/__init__.py", line 125, in safe_load
    return load(stream, SafeLoader)
  File "/home/chess_chapaas/chess/venv/lib64/python3.9/site-packages/yaml/__init__.py", line 81, in load
    return loader.get_single_data()
  File "/home/chess_chapaas/chess/venv/lib64/python3.9/site-packages/yaml/constructor.py", line 49, in get_single_data
    node = self.get_single_node()
  File "/home/chess_chapaas/chess/venv/lib64/python3.9/site-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/home/chess_chapaas/chess/venv/lib64/python3.9/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/home/chess_chapaas/chess/venv/lib64/python3.9/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/home/chess_chapaas/chess/venv/lib64/python3.9/site-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/home/chess_chapaas/chess/venv/lib64/python3.9/site-packages/yaml/composer.py", line 82, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/home/chess_chapaas/chess/venv/lib64/python3.9/site-packages/yaml/composer.py", line 111, in compose_sequence_node
    node.value.append(self.compose_node(node, index))
  File "/home/chess_chapaas/chess/venv/lib64/python3.9/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/home/chess_chapaas/chess/venv/lib64/python3.9/site-packages/yaml/composer.py", line 127, in compose_mapping_node
    while not self.check_event(MappingEndEvent):
  File "/home/chess_chapaas/chess/venv/lib64/python3.9/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/home/chess_chapaas/chess/venv/lib64/python3.9/site-packages/yaml/parser.py", line 428, in parse_block_mapping_key
    if self.check_token(KeyToken):
  File "/home/chess_chapaas/chess/venv/lib64/python3.9/site-packages/yaml/scanner.py", line 116, in check_token
    self.fetch_more_tokens()
  File "/home/chess_chapaas/chess/venv/lib64/python3.9/site-packages/yaml/scanner.py", line 215, in fetch_more_tokens
    return self.fetch_block_entry()
  File "/home/chess_chapaas/chess/venv/lib64/python3.9/site-packages/yaml/scanner.py", line 491, in fetch_block_entry
    raise ScannerError(None, None,
yaml.scanner.ScannerError: sequence entries are not allowed here
  in "/home/chess_chapaas/chess/chap/users/keara-soloway/chap.yaml", line 2, column 28

(and similar for NexusReader).

@keara-soloway keara-soloway added the bug Something isn't working label Jul 5, 2023
@vkuznet
Copy link
Collaborator

vkuznet commented Jul 21, 2023

@keara-soloway , it is fixed now in 2af6e21 commit.

@vkuznet
Copy link
Collaborator

vkuznet commented Jul 21, 2023

but I didn't yet update lab server with this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants