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

added workflow example to deploy a model #63

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

mitanshudodia
Copy link
Contributor

No description provided.

Comment on lines 1 to 3
# from tensorflow.keras.datasets import mnist
# import matplotlib.pyplot as plt
import numpy as np
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Comment on lines 1 to 2
type: workflow
name: live-demo-example
Copy link
Contributor

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

Comment on lines 3 to 4
- Default value of `workspace_fqn` in main workflow function.
- Value of env variables `TFY_API_KEY` `TFY_HOST` in `task_config`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

virtual acccount docs

Copy link
Contributor

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

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))}"
Copy link
Contributor

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.

Comment on lines 1 to 3
from typing import Any, Dict, List, Tuple, Union
from truefoundry.workflow import task, workflow, PythonTaskConfig, TaskPythonBuild, map_task, conditional
from truefoundry.deploy import Resources
Copy link
Contributor

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

Comment on lines 1 to 3
import argparse
import logging

Copy link
Contributor

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

Comment on lines 10 to 21
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>",
}
)
Copy link
Contributor

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"],
Copy link
Contributor

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 ?

Comment on lines 13 to 15
## Deploying the workflow

You can deploy the workflow using the following command, make sure your truefoudry cli version is more thatn `4.0.0`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

steps to run locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants