-
Notifications
You must be signed in to change notification settings - Fork 6
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
added workflow example to deploy a model #63
base: main
Are you sure you want to change the base?
Conversation
workflows/train_mnist_wf/temp.py
Outdated
# from tensorflow.keras.datasets import mnist | ||
# import matplotlib.pyplot as plt | ||
import numpy as np |
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.
remove
type: workflow | ||
name: live-demo-example |
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.
removr and add to readme
workflows/train_mnist_wf/README.md
Outdated
- Default value of `workspace_fqn` in main workflow function. | ||
- Value of env variables `TFY_API_KEY` `TFY_HOST` in `task_config`. |
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.
virtual acccount docs
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.
add ml repo in docs also
workflows/train_mnist_wf/deploy.py
Outdated
return None if not value or value == "None" else value | ||
|
||
def deploy_service(model_version_fqn: str, workspace_fqn: str): | ||
service_name = f"mnist-classification-{''.join(random.choices(string.ascii_lowercase + string.digits, k=3))}" |
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.
remove random -> let it override.
from typing import Any, Dict, List, Tuple, Union | ||
from truefoundry.workflow import task, workflow, PythonTaskConfig, TaskPythonBuild, map_task, conditional | ||
from truefoundry.deploy import Resources |
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.
name it train-deploy-workflow
workflows/train_mnist_wf/deploy.py
Outdated
import argparse | ||
import logging | ||
|
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.
move to different folder altogether
task_config = PythonTaskConfig( | ||
image=TaskPythonBuild( | ||
python_version="3.9", | ||
pip_packages=["truefoundry[workflow]==0.5.2", "tensorflow==2.15.0", "s3fs>=2024.10.0"], | ||
), | ||
resources=Resources(cpu_request=1.2, cpu_limit=1.2, memory_limit=3000, memory_request=3000, ephemeral_storage_limit=2000, ephemeral_storage_request=2000), | ||
service_account="default", | ||
env={ | ||
"TFY_API_KEY": "<your-api-key>", | ||
"TFY_HOST": "<tfy-host-value>", | ||
} | ||
) |
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.
run black on all files
task_config = PythonTaskConfig( | ||
image=TaskPythonBuild( | ||
python_version="3.9", | ||
pip_packages=["truefoundry[workflow]==0.5.2", "tensorflow==2.15.0", "s3fs>=2024.10.0"], |
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.
why s3fs has to be added ?
workflows/train_mnist_wf/README.md
Outdated
## Deploying the workflow | ||
|
||
You can deploy the workflow using the following command, make sure your truefoudry cli version is more thatn `4.0.0`. |
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.
steps to run locally
No description provided.