-
Notifications
You must be signed in to change notification settings - Fork 4
Add guide for custom docker images #100
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
Conversation
yixu34
commented
May 16, 2023





docs/guides/custom_docker_images.md
Outdated
|
||
from pydantic import BaseModel | ||
|
||
import my_inference_fn # This is your inference function, defined elsewhere within your Python codebase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wouldn't work with doc-testing integration tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm ok I'll just define it inline here then.
docs/guides/custom_docker_images.md
Outdated
``` | ||
|
||
Creating the Model Endpoint: | ||
```python3 | ||
client.create_model_endpoint( | ||
endpoint_name=f"endpoint-{model_bundle_name}", | ||
model_bundle=model_bundle_name, | ||
endpoint_type="async", | ||
min_workers=0, | ||
max_workers=1, | ||
per_worker=1, | ||
memory="30Gi", | ||
storage="40Gi", | ||
cpus=4, | ||
gpus=1, | ||
gpu_type="nvidia-ampere-a10", | ||
update_if_exists=True, | ||
) | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since integration tests run each code snippet separately, it would only pass tests if you unified these two blocks - maybe you could just make Creating the Model Endpoint:
a comment
tests/test_docs.py
Outdated
@@ -45,7 +45,13 @@ def extract_code_chunks(path: Path, text: str, offset: int): | |||
code = m_code.group(2) | |||
end_line = start_line + code.count("\n") + 1 | |||
source = "\n" * start_line + code | |||
if "test='skip'" in prefix: | |||
if "test='skip'" in source: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary for this PR but I think it would be good to find a solution that doesn't show this comment in the documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm ok tried a couple of things but didn't seem to work - I think test_docs can't rewrite the source?