'How to properly create an apache plasma store from within a python program?

If I run the following as a program:

import subprocess

subprocess.run(['plasma_store -m 10000000000 -s /tmp/plasma'], shell=True, capture_output=True)

and then run the program that uses the plasma store in a separate terminal everything works properly. But if I try to move the above statement into the main program it throws an error: '/Users/travis/build/ursa-labs/crossbow/arrow/cpp/src/plasma/io.cc:177: Connection to IPC socket failed for pathname /tmp/plasma, retrying 80 more times'

What is the correct way to initialize a plasma store from within a python program, if it must start as its own process would I have to use the multiprocessing module to make it work?



Solution 1:[1]

import plasma from arrow
with plasma.start_plasma_store(10000000000) as ps:

where ps[0] will contain the socket name

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Lewis G