Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ CallFlow is structured as three components:

#### Installing CallFlow

The `callflow` (python package) requires [python](https://realpython.com/installing-python/) (>= 3.6) and [pip](https://pip.pypa.io/en/stable/news/) (>= 20.1.1). Other dependencies are checked/installed during the installation of `callflow` using `pip`.
The `callflow` (python package) requires [python](https://realpython.com/installing-python/) (>= 3.6) and [pip](https://pip.pypa.io/en/stable/news/) (>= 20.1.1). Other dependencies are checked/installed during the installation of `callflow` using `setup.py`.

```
pip install .
python3 setup.py install
```

#### Installing Visualization Client
Expand Down
14 changes: 0 additions & 14 deletions callflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
#
# SPDX-License-Identifier: MIT

__version_info__ = ("1", "1", "0")
__version__ = ".".join(__version_info__)

# callflow.__init__.py
from .logger import init_logger
from logging import getLogger as get_logger
Expand All @@ -15,7 +12,6 @@
from .datastructures.ensemblegraph import EnsembleGraph

from .callflow import CallFlow
from .notebook import _load_ipython_extension

# CallFlow's public API.
__all__ = [
Expand All @@ -25,14 +21,4 @@
"SuperGraph",
"EnsembleGraph",
"CallFlow",
"notebook",
]


def load_ipython_extension(ipython):
"""IPython API entry point.
Only intended to be called by the IPython runtime.
See:
https://ipython.readthedocs.io/en/stable/config/extensions/index.html
"""
_load_ipython_extension(ipython)
File renamed without changes.
3 changes: 1 addition & 2 deletions callflow/operations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
from .group import Group
from .filter import Filter
from .read_config import ConfigFileReader
from .argparser import ArgParser

__all__ = ["Process", "Group", "Filter", "ConfigFileReader", "ArgParser"]
__all__ = ["Process", "Group", "Filter", "ConfigFileReader"]
7 changes: 7 additions & 0 deletions callflow/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright 2017-2020 Lawrence Livermore National Security, LLC and other
# CallFlow Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: MIT

__version_info__ = ("1", "1", "0")
__version__ = ".".join(__version_info__)
4 changes: 2 additions & 2 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ You can get CallFlow from its `GitHub <https://github.com/LLNL/CallFlow>`_ using

Install callflow python package
-------------------------------
To install callflow python package, run the following command using pip.
To install callflow python package, run the following command using `setup.py`.

.. code-block:: console

$ pip install .
$ python3 setup.py install

To install in the dev mode,

Expand Down
22 changes: 11 additions & 11 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
pandas
numpy
flask
flask_socketio
colorlog==4.1.0
statsmodels==0.10.1
hatchet==1.0.1
matplotlib==3.1.1
jsonschema==3.0.2
networkx==2.2
colorlog
statsmodels
matplotlib
sklearn
jsonschema
eventlet
hatchet
scipy==1.3.1
numpy==1.17.2
pandas==0.23.0
Flask_SocketIO==4.2.1
ipython==7.18.1
scikit_learn==0.23.2
15 changes: 15 additions & 0 deletions server/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2017-2020 Lawrence Livermore National Security, LLC and other
# CallFlow Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: MIT

from .notebook_server import _load_ipython_extension


def load_ipython_extension(ipython):
"""IPython API entry point.
Only intended to be called by the IPython runtime.
See:
https://ipython.readthedocs.io/en/stable/config/extensions/index.html
"""
_load_ipython_extension(ipython)
18 changes: 12 additions & 6 deletions server/main.py → server/callflow_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
#
# SPDX-License-Identifier: MIT
# Library imports
from flask import Flask
from flask_socketio import SocketIO, emit
import os
import json
from networkx.readwrite import json_graph
import os

from flask import Flask
from flask_socketio import SocketIO, emit

# ------------------------------------------------------------------------------
# CallFlow imports.
import callflow
from callflow import manager
from callflow.operations import ArgParser
from callflow.argparser import ArgParser
from . import manager


LOGGER = callflow.get_logger(__name__)
_CALLFLOW_SERVER_PORT = 5000
Expand Down Expand Up @@ -434,8 +436,12 @@ def split_mpi_rank(data):
emit("split_mpi_distribution", result, json=True)


if __name__ == "__main__":
def main():
# if verbose, level = 1
# else, level = 2
callflow.init_logger(level=2)
CallFlowServer()


if __name__ == "__main__":
main()
18 changes: 15 additions & 3 deletions callflow/manager.py → server/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@
import errno
import json
import base64
from callflow import __version__

from codecs import open

version = {}
vfile = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "..", "callflow", "version.py"
)
with open(vfile) as fp:
exec(fp.read(), version)
__version__ = version["__version__"]

# The following five types enumerate the possible return values of the
# `start` function.
Expand Down Expand Up @@ -231,16 +240,19 @@ def start(args, args_string):
Launch python server.
"""
print("Launching Server")
"""
cwd = os.getcwd().split("CallFlow")[0] + "CallFlow/server/main.py"
server_cmd = ["python3", cwd] + args_string
"""
server_cmd = ["callflow_server"] + args_string
launch_cmd(server_cmd, alias="server")

"""
Launch callflow app server.
"""
print("Launching client")
cwd = os.getcwd().split("CallFlow")[0] + "CallFlow/app"
prefix_string = ["--silent", "--prefix=" + cwd]
app_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "app")
prefix_string = ["--silent", "--prefix=" + app_path]
client_cmd = ["npm", "run", "dev"] + prefix_string
launch_cmd(client_cmd, alias="client")

Expand Down
8 changes: 4 additions & 4 deletions callflow/notebook.py → server/notebook_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
# through the IPython interface.
# The code can be found at https://github.com/tensorflow/tensorboard/blob/master/tensorboard/notebook.py

import shlex
import json
import random
import time
import datetime
from callflow.operations import ArgParser
import shlex
import random

try:
import html
Expand All @@ -25,7 +24,8 @@
html_escape = cgi.escape
del cgi

from callflow import manager
from callflow.argparser import ArgParser
from . import manager


def _load_ipython_extension(ipython):
Expand Down
97 changes: 82 additions & 15 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,101 @@
# Copyright 2017-2020 Lawrence Livermore National Security, LLC and other
# Hatchet Project Developers. See the top-level LICENSE file for details.
# CallFlow Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: MIT

import os
from setuptools import setup, find_packages
from callflow import __version__

# ------------------------------------------------------------------------------
# get the version safely!
from codecs import open

version = {}
vfile = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "callflow", "version.py"
)
with open(vfile) as fp:
exec(fp.read(), version)
version = version["__version__"]


# ------------------------------------------------------------------------------
# Only allow folders in https://github.com/LLNL/CallFlow/tree/develop/data to be added.
# For now we are hard-coding this.
# TODO: Find a more automated solution.
_GITHUB_DATA_FOLDERS = [
"caliper-cali",
"caliper-lulesh-json",
"hpctoolkit-cpi-database",
]

# Only allow jupyter notebooks in https://github.com/LLNL/CallFlow/tree/develop/example to be added.
_GITHUB_EXAMPLE_FILES = [
"%callflow-ipython-magic.ipynb",
"CallFlow-python-interface-demo.ipynb",
]


# gather the data to be copied
def list_files(directory, whitelist_files=[], whitelist_folders=[]):
paths = []
if len(whitelist_folders) > 0:
for item in os.listdir(directory):
if item in whitelist_folders:
for (path, directories, filenames) in os.walk(
os.path.join(directory, item)
):
if ".callflow" not in path.split("/"):
paths.append((path, [os.path.join(path, f) for f in filenames]))

if len(whitelist_files) > 0:
for (path, directories, filenames) in os.walk(directory):
paths.append(
(
path,
[os.path.join(path, f) for f in filenames if f in whitelist_files],
)
)
return paths


data_files = list_files("data", whitelist_folders=_GITHUB_DATA_FOLDERS)
example_files = list_files("examples", whitelist_files=_GITHUB_EXAMPLE_FILES)


deps = [
"flask_socketio",
"ipython",
"colorlog",
"jsonschema",
"numpy",
"scipy",
"pandas",
"scikit_learn",
"statsmodels",
"hatchet",
"networkx",
"matplotlib",
]
# ------------------------------------------------------------------------------
# now set up
setup(
name="CallFlow",
version=__version__,
version=version,
license="MIT",
description="",
url="https://github.com/LLNL/CallFlow",
author="Suraj Kesavan, Huu Tan Nguyen",
author="Suraj Kesavan",
author_email="spkesavan@ucdavis.edu",
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: MIT License",
],
keywords="",
packages=find_packages(),
install_requires=[
"numpy",
"pandas",
"tables",
"flask",
"flask_socketio",
"sklearn",
"statsmodels",
"networkx == 2.2",
"hatchet",
],
data_files=data_files + example_files,
entry_points={"console_scripts": ["callflow_server = server.callflow_server:main"]},
install_requires=deps,
)

# ------------------------------------------------------------------------------