Deploying your first job


What you'll learn

  • How to deploy training code as a job via servicefoundry

This is a guide to deploy training code as a job via servicefoundry

After you complete the guide, you will have a successful deployed a job to train a model on the iris dataser. Your jobs deployment dashboard will look like this:

Project structure

To complete this guide, you are going to create the following files:

  • : contains our training code
  • requirements.txt : contains our dependencies
  • contains our deployment code ( you can also use a deployment configuration for deploying using a YAML file)

Your final file structure is going to look like this:

└── requirements.txt

As you can see, all the following files are created in the same folder/directory

Step 1: Implement the training code

The first step is to create a job that trains a scikit learn model on iris dataset

We start with a containing our training code and requirements.txt with our dependencies.

└── requirements.txt

Click on the Open Recipe below to understand the components of



# for deploying our job deployments

Step 2: Deploying as a Job

You can deploy services on Truefoundry programmatically via our Python SDK.

Create the, after which our file structure will look like this:

File Structure

└── requirements.txt

Follow the recipe below to understand the file :

To deploy the job using Python API use:



.tfyignore files

If there are any files you don't want to be copied to the workspace, like a data file, or any redundant files. You can use .tfyignore files in that case.

End result

On successful deployment, the Job will be created and run immediately.

We can now visit our Applications page to check Build status, Build Logs, Runs History and monitor progress of runs.
See Monitoring and Debugging guide for more details.

See Also