Skip to content
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

feat: add envd as a dev env tool #260

Merged
merged 2 commits into from
Jan 24, 2023
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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mosec"
version = "0.4.4"
version = "0.4.5"
authors = ["Keming <kemingy94@gmail.com>", "Zichen <lkevinzc@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ More ready-to-use examples can be found in the [Example](https://mosecorg.github
- sentiment analysis
- image recognition

## Contributing

We welcome any kind of contribution. Please give us feedback by [raising issues](https://github.com/mosecorg/mosec/issues/new/choose) or discussing on [Discord](https://discord.gg/Jq5vxuH69W). You could also directly [contribute](https://mosecorg.github.io/mosec/contributing) your code and pull request!

To start develop, you can use [envd](https://github.com/tensorchord/envd) to create an isolated and clean Python & Rust environment. Check the [envd-docs](https://envd.tensorchord.ai/) or [build.envd](./build.envd) for more information.

## Qualitative Comparison<sup>\*</sup>

| | Batcher | Pipeline | Parallel | I/O Format<sup>(1)</sup> | Framework<sup>(2)</sup> | Backend | Activity |
Expand All @@ -174,7 +180,3 @@ More ready-to-use examples can be found in the [Example](https://mosecorg.github
<sup>**(1)**: Data format of the service's request and response. "Limited" in the sense that the framework has pre-defined requirements on the format.</sup>
<sup>**(2)**: Supported machine learning frameworks. "Heavily" means the serving framework is designed towards a specific ML framework. Thus it is hard, if not impossible, to adapt to others. "Multiple" means the serving framework provides adaptation to several existing ML frameworks. "Agnostic" means the serving framework does not necessarily care about the ML framework. Hence it supports all ML frameworks (in Python).</sup>
<sup>**(3)**: Flask is a representative of general purpose web frameworks to host ML models.</sup>

## Contributing

We welcome any kind of contribution. Please give us feedback by [raising issues](https://github.com/mosecorg/mosec/issues/new/choose) or discussing on [Discord](https://discord.gg/Jq5vxuH69W). You could also directly [contribute](https://mosecorg.github.io/mosec/contributing) your code and pull request!
42 changes: 42 additions & 0 deletions build.envd
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# syntax=v1
# You can install envd with pip: `pip install envd`.
# Make sure you already have docker installed.
# To start the development of mosec, just run `envd up`, then you will get an
# isolated and clean Python & Rust development environment.
# To access GPU, you can run `envd up :gpu`. Make sure you have nvidia-docker
# installed.


def rust():
"""Install Rust."""
install.apt_packages(name=["build-essential"])
run(
[
"curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y",
]
)
runtime.environ(extra_path=["/home/envd/.cargo/bin"])


def jax():
install.python_packages(
name=[
"jax[cuda] -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html",
"chex",
]
)


def build():
base(dev=True)
install.conda()
install.python()
install.python_packages(requirements="requirements/dev.txt")
rust()
# run(["make install"], mount_host=True)
runtime.init(["make install"])


def gpu():
build()
install.cuda(version="11.6.2")
1 change: 1 addition & 0 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ setuptools_scm>=7
pytest>=6
pytest-mock>=3.5
mypy>=0.910
pyright>=1.1.290
pylint>=2.13.8
pydocstyle>=6.1.1
black>=20.8.0
Expand Down