Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test(address):
r = requests.post(address + '/register',
json={'python_v': "{}.{}".format(sys.version_info.major,
sys.version_info.minor),
'os': platform.system(),
'hname': platform.node(),
'username': getpass.getuser(),
'funcx_v': str(funcx.__version__)
}
)
print("Status code :", r.status_code)
print("Json : ", r.json())
import requests
sys.path.insert(0, os.path.abspath('../'))
import funcx
# -- Project information -----------------------------------------------------
project = 'funcX'
copyright = '2019, The University of Chicago'
author = 'The funcX Team'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = funcx.__version__.rsplit('.', 1)[0]
# The full version, including alpha/beta/rc tags.
release = funcx.__version__
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'nbsphinx',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
#'sphinx.ext.linkcode',
'sphinx.ext.napoleon'
import funcx
# -- Project information -----------------------------------------------------
project = 'funcX'
copyright = '2019, The University of Chicago'
author = 'The funcX Team'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = funcx.__version__.rsplit('.', 1)[0]
# The full version, including alpha/beta/rc tags.
release = funcx.__version__
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'nbsphinx',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
#'sphinx.ext.linkcode',
'sphinx.ext.napoleon'
]
# Stop an endpoint
stop = subparsers.add_parser('stop', help='Stops an active endpoint')
stop.add_argument("name", help="Name of the endpoint to stop")
# List all endpoints
subparsers.add_parser('list', help='Lists all endpoints')
args = parser.parse_args()
funcx.set_stream_logger(level=logging.DEBUG if args.debug else logging.INFO)
global logger
logger = logging.getLogger('funcx')
if args.version:
logger.info("FuncX version: {}".format(funcx.__version__))
logger.debug("Command: {}".format(args.command))
args.config_file = os.path.join(args.config_dir, 'config.py')
if args.command == "init":
if args.force:
logger.debug("Forcing re-authentication via GlobusAuth")
funcx_client = FuncXClient(force_login=args.force)
init_endpoint(args)
return
if not os.path.exists(args.config_file):
logger.critical("Missing a config file at {}. Critical error. Exiting.".format(args.config_file))
logger.info("Please run the following to create the appropriate config files : \n $> funcx-endpoint init")
exit(-1)