Skip to content

Deploy SeBS as Python package #245

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
5 changes: 4 additions & 1 deletion sebs.py → sebs/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,5 +662,8 @@ def resources_remove(resource, prefix, wait, dry_run, **kwargs):
)


if __name__ == "__main__":
def main():
cli()

if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion sebs/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.1.0"
__version__ = "1.2.0"
124 changes: 124 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
#!/usr/bin/env python3

import os
import re
import sys
from pathlib import Path
from setuptools import setup, find_packages

here = os.path.abspath(os.path.dirname(__file__))

readme_path = os.path.join(here, "README.md")
with open(readme_path, encoding="utf-8") as f:
long_description = f.read()

version_path = os.path.join(here, "sebs", "version.py")
version_dict = {}
with open(version_path) as f:
exec(f.read(), version_dict)
__version__ = version_dict.get("__version__", "1.2.0")

# Core requirements
install_requires = []
req_path = os.path.join(here, "requirements.txt")
if os.path.exists(req_path):
with open(req_path, encoding="utf-8") as f:
install_requires = [
line.strip() for line in f if not line.startswith("#") and line.strip()
]
else:
# Define core requirements manually if file not found
install_requires = [
"testtools>=2.4.0",
"docker>=4.2.0",
"tzlocal>=2.1",
"requests",
"pandas>=1.1.3",
"numpy",
"scipy",
"pycurl>=7.43",
"click>=7.1.2",
"rich",
]

extras_require = {"aws": [], "azure": [], "gcp": [], "local": [], "openwhisk": []}

# Try to load platform-specific requirements from files
for platform in extras_require.keys():
req_file = os.path.join(here, f"requirements.{platform}.txt")
if os.path.exists(req_file):
with open(req_file, encoding="utf-8") as f:
extras_require[platform] = [
line.strip() for line in f if not line.startswith("#") and line.strip()
]

# All platforms
extras_require["all"] = [
req for platform_reqs in extras_require.values() for req in platform_reqs
]


def package_files(path, regexp):
paths = []
for path, directories, filenames in os.walk(path):
for filename in filenames:
if regexp.match(os.path.join(path, filename)):
paths.append(os.path.join(os.path.pardir, path, filename))
return paths


print(package_files("dockerfiles", re.compile("")))

setup(
name="sebs",
version=__version__,
description="Serverless Benchmark Suite",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/spcl/serverless-benchmarks",
author="Marcin Copik",
author_email="marcin.copik@inf.ethz.ch",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering",
"Topic :: System :: Benchmark",
"Topic :: System :: Distributed Computing",
],
keywords="serverless, faas, benchmark, lambda, azure-functions, cloud-computing",
packages=find_packages(where=here, exclude=["tests", "tests.*"])
+ ["sebs.tools", "sebs.configs", "sebs.benchmarks", "sebs.dockerfiles"],
package_dir={
"sebs": "sebs",
"sebs.tools": "tools",
"sebs.configs": "config",
"sebs.dockerfiles": "dockerfiles",
"sebs.benchmarks": "benchmarks",
},
python_requires=">=3.7",
install_requires=install_requires,
extras_require=extras_require,
entry_points={
"console_scripts": [
"sebs=sebs.cli:main",
],
},
package_data={
"sebs.tools": ["create_azure_credentials.py"],
"sebs.configs": ["systems.json"],
"sebs.dockerfiles": package_files("dockerfiles", re.compile(".*.function")),
"sebs.benchmarks": ["*", "*/*", "*/*/*", "*/*/*/*", "*/*/*/*/*"],
},
project_urls={
"Bug Reports": "https://github.com/spcl/serverless-benchmarks/issues",
"Source": "https://github.com/spcl/serverless-benchmarks",
},
)