Skip to content

RegEx Generation Fails Inside the Container (Missing Lib Directory) #3

@bbayazit16

Description

@bbayazit16

If you run:

python3 dataset_generator.py \
  --base-dir ./testdir \
  --dataset-type regex \
  --filter-field depth \
  --depth 14 --n 8 \
  --alphabet-size 8 \
  --sample-count 10 \
  --seed 0

inside the Docker container, npm fails with:

"""
Traceback (most recent call last):
  File "/usr/lib/python3.10/concurrent/futures/process.py", line 246, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/autoeval/nlfs/dataset/regex_dataset.py", line 91, in process_sentence
    num_nodes, num_edges, density = get_min_dfa_info(regex)
  File "/autoeval/nlfs/dataset/regex_dataset.py", line 24, in get_min_dfa_info
    raise e
  File "/autoeval/nlfs/dataset/regex_dataset.py", line 21, in get_min_dfa_info
    g = reg.get_graph(regex, "", temp_dir.name)
  File "/autoeval/nlfs/verifier/regex.py", line 15, in get_graph
    subprocess.run(cmd, check=True, stdout=subprocess.DEVNULL,
  File "/usr/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['npm', 'start', 'V*', '/tmp/tmp9fxmzsk4', '']' returned non-zero exit status 1.
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/autoeval/dataset_generator.py", line 172, in <module>
    json_data, total_count = dataset.generate(
  File "/autoeval/nlfs/dataset/regex_dataset.py", line 165, in generate
    json_data, total_count = self.populate_dataset(
  File "/autoeval/nlfs/dataset/regex_dataset.py", line 225, in populate_dataset
    sentence_data.update(future.result())
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
subprocess.CalledProcessError: Command '['npm', 'start', 'V*', '/tmp/tmp9fxmzsk4', '']' returned non-zero exit status 1.

It's fixed after including the entire lib directory of reg2dfa under dependencies/reg2dfa/src/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions